Mercurial > emacs
annotate src/xterm.c @ 24693:7d78745d1195
(display-time-update): Allow for wrap-around when
checking against display-time-server-down-time.
author | Andrew Innes <andrewi@gnu.org> |
---|---|
date | Tue, 04 May 1999 17:34:36 +0000 |
parents | 585a5e69e371 |
children | 1edc68c613d8 |
rev | line source |
---|---|
286 | 1 /* X Communication module for terminals which understand the X protocol. |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
2 Copyright (C) 1989, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. |
286 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
6 GNU Emacs is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
621 | 8 the Free Software Foundation; either version 2, or (at your option) |
286 | 9 any later version. |
10 | |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14165
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:
14165
diff
changeset
|
19 Boston, MA 02111-1307, USA. */ |
286 | 20 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
21 /* Xt features made by Fred Pierresteguy. */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
22 |
2977
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
23 /* On 4.3 these lose if they come after xterm.h. */ |
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
24 /* On HP-UX 8.0 signal.h loses if it comes after config.h. */ |
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
25 /* Putting these at the beginning seems to be standard for other .c files. */ |
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
26 #include <signal.h> |
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
27 |
4696
1fc792473491
Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents:
4683
diff
changeset
|
28 #include <config.h> |
286 | 29 |
7902
22b9aaaf0302
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7870
diff
changeset
|
30 #include <stdio.h> |
22b9aaaf0302
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7870
diff
changeset
|
31 |
286 | 32 #ifdef HAVE_X_WINDOWS |
33 | |
34 #include "lisp.h" | |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
35 #include "blockinput.h" |
286 | 36 |
21933
58f3be08e692
Include syssignal.h after lisp.h.
Andreas Schwab <schwab@suse.de>
parents:
21903
diff
changeset
|
37 /* Need syssignal.h for various externs and definitions that may be required |
58f3be08e692
Include syssignal.h after lisp.h.
Andreas Schwab <schwab@suse.de>
parents:
21903
diff
changeset
|
38 by some configurations for calls to signal later in this source file. */ |
58f3be08e692
Include syssignal.h after lisp.h.
Andreas Schwab <schwab@suse.de>
parents:
21903
diff
changeset
|
39 #include "syssignal.h" |
58f3be08e692
Include syssignal.h after lisp.h.
Andreas Schwab <schwab@suse.de>
parents:
21903
diff
changeset
|
40 |
286 | 41 /* This may include sys/types.h, and that somehow loses |
42 if this is not done before the other system files. */ | |
43 #include "xterm.h" | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
44 #include <X11/cursorfont.h> |
286 | 45 |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
46 #ifndef USG |
286 | 47 /* Load sys/types.h if not already loaded. |
48 In some systems loading it twice is suicidal. */ | |
49 #ifndef makedev | |
50 #include <sys/types.h> | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
51 #endif /* makedev */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
52 #endif /* USG */ |
286 | 53 |
16220
02044b05d8e0
Replaced symbol BSD with BSD_SYSTEM.
Karl Heuer <kwzh@gnu.org>
parents:
16209
diff
changeset
|
54 #ifdef BSD_SYSTEM |
286 | 55 #include <sys/ioctl.h> |
16220
02044b05d8e0
Replaced symbol BSD with BSD_SYSTEM.
Karl Heuer <kwzh@gnu.org>
parents:
16209
diff
changeset
|
56 #endif /* ! defined (BSD_SYSTEM) */ |
286 | 57 |
3355
e0c2e8a2ef75
(XTread_socket, case KeyPress) [HPUX]: Test IsModifiedKey.
Richard M. Stallman <rms@gnu.org>
parents:
3284
diff
changeset
|
58 #include "systty.h" |
555 | 59 #include "systime.h" |
286 | 60 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
61 #ifndef INCLUDED_FCNTL |
286 | 62 #include <fcntl.h> |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
63 #endif |
286 | 64 #include <ctype.h> |
65 #include <errno.h> | |
66 #include <setjmp.h> | |
67 #include <sys/stat.h> | |
10366 | 68 /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ |
69 /* #include <sys/param.h> */ | |
286 | 70 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
71 #include "charset.h" |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
72 #include "ccl.h" |
23515
1e52542fb338
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
23162
diff
changeset
|
73 #include "frame.h" |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
74 #include "fontset.h" |
286 | 75 #include "dispextern.h" |
76 #include "termhooks.h" | |
77 #include "termopts.h" | |
78 #include "termchar.h" | |
79 #if 0 | |
80 #include "sink.h" | |
81 #include "sinkmask.h" | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
82 #endif /* ! 0 */ |
286 | 83 #include "gnu.h" |
84 #include "disptab.h" | |
85 #include "buffer.h" | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
86 #include "window.h" |
8652 | 87 #include "keyboard.h" |
8848 | 88 #include "intervals.h" |
21514 | 89 #include "process.h" |
286 | 90 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
91 #ifdef USE_X_TOOLKIT |
15117
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
92 #include <X11/Shell.h> |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
93 #endif |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
94 |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
95 #ifdef USE_X_TOOLKIT |
5898
105c99071e9b
(x_destroy_window) [USE_X_TOOLKIT]: Call free_frame_menubar.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5872
diff
changeset
|
96 extern void free_frame_menubar (); |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
97 extern FRAME_PTR x_menubar_window_to_frame (); |
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
98 #if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES) |
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
99 #define HACK_EDITRES |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
100 extern void _XEditResCheckMessages (); |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
101 #endif /* not NO_EDITRES */ |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
102 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
103 |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
104 #ifndef USE_X_TOOLKIT |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
105 #define x_any_window_to_frame x_window_to_frame |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
106 #define x_top_window_to_frame x_window_to_frame |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
107 #endif |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
108 |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
109 #ifdef USE_X_TOOLKIT |
12189 | 110 #include "widget.h" |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
111 #ifndef XtNinitialState |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
112 #define XtNinitialState "initialState" |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
113 #endif |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
114 #endif |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
115 |
14963
6ac4f300f9b4
Include locale.h if HAVE_SETLOCALE.
Richard M. Stallman <rms@gnu.org>
parents:
14946
diff
changeset
|
116 #ifdef HAVE_SETLOCALE |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
117 /* So we can do setlocale. */ |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
118 #include <locale.h> |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
119 #endif |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
120 |
14305
3cc44eaf9ebf
(x_connection_signal): Explicitly check the thread interlock
Karl Heuer <kwzh@gnu.org>
parents:
14186
diff
changeset
|
121 #ifdef SOLARIS2 |
15292 | 122 /* memmove will be defined as a macro in Xfuncs.h unless |
123 <string.h> is included beforehand. The declaration for memmove in | |
124 <string.h> will cause a syntax error when Xfuncs.h later includes it. */ | |
125 #include <string.h> | |
126 #endif | |
127 | |
14522
9cee3e7c6468
(min, max): Don't define if already defined.
Richard M. Stallman <rms@gnu.org>
parents:
14489
diff
changeset
|
128 #ifndef min |
286 | 129 #define min(a,b) ((a)<(b) ? (a) : (b)) |
14522
9cee3e7c6468
(min, max): Don't define if already defined.
Richard M. Stallman <rms@gnu.org>
parents:
14489
diff
changeset
|
130 #endif |
9cee3e7c6468
(min, max): Don't define if already defined.
Richard M. Stallman <rms@gnu.org>
parents:
14489
diff
changeset
|
131 #ifndef max |
286 | 132 #define max(a,b) ((a)>(b) ? (a) : (b)) |
14522
9cee3e7c6468
(min, max): Don't define if already defined.
Richard M. Stallman <rms@gnu.org>
parents:
14489
diff
changeset
|
133 #endif |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
134 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
135 /* This is a chain of structures for all the X displays currently in use. */ |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
136 struct x_display_info *x_display_list; |
286 | 137 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
138 /* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
139 one for each element of x_display_list and in the same order. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
140 NAME is the name of the frame. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
141 FONT-LIST-CACHE records previous values returned by x-list-fonts. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
142 Lisp_Object x_display_name_list; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
143 |
2474
86c8a6e08fd4
Fix typo in comment delimiter.
Richard M. Stallman <rms@gnu.org>
parents:
2468
diff
changeset
|
144 /* Frame being updated by update_frame. This is declared in term.c. |
2468
35aa32e1a003
* xterm.c (updating_frame): Declare this extern instead of static,
Jim Blandy <jimb@redhat.com>
parents:
2439
diff
changeset
|
145 This is set by update_begin and looked at by all the |
286 | 146 XT functions. It is zero while not inside an update. |
771 | 147 In that case, the XT functions assume that `selected_frame' |
148 is the frame to apply to. */ | |
2468
35aa32e1a003
* xterm.c (updating_frame): Declare this extern instead of static,
Jim Blandy <jimb@redhat.com>
parents:
2439
diff
changeset
|
149 extern struct frame *updating_frame; |
771 | 150 |
21514 | 151 extern int waiting_for_input; |
15507
3fe1a322fbf5
(x_connection_closed): If waiting_for_input, call quit_throw_to_read_char.
Richard M. Stallman <rms@gnu.org>
parents:
15472
diff
changeset
|
152 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
153 /* This is a frame waiting to be autoraised, within XTread_socket. */ |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
154 struct frame *pending_autoraise_frame; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
155 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
156 #ifdef USE_X_TOOLKIT |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
157 /* The application context for Xt use. */ |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
158 XtAppContext Xt_app_con; |
12494
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
159 |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
160 static String Xt_default_resources[] = |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
161 { |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
162 0 |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
163 }; |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
164 #endif |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
165 |
286 | 166 /* During an update, maximum vpos for ins/del line operations to affect. */ |
167 | |
168 static int flexlines; | |
169 | |
170 /* During an update, nonzero if chars output now should be highlighted. */ | |
171 | |
172 static int highlight; | |
173 | |
174 /* Nominal cursor position -- where to draw output. | |
175 During an update, these are different from the cursor-box position. */ | |
176 | |
177 static int curs_x; | |
178 static int curs_y; | |
179 | |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
180 /* Mouse movement. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
181 |
15042
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
182 Formerly, we used PointerMotionHintMask (in STANDARD_EVENT_MASK) |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
183 so that we would have to call XQueryPointer after each MotionNotify |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
184 event to ask for another such event. However, this made mouse tracking |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
185 slow, and there was a bug that made it eventually stop. |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
186 |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
187 Simply asking for MotionNotify all the time seems to work better. |
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
188 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
189 In order to avoid asking for motion events and then throwing most |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
190 of them away or busy-polling the server for mouse positions, we ask |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
191 the server for pointer motion hints. This means that we get only |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
192 one event per group of mouse movements. "Groups" are delimited by |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
193 other kinds of events (focus changes and button clicks, for |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
194 example), or by XQueryPointer calls; when one of these happens, we |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
195 get another MotionNotify event the next time the mouse moves. This |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
196 is at least as efficient as getting motion events when mouse |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
197 tracking is on, and I suspect only negligibly worse when tracking |
15042
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
198 is off. */ |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
199 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
200 /* Where the mouse was last time we reported a mouse event. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
201 static FRAME_PTR last_mouse_frame; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
202 static XRectangle last_mouse_glyph; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
203 |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
204 static Lisp_Object last_mouse_press_frame; |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
205 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
206 /* The scroll bar in which the last X motion event occurred. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
207 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
208 If the last X motion event occurred in a scroll bar, we set this |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
209 so XTmouse_position can know whether to report a scroll bar motion or |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
210 an ordinary motion. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
211 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
212 If the last X motion event didn't occur in a scroll bar, we set this |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
213 to Qnil, to tell XTmouse_position to return an ordinary motion event. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
214 static Lisp_Object last_mouse_scroll_bar; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
215 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
216 /* This is a hack. We would really prefer that XTmouse_position would |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
217 return the time associated with the position it returns, but there |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
218 doesn't seem to be any way to wrest the timestamp from the server |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
219 along with the position query. So, we just keep track of the time |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
220 of the last movement we received, and return that in hopes that |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
221 it's somewhat accurate. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
222 static Time last_mouse_movement_time; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
223 |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
224 /* Incremented by XTread_socket whenever it really tries to read events. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
225 #ifdef __STDC__ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
226 static int volatile input_signal_count; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
227 #else |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
228 static int input_signal_count; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
229 #endif |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
230 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
231 /* Used locally within XTread_socket. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
232 static int x_noop_count; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
233 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
234 /* Initial values of argv and argc. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
235 extern char **initial_argv; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
236 extern int initial_argc; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
237 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
238 extern Lisp_Object Vcommand_line_args, Vsystem_name; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
239 |
286 | 240 /* Tells if a window manager is present or not. */ |
241 | |
242 extern Lisp_Object Vx_no_window_manager; | |
243 | |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
244 extern Lisp_Object Qface, Qmouse_face; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
245 |
286 | 246 extern int errno; |
247 | |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
248 /* A mask of extra modifier bits to put into every keyboard char. */ |
1841
338e4ffdb54b
(XTread_socket): Support extra_keyboard_modifiers.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
249 extern int extra_keyboard_modifiers; |
338e4ffdb54b
(XTread_socket): Support extra_keyboard_modifiers.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
250 |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
251 static Lisp_Object Qvendor_specific_keysyms; |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
252 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
253 extern XrmDatabase x_load_resources (); |
286 | 254 |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
255 extern Lisp_Object x_icon_type (); |
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
256 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
257 void x_delete_display (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
258 |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
259 static void redraw_previous_char (); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
260 static void redraw_following_char (); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
261 static unsigned int x_x_to_emacs_modifiers (); |
286 | 262 |
7282
2bc4929691e9
(show_mouse_face): Fix test for cursor in highlighted area.
Karl Heuer <kwzh@gnu.org>
parents:
7264
diff
changeset
|
263 static int fast_find_position (); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
264 static void note_mouse_highlight (); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
265 static void clear_mouse_face (); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
266 static void show_mouse_face (); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
267 static void do_line_dance (); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
268 |
21514 | 269 static void XTcursor_to (); |
270 static void XTclear_end_of_line (); | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
271 static int x_io_error_quitter (); |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
272 int x_catch_errors (); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
273 void x_uncatch_errors (); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
274 |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
275 #if 0 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
276 /* This is a function useful for recording debugging information |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
277 about the sequence of occurrences in this file. */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
278 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
279 struct record |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
280 { |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
281 char *locus; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
282 int type; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
283 }; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
284 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
285 struct record event_record[100]; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
286 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
287 int event_record_index; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
288 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
289 record_event (locus, type) |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
290 char *locus; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
291 int type; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
292 { |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
293 if (event_record_index == sizeof (event_record) / sizeof (struct record)) |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
294 event_record_index = 0; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
295 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
296 event_record[event_record_index].locus = locus; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
297 event_record[event_record_index].type = type; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
298 event_record_index++; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
299 } |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
300 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
301 #endif /* 0 */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
302 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
303 /* Return the struct x_display_info corresponding to DPY. */ |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
304 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
305 struct x_display_info * |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
306 x_display_info_for_display (dpy) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
307 Display *dpy; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
308 { |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
309 struct x_display_info *dpyinfo; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
310 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
311 for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
312 if (dpyinfo->display == dpy) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
313 return dpyinfo; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
314 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
315 return 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
316 } |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
317 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
318 /* Starting and ending updates. |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
319 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
320 These hooks are called by update_frame at the beginning and end |
771 | 321 of a frame update. We record in `updating_frame' the identity |
322 of the frame being updated, so that the XT... functions do not | |
323 need to take a frame as argument. Most of the XT... functions | |
286 | 324 should never be called except during an update, the only exceptions |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
325 being XTcursor_to, XTwrite_glyphs and XTreassert_line_highlight. */ |
286 | 326 |
21514 | 327 static void |
771 | 328 XTupdate_begin (f) |
329 struct frame *f; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
330 { |
286 | 331 int mask; |
332 | |
771 | 333 if (f == 0) |
286 | 334 abort (); |
335 | |
771 | 336 flexlines = f->height; |
286 | 337 highlight = 0; |
338 | |
339 BLOCK_INPUT; | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
340 |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
341 curs_x = FRAME_CURSOR_X (f); |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
342 curs_y = FRAME_CURSOR_Y (f); |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
343 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
344 if (f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
345 { |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
346 /* Don't do highlighting for mouse motion during the update. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
347 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1; |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
348 |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
349 /* If the frame needs to be redrawn, |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
350 simply forget about any prior mouse highlighting. */ |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
351 if (FRAME_GARBAGED_P (f)) |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
352 FRAME_X_DISPLAY_INFO (f)->mouse_face_window = Qnil; |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
353 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
354 if (!NILP (FRAME_X_DISPLAY_INFO (f)->mouse_face_window)) |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
355 { |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
356 int firstline, lastline, i; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
357 struct window *w = XWINDOW (FRAME_X_DISPLAY_INFO (f)->mouse_face_window); |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
358 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
359 /* Find the first, and the last+1, lines affected by redisplay. */ |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
360 for (firstline = 0; firstline < f->height; firstline++) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
361 if (FRAME_DESIRED_GLYPHS (f)->enable[firstline]) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
362 break; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
363 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
364 lastline = f->height; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
365 for (i = f->height - 1; i >= 0; i--) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
366 { |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
367 if (FRAME_DESIRED_GLYPHS (f)->enable[i]) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
368 break; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
369 else |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
370 lastline = i; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
371 } |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
372 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
373 /* Can we tell that this update does not affect the window |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
374 where the mouse highlight is? If so, no need to turn off. |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
375 Likewise, don't do anything if the frame is garbaged; |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
376 in that case, the FRAME_CURRENT_GLYPHS that we would use |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
377 are all wrong, and we will redisplay that line anyway. */ |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
378 if (! (firstline > (XFASTINT (w->top) + window_internal_height (w)) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
379 || lastline < XFASTINT (w->top))) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
380 clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
381 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
382 } |
8781
98741404d3e0
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8724
diff
changeset
|
383 |
286 | 384 UNBLOCK_INPUT; |
385 } | |
386 | |
21514 | 387 static void |
771 | 388 XTupdate_end (f) |
389 struct frame *f; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
390 { |
286 | 391 int mask; |
392 | |
393 BLOCK_INPUT; | |
394 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
395 do_line_dance (); |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
396 x_display_cursor (f, 1, curs_x, curs_y); |
771 | 397 |
15993
36d90de737c9
(XTupdate_end): Always clear mouse_face_defer flag.
Richard M. Stallman <rms@gnu.org>
parents:
15990
diff
changeset
|
398 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
399 #if 0 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
400 /* This fails in the case of having updated only the echo area |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
401 if we have switched buffers. In that case, FRAME_CURRENT_GLYPHS |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
402 has no relation to the current contents, and its charstarts |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
403 have no relation to the contents of the window-buffer. |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
404 I don't know a clean way to check |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
405 for that case. window_end_valid isn't set up yet. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
406 if (f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
407 note_mouse_highlight (f, FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_x, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
408 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_y); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
409 #endif |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
410 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
411 XFlush (FRAME_X_DISPLAY (f)); |
286 | 412 UNBLOCK_INPUT; |
413 } | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
414 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
415 /* This is called after a redisplay on frame F. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
416 |
21514 | 417 static void |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
418 XTframe_up_to_date (f) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
419 FRAME_PTR f; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
420 { |
13633
3fa66bb82d59
(XTframe_up_to_date): Block and unblock input.
Richard M. Stallman <rms@gnu.org>
parents:
13627
diff
changeset
|
421 BLOCK_INPUT; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
422 if (FRAME_X_DISPLAY_INFO (f)->mouse_face_deferred_gc |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
423 || f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame) |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
424 { |
21017
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
425 if (FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame) |
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
426 note_mouse_highlight (FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame, |
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
427 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_x, |
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
428 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_y); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
429 FRAME_X_DISPLAY_INFO (f)->mouse_face_deferred_gc = 0; |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
430 } |
13633
3fa66bb82d59
(XTframe_up_to_date): Block and unblock input.
Richard M. Stallman <rms@gnu.org>
parents:
13627
diff
changeset
|
431 UNBLOCK_INPUT; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
432 } |
286 | 433 |
434 /* External interface to control of standout mode. | |
435 Call this when about to modify line at position VPOS | |
436 and not change whether it is highlighted. */ | |
437 | |
21514 | 438 void |
286 | 439 XTreassert_line_highlight (new, vpos) |
440 int new, vpos; | |
441 { | |
442 highlight = new; | |
443 } | |
444 | |
445 /* Call this when about to modify line at position VPOS | |
446 and change whether it is highlighted. */ | |
447 | |
21514 | 448 static void |
286 | 449 XTchange_line_highlight (new_highlight, vpos, first_unused_hpos) |
450 int new_highlight, vpos, first_unused_hpos; | |
451 { | |
452 highlight = new_highlight; | |
453 XTcursor_to (vpos, 0); | |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
454 XTclear_end_of_line (FRAME_WINDOW_WIDTH (updating_frame)); |
286 | 455 } |
456 | |
457 /* This is used when starting Emacs and when restarting after suspend. | |
458 When starting Emacs, no X window is mapped. And nothing must be done | |
459 to Emacs's own window if it is suspended (though that rarely happens). */ | |
460 | |
21514 | 461 static void |
286 | 462 XTset_terminal_modes () |
463 { | |
464 } | |
465 | |
466 /* This is called when exiting or suspending Emacs. | |
467 Exiting will make the X-windows go away, and suspending | |
468 requires no action. */ | |
469 | |
21514 | 470 static void |
286 | 471 XTreset_terminal_modes () |
472 { | |
771 | 473 /* XTclear_frame (); */ |
286 | 474 } |
475 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
476 /* Set the nominal cursor position of the frame. |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
477 This is where display update commands will take effect. |
286 | 478 This does not affect the place where the cursor-box is displayed. */ |
479 | |
21514 | 480 static void |
286 | 481 XTcursor_to (row, col) |
482 register int row, col; | |
483 { | |
484 int mask; | |
485 int orow = row; | |
21903
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
486 struct frame *f; |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
487 |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
488 f = updating_frame; |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
489 if (f == 0) |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
490 f = selected_frame; |
286 | 491 |
492 curs_x = col; | |
21903
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
493 if (curs_x >= FRAME_CURSOR_X_LIMIT (f)) |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
494 curs_x = FRAME_CURSOR_X_LIMIT (f) - 1; |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
495 |
286 | 496 curs_y = row; |
497 | |
771 | 498 if (updating_frame == 0) |
286 | 499 { |
500 BLOCK_INPUT; | |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
501 x_display_cursor (selected_frame, 1, curs_x, curs_y); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
502 XFlush (FRAME_X_DISPLAY (selected_frame)); |
286 | 503 UNBLOCK_INPUT; |
504 } | |
505 } | |
506 | |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
507 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
508 /* Return a pointer to per char metric information in FONT of a |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
509 character pointed by B (*XChar2b). */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
510 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
511 #define PER_CHAR_METRIC(font, b) \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
512 ((font)->per_char \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
513 ? ((font)->per_char + (b)->byte2 - (font)->min_char_or_byte2 \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
514 + (((font)->min_byte1 || (font)->max_byte1) \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
515 ? (((b)->byte1 - (font)->min_byte1) \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
516 * ((font)->max_char_or_byte2 - (font)->min_char_or_byte2 + 1)) \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
517 : 0)) \ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
518 : &((font)->max_bounds)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
519 |
286 | 520 /* Display a sequence of N glyphs found at GP. |
521 WINDOW is the x-window to output to. LEFT and TOP are starting coords. | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
522 HL is 1 if this text is highlighted, 2 if the cursor is on it, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
523 3 if should appear in its mouse-face. |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
524 JUST_FOREGROUND if 1 means draw only the foreground; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
525 don't alter the background. |
286 | 526 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
527 CMPCHARP if non NULL is a pointer to the struct cmpchar_info, which |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
528 means drawing glyphs on the same column. This is set to non NULL |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
529 only when recursively called within dumpglyphs to draw a composite |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
530 character specified by CMPCHAR. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
531 |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
532 FONT is the default font to use (for glyphs whose font-code is 0). |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
533 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
534 Since the display generation code is responsible for calling |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
535 compute_char_face and compute_glyph_face on everything it puts in |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
536 the display structure, we can assume that the face code on each |
3883
b9e5a869b33e
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3839
diff
changeset
|
537 glyph is a valid index into FRAME_COMPUTED_FACES (f), and the one |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
538 to which we can actually apply intern_face. |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
539 Call this function with input blocked. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
540 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
541 Return overall pixel width of the drawn glyphs. */ |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
542 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
543 #if 1 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
544 /* This is the multi-face code. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
545 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
546 static int |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
547 dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
548 struct frame *f; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
549 int left, top; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
550 register GLYPH *gp; /* Points to first GLYPH. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
551 register int n; /* Number of glyphs to display. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
552 int hl; |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
553 int just_foreground; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
554 struct cmpchar_info *cmpcharp; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
555 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
556 /* Holds characters to be displayed. */ |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
557 XChar2b *x_2byte_buffer |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
558 = (XChar2b *) alloca (FRAME_WINDOW_WIDTH (f) * sizeof (*x_2byte_buffer)); |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
559 register XChar2b *cp; /* Steps through x_2byte_buffer[]. */ |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
560 char *x_1byte_buffer |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
561 = (char *) alloca (FRAME_WINDOW_WIDTH (f) * sizeof (*x_1byte_buffer)); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
562 register int tlen = GLYPH_TABLE_LENGTH; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
563 register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
564 Window window = FRAME_X_WINDOW (f); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
565 int orig_left = left; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
566 int gidx = 0; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
567 int i; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
568 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
569 while (n > 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
570 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
571 /* Get the face-code of the next GLYPH. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
572 int cf, len; |
16898
6370d4132d69
(dumpglyphs): Declare g as GLYPH.
Richard M. Stallman <rms@gnu.org>
parents:
16753
diff
changeset
|
573 GLYPH g = *gp; |
18733
a22147185235
(dumpglyphs): Declare local variable first_ch as Lisp_Object, not int.
Richard M. Stallman <rms@gnu.org>
parents:
18706
diff
changeset
|
574 int ch, charset; |
a22147185235
(dumpglyphs): Declare local variable first_ch as Lisp_Object, not int.
Richard M. Stallman <rms@gnu.org>
parents:
18706
diff
changeset
|
575 Lisp_Object first_ch; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
576 /* HIGHEST and LOWEST are used while drawing a composite |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
577 character. The meanings are described later. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
578 int highest, lowest; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
579 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
580 GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
581 cf = (cmpcharp ? cmpcharp->face_work : FAST_GLYPH_FACE (g)); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
582 ch = FAST_GLYPH_CHAR (g); |
23037
88fadff500be
x_display_unibyte_char_with_fontset renamed to
Richard M. Stallman <rms@gnu.org>
parents:
23023
diff
changeset
|
583 if (unibyte_display_via_language_environment |
23023
720d197458cf
(dumpglyphs): If x_display_unibyte_char_with_fontset is
Kenichi Handa <handa@m17n.org>
parents:
22956
diff
changeset
|
584 && SINGLE_BYTE_CHAR_P (ch) |
23925
1deaaafdf9ea
(dumpglyphs): Don't convert 7-bit ASCII characters via
Eli Zaretskii <eliz@gnu.org>
parents:
23701
diff
changeset
|
585 && (ch >= 0240 |
1deaaafdf9ea
(dumpglyphs): Don't convert 7-bit ASCII characters via
Eli Zaretskii <eliz@gnu.org>
parents:
23701
diff
changeset
|
586 || (ch >= 0200 && !NILP (Vnonascii_translation_table)))) |
23023
720d197458cf
(dumpglyphs): If x_display_unibyte_char_with_fontset is
Kenichi Handa <handa@m17n.org>
parents:
22956
diff
changeset
|
587 ch = unibyte_char_to_multibyte (ch); |
18733
a22147185235
(dumpglyphs): Declare local variable first_ch as Lisp_Object, not int.
Richard M. Stallman <rms@gnu.org>
parents:
18706
diff
changeset
|
588 if (gidx == 0) XSETFASTINT (first_ch, ch); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
589 charset = CHAR_CHARSET (ch); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
590 if (charset == CHARSET_COMPOSITION) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
591 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
592 /* We must draw components of the composite character on the |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
593 same column. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
594 cmpcharp = cmpchar_table[COMPOSITE_CHAR_ID (ch)]; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
595 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
596 /* Set the face in the slot for work. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
597 cmpcharp->face_work = cf; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
598 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
599 /* We don't need the return value ... */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
600 dumpglyphs (f, left, top, cmpcharp->glyph, cmpcharp->glyph_len, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
601 hl, just_foreground, cmpcharp); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
602 /* ... because the width of just drawn text can be |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
603 calculated as follows. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
604 left += FONT_WIDTH (f->output_data.x->font) * cmpcharp->width; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
605 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
606 ++gp, --n; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
607 while (gp && (*gp & GLYPH_MASK_PADDING)) ++gp, --n; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
608 cmpcharp = NULL; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
609 continue; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
610 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
611 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
612 /* Find the run of consecutive glyphs which can be drawn with |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
613 the same GC (i.e. the same charset and the same face-code). |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
614 Extract their character codes into X_2BYTE_BUFFER. |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
615 If CMPCHARP is not NULL, face-code is not checked because we |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
616 use only the face specified in `cmpcharp->face_work'. */ |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
617 cp = x_2byte_buffer; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
618 while (n > 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
619 { |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
620 int this_charset, c1, c2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
621 |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
622 g = *gp; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
623 GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
624 ch = FAST_GLYPH_CHAR (g); |
23037
88fadff500be
x_display_unibyte_char_with_fontset renamed to
Richard M. Stallman <rms@gnu.org>
parents:
23023
diff
changeset
|
625 if (unibyte_display_via_language_environment |
23023
720d197458cf
(dumpglyphs): If x_display_unibyte_char_with_fontset is
Kenichi Handa <handa@m17n.org>
parents:
22956
diff
changeset
|
626 && SINGLE_BYTE_CHAR_P (ch) |
23925
1deaaafdf9ea
(dumpglyphs): Don't convert 7-bit ASCII characters via
Eli Zaretskii <eliz@gnu.org>
parents:
23701
diff
changeset
|
627 && (ch >= 0240 |
1deaaafdf9ea
(dumpglyphs): Don't convert 7-bit ASCII characters via
Eli Zaretskii <eliz@gnu.org>
parents:
23701
diff
changeset
|
628 || (ch >= 0200 && !NILP (Vnonascii_translation_table)))) |
23023
720d197458cf
(dumpglyphs): If x_display_unibyte_char_with_fontset is
Kenichi Handa <handa@m17n.org>
parents:
22956
diff
changeset
|
629 ch = unibyte_char_to_multibyte (ch); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
630 SPLIT_CHAR (ch, this_charset, c1, c2); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
631 if (this_charset != charset |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
632 || (cmpcharp == NULL && FAST_GLYPH_FACE (g) != cf)) |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
633 break; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
634 |
17316
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
635 if (c2 > 0) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
636 cp->byte1 = c1, cp->byte2 = c2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
637 else |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
638 cp->byte1 = 0, cp->byte2 = c1; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
639 ++cp; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
640 ++gp, --n; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
641 while (gp && (*gp & GLYPH_MASK_PADDING)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
642 ++gp, --n; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
643 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
644 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
645 /* LEN gets the length of the run. */ |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
646 len = cp - x_2byte_buffer; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
647 /* Now output this run of chars, with the font and pixel values |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
648 determined by the face code CF. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
649 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
650 struct face *face = FRAME_DEFAULT_FACE (f); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
651 XFontStruct *font = NULL; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
652 GC gc; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
653 int stippled = 0; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
654 int line_height = f->output_data.x->line_height; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
655 /* Pixel width of each glyph in this run. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
656 int glyph_width |
17316
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
657 = (FONT_WIDTH (f->output_data.x->font) |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
658 * (cmpcharp ? cmpcharp->width : CHARSET_WIDTH (charset))); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
659 /* Overall pixel width of this run. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
660 int run_width |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
661 = (FONT_WIDTH (f->output_data.x->font) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
662 * (cmpcharp ? cmpcharp->width : len * CHARSET_WIDTH (charset))); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
663 /* A flag to tell if we have already filled background. We |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
664 fill background in advance in the following cases: |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
665 1) A face has stipple. |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
666 2) A height of font is shorter than LINE_HEIGHT. |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
667 3) Drawing a composite character. |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
668 4) Font has non-zero _MULE_BASELINE_OFFSET property. |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
669 After filling background, we draw glyphs by XDrawString16. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
670 int background_filled; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
671 /* Baseline position of a character, offset from TOP. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
672 int baseline; |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
673 /* The property value of `_MULE_RELATIVE_COMPOSE' and |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
674 `_MULE_DEFAULT_ASCENT'. */ |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
675 int relative_compose = 0, default_ascent = 0; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
676 /* 1 if we find no font or a font of inappropriate size. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
677 int require_clipping; |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
678 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
679 /* HL = 3 means use a mouse face previously chosen. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
680 if (hl == 3) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
681 cf = FRAME_X_DISPLAY_INFO (f)->mouse_face_face_id; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
682 |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
683 /* First look at the face of the text itself. */ |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
684 if (cf != 0) |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
685 { |
5719
d3074ff90741
(dumpglyphs): Don't crash for invalid face code.
Richard M. Stallman <rms@gnu.org>
parents:
5686
diff
changeset
|
686 /* It's possible for the display table to specify |
d3074ff90741
(dumpglyphs): Don't crash for invalid face code.
Richard M. Stallman <rms@gnu.org>
parents:
5686
diff
changeset
|
687 a face code that is out of range. Use 0 in that case. */ |
3883
b9e5a869b33e
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3839
diff
changeset
|
688 if (cf < 0 || cf >= FRAME_N_COMPUTED_FACES (f) |
b9e5a869b33e
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3839
diff
changeset
|
689 || FRAME_COMPUTED_FACES (f) [cf] == 0) |
5719
d3074ff90741
(dumpglyphs): Don't crash for invalid face code.
Richard M. Stallman <rms@gnu.org>
parents:
5686
diff
changeset
|
690 cf = 0; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
691 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
692 if (cf == 1) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
693 face = FRAME_MODE_LINE_FACE (f); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
694 else |
3883
b9e5a869b33e
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3839
diff
changeset
|
695 face = intern_face (f, FRAME_COMPUTED_FACES (f) [cf]); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
696 if (FACE_STIPPLE (face)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
697 stippled = 1; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
698 } |
2785
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
699 |
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
700 /* Then comes the distinction between modeline and normal text. */ |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
701 else if (hl == 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
702 ; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
703 else if (hl == 1) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
704 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
705 face = FRAME_MODE_LINE_FACE (f); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
706 if (FACE_STIPPLE (face)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
707 stippled = 1; |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
708 } |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
709 |
17316
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
710 #define FACE_DEFAULT (~0) |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
711 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
712 /* Setting appropriate font and gc for this charset. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
713 if (charset != CHARSET_ASCII) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
714 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
715 int font_id; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
716 int fontset = FACE_FONTSET (face); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
717 struct font_info *fontp; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
718 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
719 if ((fontset < 0 && (fontset = FRAME_FONTSET (f)) < 0) |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
720 || !(fontp = FS_LOAD_FONT (f, FRAME_X_FONT_TABLE (f), |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
721 charset, NULL, fontset))) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
722 goto font_not_found; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
723 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
724 font = (XFontStruct *) (fontp->font); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
725 gc = FACE_NON_ASCII_GC (face); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
726 XSetFont (FRAME_X_DISPLAY (f), gc, font->fid); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
727 baseline |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
728 = (font->max_byte1 != 0 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
729 ? (line_height + font->ascent - font->descent) / 2 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
730 : f->output_data.x->font_baseline - fontp->baseline_offset); |
18188
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
731 if (FONT_HEIGHT (font) <= line_height |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
732 && (font->ascent > baseline |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
733 || font->descent > line_height - baseline)) |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
734 /* Adjust baseline for this font to show the whole |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
735 glyphs in a line. */ |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
736 baseline = line_height - font->descent; |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
737 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
738 if (cmpcharp && cmpcharp->cmp_rule == NULL) |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
739 { |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
740 relative_compose = fontp->relative_compose; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
741 default_ascent = fontp->default_ascent; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
742 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
743 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
744 /* We have to change code points in the following cases. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
745 if (fontp->font_encoder) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
746 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
747 /* This font requires CCL program to calculate code |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
748 point of characters. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
749 struct ccl_program *ccl = fontp->font_encoder; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
750 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
751 if (CHARSET_DIMENSION (charset) == 1) |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
752 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
753 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
754 ccl->reg[0] = charset; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
755 ccl->reg[1] = cp->byte2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
756 ccl_driver (ccl, NULL, NULL, 0, 0, NULL); |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
757 /* We assume that MSBs are appropriately |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
758 set/reset by CCL program. */ |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
759 if (font->max_byte1 == 0) /* 1-byte font */ |
22773
bd776f15bb43
(dumpglyphs): After calling ccl_driver, set cp->byte1 to
Kenichi Handa <handa@m17n.org>
parents:
22626
diff
changeset
|
760 cp->byte1 = 0, cp->byte2 = ccl->reg[1]; |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
761 else |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
762 cp->byte1 = ccl->reg[1], cp->byte2 = ccl->reg[2]; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
763 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
764 else |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
765 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
766 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
767 ccl->reg[0] = charset; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
768 ccl->reg[1] = cp->byte1, ccl->reg[2] = cp->byte2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
769 ccl_driver (ccl, NULL, NULL, 0, 0, NULL); |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
770 /* We assume that MSBs are appropriately |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
771 set/reset by CCL program. */ |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
772 if (font->max_byte1 == 0) /* 1-byte font */ |
22773
bd776f15bb43
(dumpglyphs): After calling ccl_driver, set cp->byte1 to
Kenichi Handa <handa@m17n.org>
parents:
22626
diff
changeset
|
773 cp->byte1 = 0, cp->byte2 = ccl->reg[1]; |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
774 else |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
775 cp->byte1 = ccl->reg[1], cp->byte2 = ccl->reg[2]; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
776 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
777 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
778 else if (fontp->encoding[charset]) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
779 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
780 int enc = fontp->encoding[charset]; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
781 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
782 if ((enc == 1 || enc == 2) && CHARSET_DIMENSION (charset) == 2) |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
783 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
784 cp->byte1 |= 0x80; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
785 if (enc == 1 || enc == 3) |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
786 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
787 cp->byte2 |= 0x80; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
788 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
789 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
790 else |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
791 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
792 font_not_found: |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
793 if (charset == CHARSET_ASCII || charset == charset_latin_iso8859_1) |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
794 { |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
795 font = FACE_FONT (face); |
22522
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
796 if (!font || font == (XFontStruct *) FACE_DEFAULT) |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
797 font = f->output_data.x->font; |
18706
4af0aa969bbe
(x_load_font): Get value of fontp->height from
Richard M. Stallman <rms@gnu.org>
parents:
18705
diff
changeset
|
798 baseline = FONT_BASE (f->output_data.x->font); |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
799 if (charset == charset_latin_iso8859_1) |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
800 { |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
801 if (font->max_char_or_byte2 < 0x80) |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
802 /* This font can't display Latin1 characters. */ |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
803 font = NULL; |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
804 else |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
805 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
806 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
807 cp->byte2 |= 0x80; |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
808 } |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
809 } |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
810 } |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
811 gc = FACE_GC (face); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
812 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
813 |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
814 /* Now override that if the cursor's on this character. */ |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
815 if (hl == 2) |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
816 { |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
817 /* The cursor overrides stippling. */ |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
818 stippled = 0; |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
819 |
17316
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
820 if (font == f->output_data.x->font |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
821 && face->background == f->output_data.x->background_pixel |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
822 && face->foreground == f->output_data.x->foreground_pixel |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
823 && !cmpcharp) |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
824 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
825 gc = f->output_data.x->cursor_gc; |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
826 } |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
827 /* Cursor on non-default face: must merge. */ |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
828 else |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
829 { |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
830 XGCValues xgcv; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
831 unsigned long mask; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
832 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
833 xgcv.background = f->output_data.x->cursor_pixel; |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
834 xgcv.foreground = face->background; |
5987
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
835 /* If the glyph would be invisible, |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
836 try a different foreground. */ |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
837 if (xgcv.foreground == xgcv.background) |
7469
24b292242269
(dumpglyphs): For cursor foreground, try the
Richard M. Stallman <rms@gnu.org>
parents:
7415
diff
changeset
|
838 xgcv.foreground = face->foreground; |
5987
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
839 if (xgcv.foreground == xgcv.background) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
840 xgcv.foreground = f->output_data.x->cursor_foreground_pixel; |
5987
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
841 if (xgcv.foreground == xgcv.background) |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
842 xgcv.foreground = face->foreground; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
843 /* Make sure the cursor is distinct from text in this face. */ |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
844 if (xgcv.background == face->background |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
845 && xgcv.foreground == face->foreground) |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
846 { |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
847 xgcv.background = face->foreground; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
848 xgcv.foreground = face->background; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
849 } |
22522
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
850 xgcv.graphics_exposures = 0; |
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
851 mask = GCForeground | GCBackground | GCGraphicsExposures; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
852 if (font) |
22522
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
853 { |
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
854 xgcv.font = font->fid; |
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
855 mask |= GCFont; |
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
856 } |
f56d8440c0a4
(dumpglyphs): Check the case that FACE_FONT (face) is
Kenichi Handa <handa@m17n.org>
parents:
22503
diff
changeset
|
857 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
858 if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
859 XChangeGC (FRAME_X_DISPLAY (f), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
860 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
861 mask, &xgcv); |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
862 else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
863 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
864 = XCreateGC (FRAME_X_DISPLAY (f), window, mask, &xgcv); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
865 gc = FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc; |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
866 #if 0 |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
867 /* If this code is restored, it must also reset to the default stipple |
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
868 if necessary. */ |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
869 if (face->stipple && face->stipple != FACE_DEFAULT) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
870 XSetStipple (FRAME_X_DISPLAY (f), gc, face->stipple); |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
871 #endif |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
872 } |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
873 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
874 |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
875 if (font) |
17316
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
876 require_clipping = (!NILP (Vclip_large_size_font) |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
877 && (font->ascent > baseline |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
878 || font->descent > line_height - baseline |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
879 || (!cmpcharp |
f27f4c559b21
(dumpglyphs): Clip and highlight glyphs displayed with
Kenichi Handa <handa@m17n.org>
parents:
17232
diff
changeset
|
880 && FONT_WIDTH (font) > glyph_width))); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
881 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
882 if (font && (just_foreground || (cmpcharp && gidx > 0))) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
883 background_filled = 1; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
884 else if (stippled) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
885 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
886 /* Turn stipple on. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
887 XSetFillStyle (FRAME_X_DISPLAY (f), gc, FillOpaqueStippled); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
888 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
889 /* Draw stipple or background color on background. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
890 XFillRectangle (FRAME_X_DISPLAY (f), window, gc, |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
891 left, top, run_width, line_height); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
892 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
893 /* Turn stipple off. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
894 XSetFillStyle (FRAME_X_DISPLAY (f), gc, FillSolid); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
895 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
896 background_filled = 1; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
897 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
898 else if (!font |
24561
6f4ae209bbac
(dumpglyphs): Be sure to fill the whole background of
Kenichi Handa <handa@m17n.org>
parents:
24489
diff
changeset
|
899 || FONT_BASE (font) < baseline |
6f4ae209bbac
(dumpglyphs): Be sure to fill the whole background of
Kenichi Handa <handa@m17n.org>
parents:
24489
diff
changeset
|
900 || (FONT_HEIGHT (font) - FONT_BASE (font) |
6f4ae209bbac
(dumpglyphs): Be sure to fill the whole background of
Kenichi Handa <handa@m17n.org>
parents:
24489
diff
changeset
|
901 < line_height - baseline) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
902 || FONT_WIDTH (font) < glyph_width |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
903 || cmpcharp) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
904 { |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
905 /* Fill a area for the current run in background pixle of GC. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
906 XGCValues xgcv; |
18706
4af0aa969bbe
(x_load_font): Get value of fontp->height from
Richard M. Stallman <rms@gnu.org>
parents:
18705
diff
changeset
|
907 unsigned long mask = GCForeground | GCBackground | GCFillStyle; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
908 |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
909 /* The current code at first set foreground to background, |
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
910 fill the area, then recover the original foreground. |
18188
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
911 Aren't there any smarter ways? */ |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
912 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
913 XGetGCValues (FRAME_X_DISPLAY (f), gc, mask, &xgcv); |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
914 XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.background); |
18706
4af0aa969bbe
(x_load_font): Get value of fontp->height from
Richard M. Stallman <rms@gnu.org>
parents:
18705
diff
changeset
|
915 XSetFillStyle (FRAME_X_DISPLAY (f), gc, FillSolid); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
916 XFillRectangle (FRAME_X_DISPLAY (f), window, gc, |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
917 left, top, run_width, line_height); |
17720
530ee47cb56b
(dumpglyphs): Even if font (not fontset) is used,
Kenichi Handa <handa@m17n.org>
parents:
17607
diff
changeset
|
918 XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.foreground); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
919 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
920 background_filled = 1; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
921 if (cmpcharp) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
922 /* To assure not to fill background while drawing |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
923 remaining components. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
924 just_foreground = 1; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
925 } |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
926 else |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
927 background_filled = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
928 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
929 if (font) |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
930 { |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
931 if (require_clipping) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
932 { |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
933 Region region; /* Region used for setting clip mask to GC. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
934 XPoint x[4]; /* Data used for creating REGION. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
935 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
936 x[0].x = x[3].x = left, x[1].x = x[2].x = left + glyph_width; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
937 x[0].y = x[1].y = top, x[2].y = x[3].y = top + line_height; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
938 region = XPolygonRegion (x, 4, EvenOddRule); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
939 XSetRegion (FRAME_X_DISPLAY (f), gc, region); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
940 XDestroyRegion (region); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
941 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
942 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
943 if (!cmpcharp) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
944 { |
17825
281d99590839
(dumpglyphs): Draw glyphs one by one if the font for
Kenichi Handa <handa@m17n.org>
parents:
17720
diff
changeset
|
945 if (require_clipping || FONT_WIDTH (font) != glyph_width) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
946 for (i = 0; i < len; i++) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
947 { |
17825
281d99590839
(dumpglyphs): Draw glyphs one by one if the font for
Kenichi Handa <handa@m17n.org>
parents:
17720
diff
changeset
|
948 if (require_clipping && i > 0) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
949 XSetClipOrigin (FRAME_X_DISPLAY (f), gc, |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
950 glyph_width * i, 0); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
951 if (background_filled) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
952 XDrawString16 (FRAME_X_DISPLAY (f), window, gc, |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
953 left + glyph_width * i, |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
954 top + baseline, x_2byte_buffer + i, 1); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
955 else |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
956 XDrawImageString16 (FRAME_X_DISPLAY (f), window, gc, |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
957 left + glyph_width * i, |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
958 top + baseline, x_2byte_buffer + i, 1); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
959 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
960 else |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
961 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
962 /* See if this whole buffer can be output as 8-bit chars. |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
963 If so, copy x_2byte_buffer to x_1byte_buffer |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
964 and do it as 8-bit chars. */ |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
965 for (i = 0; i < len; i++) |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
966 { |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
967 if (x_2byte_buffer[i].byte1 != 0) |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
968 break; |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
969 x_1byte_buffer[i] = x_2byte_buffer[i].byte2; |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
970 } |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
971 |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
972 if (i == len) |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
973 { |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
974 if (background_filled) |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
975 XDrawString (FRAME_X_DISPLAY (f), window, gc, |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
976 left, top + baseline, x_1byte_buffer, len); |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
977 else |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
978 XDrawImageString (FRAME_X_DISPLAY (f), window, gc, |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
979 left, top + baseline, x_1byte_buffer, len); |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
980 } |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
981 else |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
982 { |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
983 /* We can't output them as 8-bit chars, |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
984 so do it as 16-bit chars. */ |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
985 |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
986 if (background_filled) |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
987 XDrawString16 (FRAME_X_DISPLAY (f), window, gc, |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
988 left, top + baseline, x_2byte_buffer, len); |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
989 else |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
990 XDrawImageString16 (FRAME_X_DISPLAY (f), window, gc, |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
991 left, top + baseline, x_2byte_buffer, len); |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
992 } |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
993 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
994 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
995 else |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
996 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
997 /* Handle composite characters. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
998 XCharStruct *pcm; /* Pointer to per char metric info. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
999 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1000 if ((cmpcharp->cmp_rule || relative_compose) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1001 && gidx == 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1002 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1003 /* This is the first character. Initialize variables. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1004 HIGHEST is the highest position of glyphs ever |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1005 written, LOWEST the lowest position. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1006 int x_offset = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1007 |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1008 if (default_ascent |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1009 && CHAR_TABLE_P (Vuse_default_ascent) |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1010 && !NILP (Faref (Vuse_default_ascent, first_ch))) |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1011 { |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1012 highest = default_ascent; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1013 lowest = 0; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1014 } |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1015 else |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1016 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
1017 pcm = PER_CHAR_METRIC (font, x_2byte_buffer); |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1018 highest = pcm->ascent + 1; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1019 lowest = - pcm->descent; |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
1020 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1021 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1022 if (cmpcharp->cmp_rule) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1023 x_offset = (cmpcharp->col_offset[0] |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1024 * FONT_WIDTH (f->output_data.x->font)); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1025 /* Draw the first character at the normal position. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1026 XDrawString16 (FRAME_X_DISPLAY (f), window, gc, |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
1027 left + x_offset, top + baseline, x_2byte_buffer, 1); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1028 i = 1; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1029 gidx++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1030 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1031 else |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1032 i = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1033 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1034 for (; i < len; i++, gidx++) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1035 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1036 int x_offset = 0, y_offset = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1037 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1038 if (relative_compose) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1039 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
1040 pcm = PER_CHAR_METRIC (font, x_2byte_buffer + i); |
19276
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1041 if (NILP (Vignore_relative_composition) |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1042 || NILP (Faref (Vignore_relative_composition, |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1043 make_number (cmpcharp->glyph[gidx])))) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1044 { |
19276
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1045 if (- pcm->descent >= relative_compose) |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1046 { |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1047 /* Draw above the current glyphs. */ |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1048 y_offset = highest + pcm->descent; |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1049 highest += pcm->ascent + pcm->descent; |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1050 } |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1051 else if (pcm->ascent <= 0) |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1052 { |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1053 /* Draw beneath the current glyphs. */ |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1054 y_offset = lowest - pcm->ascent; |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1055 lowest -= pcm->ascent + pcm->descent; |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1056 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1057 } |
19276
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1058 else |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1059 { |
19276
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1060 /* Draw the glyph at normal position. If |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1061 it sticks out of HIGHEST or LOWEST, |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1062 update them appropriately. */ |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1063 if (pcm->ascent > highest) |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1064 highest = pcm->ascent; |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1065 else if (- pcm->descent < lowest) |
b2c5e1bea50e
(dumpglyphs): Pay attention to
Kenichi Handa <handa@m17n.org>
parents:
19062
diff
changeset
|
1066 lowest = - pcm->descent; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1067 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1068 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1069 else if (cmpcharp->cmp_rule) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1070 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1071 int gref = (cmpcharp->cmp_rule[gidx] - 0xA0) / 9; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1072 int nref = (cmpcharp->cmp_rule[gidx] - 0xA0) % 9; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1073 int bottom, top; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1074 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1075 /* Re-encode GREF and NREF so that they specify |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1076 only Y-axis information: |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1077 0:top, 1:base, 2:bottom, 3:center */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1078 gref = gref / 3 + (gref == 4) * 2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1079 nref = nref / 3 + (nref == 4) * 2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1080 |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
1081 pcm = PER_CHAR_METRIC (font, x_2byte_buffer + i); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1082 bottom = ((gref == 0 ? highest : gref == 1 ? 0 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1083 : gref == 2 ? lowest |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1084 : (highest + lowest) / 2) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1085 - (nref == 0 ? pcm->ascent + pcm->descent |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1086 : nref == 1 ? pcm->descent : nref == 2 ? 0 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1087 : (pcm->ascent + pcm->descent) / 2)); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1088 top = bottom + (pcm->ascent + pcm->descent); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1089 if (top > highest) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1090 highest = top; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1091 if (bottom < lowest) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1092 lowest = bottom; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1093 y_offset = bottom + pcm->descent; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1094 x_offset = (cmpcharp->col_offset[gidx] |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1095 * FONT_WIDTH (f->output_data.x->font)); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1096 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1097 XDrawString16 (FRAME_X_DISPLAY (f), window, gc, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1098 left + x_offset, top + baseline - y_offset, |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
1099 x_2byte_buffer + i, 1); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1100 } |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
1101 } |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1102 if (require_clipping) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1103 XSetClipMask (FRAME_X_DISPLAY (f), gc, None); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1104 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1105 #if 0 /* Doesn't work, because it uses FRAME_CURRENT_GLYPHS, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1106 which often is not up to date yet. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1107 if (!just_foreground) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1108 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1109 if (left == orig_left) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1110 redraw_previous_char (f, PIXEL_TO_CHAR_COL (f, left), |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1111 PIXEL_TO_CHAR_ROW (f, top), hl == 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1112 if (n == 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1113 redraw_following_char (f, PIXEL_TO_CHAR_COL (f, left + len * FONT_WIDTH (font)), |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1114 PIXEL_TO_CHAR_ROW (f, top), hl == 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1115 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1116 #endif |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1117 } |
18188
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1118 if (!font) |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1119 { |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1120 /* Show rectangles to indicate that we found no font. */ |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1121 int limit = cmpcharp ? 1 : len; |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1122 |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1123 for (i = 0; i < limit; i++) |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1124 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1125 left + glyph_width * i, top, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1126 glyph_width - 1, line_height - 1); |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1127 } |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1128 else if (require_clipping && !NILP (Vhighlight_wrong_size_font)) |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1129 { |
18188
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1130 /* Show ??? to indicate that we found a font of |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1131 inappropriate size. */ |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1132 int limit = cmpcharp ? 1 : len; |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1133 |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1134 for (i = 0; i < limit; i++) |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1135 { |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1136 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1137 left + glyph_width * i, top + line_height - 1, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1138 left + glyph_width * i + 1, top + line_height - 1); |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1139 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1140 left + glyph_width * i, top + line_height - 3, |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1141 left + glyph_width * i, top + line_height - 1); |
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1142 } |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1143 } |
18188
36b39ee64047
(dumpglyph): Shift baseline for such a font that is
Kenichi Handa <handa@m17n.org>
parents:
18074
diff
changeset
|
1144 |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1145 /* We should probably check for XA_UNDERLINE_POSITION and |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1146 XA_UNDERLINE_THICKNESS properties on the font, but let's |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1147 just get the thing working, and come back to that. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1148 { |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1149 /* Setting underline position based on the metric of the |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1150 current font results in shaky underline if it strides |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1151 over different fonts. So, we set the position based only |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1152 on the default font of this frame. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1153 int underline_position = f->output_data.x->font_baseline + 1; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1154 |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1155 if (underline_position >= line_height) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1156 underline_position = line_height - 1; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1157 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1158 if (face->underline) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1159 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1160 FACE_GC (face), |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1161 left, top + underline_position, run_width, 1); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1162 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1163 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1164 if (!cmpcharp) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
1165 left += run_width; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1166 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1167 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1168 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1169 return (left - orig_left); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1170 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1171 #endif /* 1 */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1172 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1173 #if 0 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1174 /* This is the old single-face code. */ |
286 | 1175 |
1176 static void | |
771 | 1177 dumpglyphs (f, left, top, gp, n, hl, font) |
1178 struct frame *f; | |
286 | 1179 int left, top; |
1180 register GLYPH *gp; /* Points to first GLYPH. */ | |
1181 register int n; /* Number of glyphs to display. */ | |
1182 int hl; | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1183 XFontStruct *font; |
286 | 1184 { |
1185 register int len; | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
1186 Window window = FRAME_X_WINDOW (f); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1187 GC drawing_gc = (hl == 2 ? 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:
12657
diff
changeset
|
1188 : (hl ? 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:
12657
diff
changeset
|
1189 : f->output_data.x->normal_gc)); |
286 | 1190 |
313 | 1191 if (sizeof (GLYPH) == sizeof (XChar2b)) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1192 XDrawImageString16 (FRAME_X_DISPLAY (f), window, drawing_gc, |
313 | 1193 left, top + FONT_BASE (font), (XChar2b *) gp, n); |
1194 else if (sizeof (GLYPH) == sizeof (unsigned char)) | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1195 XDrawImageString (FRAME_X_DISPLAY (f), window, drawing_gc, |
313 | 1196 left, top + FONT_BASE (font), (char *) gp, n); |
1197 else | |
1198 /* What size of glyph ARE you using? And does X have a function to | |
1199 draw them? */ | |
1200 abort (); | |
286 | 1201 } |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
1202 #endif |
286 | 1203 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1204 /* Output some text at the nominal frame cursor position. |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1205 Advance the cursor over the text. |
286 | 1206 Output LEN glyphs at START. |
1207 | |
1208 `highlight', set up by XTreassert_line_highlight or XTchange_line_highlight, | |
1209 controls the pixel values used for foreground and background. */ | |
1210 | |
21514 | 1211 static void |
286 | 1212 XTwrite_glyphs (start, len) |
1213 register GLYPH *start; | |
1214 int len; | |
1215 { | |
1216 register int temp_length; | |
1217 int mask; | |
771 | 1218 struct frame *f; |
286 | 1219 |
1220 BLOCK_INPUT; | |
1221 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1222 do_line_dance (); |
771 | 1223 f = updating_frame; |
1224 if (f == 0) | |
286 | 1225 { |
771 | 1226 f = selected_frame; |
286 | 1227 /* If not within an update, |
771 | 1228 output at the frame's visible cursor. */ |
21903
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1229 curs_x = FRAME_CURSOR_X (f); |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1230 curs_y = FRAME_CURSOR_Y (f); |
286 | 1231 } |
1232 | |
771 | 1233 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1234 CHAR_TO_PIXEL_COL (f, curs_x), |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1235 CHAR_TO_PIXEL_ROW (f, curs_y), |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1236 start, len, highlight, 0, NULL); |
429 | 1237 |
1238 /* If we drew on top of the cursor, note that it is turned off. */ | |
771 | 1239 if (curs_y == f->phys_cursor_y |
1240 && curs_x <= f->phys_cursor_x | |
1241 && curs_x + len > f->phys_cursor_x) | |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
1242 f->phys_cursor_on = 0; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1243 |
21903
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1244 curs_x += len; |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1245 if (curs_x >= FRAME_CURSOR_X_LIMIT (f)) |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1246 curs_x = FRAME_CURSOR_X_LIMIT (f) - 1; |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1247 |
771 | 1248 if (updating_frame == 0) |
21903
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1249 x_display_cursor (f, 1, curs_x, FRAME_CURSOR_Y (f)); |
412605dc9445
(XTwrite_glyphs): Don't advance cursor X beyond limit.
Richard M. Stallman <rms@gnu.org>
parents:
21764
diff
changeset
|
1250 |
286 | 1251 |
1252 UNBLOCK_INPUT; | |
1253 } | |
1254 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1255 /* Clear to the end of the line. |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1256 Erase the current text line from the nominal cursor position (inclusive) |
286 | 1257 to column FIRST_UNUSED (exclusive). The idea is that everything |
1258 from FIRST_UNUSED onward is already erased. */ | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1259 |
21514 | 1260 static void |
286 | 1261 XTclear_end_of_line (first_unused) |
1262 register int first_unused; | |
1263 { | |
771 | 1264 struct frame *f = updating_frame; |
286 | 1265 int mask; |
1266 | |
771 | 1267 if (f == 0) |
286 | 1268 abort (); |
1269 | |
771 | 1270 if (curs_y < 0 || curs_y >= f->height) |
286 | 1271 return; |
1272 if (first_unused <= 0) | |
1273 return; | |
1274 | |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
1275 if (first_unused >= FRAME_WINDOW_WIDTH (f)) |
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
1276 first_unused = FRAME_WINDOW_WIDTH (f); |
286 | 1277 |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
1278 first_unused += FRAME_LEFT_SCROLL_BAR_WIDTH (f); |
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
1279 |
286 | 1280 BLOCK_INPUT; |
1281 | |
9763
296cd41d2601
(XTclear_end_of_line): Finish the line dance here too, just as was done in
Karl Heuer <kwzh@gnu.org>
parents:
9762
diff
changeset
|
1282 do_line_dance (); |
296cd41d2601
(XTclear_end_of_line): Finish the line dance here too, just as was done in
Karl Heuer <kwzh@gnu.org>
parents:
9762
diff
changeset
|
1283 |
429 | 1284 /* Notice if the cursor will be cleared by this operation. */ |
771 | 1285 if (curs_y == f->phys_cursor_y |
1286 && curs_x <= f->phys_cursor_x | |
1287 && f->phys_cursor_x < first_unused) | |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
1288 f->phys_cursor_on = 0; |
286 | 1289 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1290 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1291 CHAR_TO_PIXEL_COL (f, curs_x), |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1292 CHAR_TO_PIXEL_ROW (f, curs_y), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1293 FONT_WIDTH (f->output_data.x->font) * (first_unused - curs_x), |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1294 f->output_data.x->line_height, False); |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
1295 #if 0 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1296 redraw_previous_char (f, curs_x, curs_y, highlight); |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
1297 #endif |
286 | 1298 |
1299 UNBLOCK_INPUT; | |
1300 } | |
1301 | |
21514 | 1302 static void |
771 | 1303 XTclear_frame () |
286 | 1304 { |
1305 int mask; | |
771 | 1306 struct frame *f = updating_frame; |
1307 | |
1308 if (f == 0) | |
1309 f = selected_frame; | |
1310 | |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
1311 f->phys_cursor_on = 0; /* Cursor not visible. */ |
286 | 1312 curs_x = 0; /* Nominal cursor position is top left. */ |
1313 curs_y = 0; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1314 |
286 | 1315 BLOCK_INPUT; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1316 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1317 XClearWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1318 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
1319 /* We have to clear the scroll bars, too. If we have changed |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1320 colors or something like that, then they should be notified. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
1321 x_scroll_bar_clear (f); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1322 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1323 XFlush (FRAME_X_DISPLAY (f)); |
286 | 1324 UNBLOCK_INPUT; |
1325 } | |
1326 | |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1327 #if 0 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1328 /* This currently does not work because FRAME_CURRENT_GLYPHS doesn't |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1329 always contain the right glyphs to use. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1330 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1331 It also needs to be changed to look at the details of the font and |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1332 see whether there is really overlap, and do nothing when there is |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1333 not. This can use font_char_overlap_left and font_char_overlap_right, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1334 but just how to use them is not clear. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1335 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1336 /* Erase the character (if any) at the position just before X, Y in frame F, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1337 then redraw it and the character before it. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1338 This is necessary when we erase starting at X, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1339 in case the character after X overlaps into the one before X. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1340 Call this function with input blocked. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1341 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1342 static void |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1343 redraw_previous_char (f, x, y, highlight_flag) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1344 FRAME_PTR f; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1345 int x, y; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1346 int highlight_flag; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1347 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1348 /* Erase the character before the new ones, in case |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1349 what was here before overlaps it. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1350 Reoutput that character, and the previous character |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1351 (in case the previous character overlaps it). */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1352 if (x > 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1353 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1354 int start_x = x - 2; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1355 if (start_x < 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1356 start_x = 0; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1357 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1358 CHAR_TO_PIXEL_COL (f, x - 1), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1359 CHAR_TO_PIXEL_ROW (f, y), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1360 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:
12657
diff
changeset
|
1361 f->output_data.x->line_height, False); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1362 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1363 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1364 CHAR_TO_PIXEL_ROW (f, y), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1365 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x], |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1366 x - start_x, highlight_flag, 1, NULL); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1367 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1368 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1369 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1370 /* Erase the character (if any) at the position X, Y in frame F, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1371 then redraw it and the character after it. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1372 This is necessary when we erase endng at X, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1373 in case the character after X overlaps into the one before X. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1374 Call this function with input blocked. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1375 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1376 static void |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1377 redraw_following_char (f, x, y, highlight_flag) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1378 FRAME_PTR f; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1379 int x, y; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1380 int highlight_flag; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1381 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1382 int limit = FRAME_CURRENT_GLYPHS (f)->used[y]; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1383 /* Erase the character after the new ones, in case |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1384 what was here before overlaps it. |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1385 Reoutput that character, and the following character |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1386 (in case the following character overlaps it). */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1387 if (x < limit |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1388 && FRAME_CURRENT_GLYPHS (f)->glyphs[y][x] != SPACEGLYPH) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1389 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1390 int end_x = x + 2; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1391 if (end_x > limit) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1392 end_x = limit; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1393 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1394 CHAR_TO_PIXEL_COL (f, x), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1395 CHAR_TO_PIXEL_ROW (f, y), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1396 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:
12657
diff
changeset
|
1397 f->output_data.x->line_height, False); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1398 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1399 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, x), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1400 CHAR_TO_PIXEL_ROW (f, y), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1401 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][x], |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1402 end_x - x, highlight_flag, 1, NULL); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1403 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1404 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1405 #endif /* 0 */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1406 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1407 #if 0 /* Not in use yet */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1408 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1409 /* Return 1 if character C in font F extends past its left edge. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1410 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1411 static int |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1412 font_char_overlap_left (font, c) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1413 XFontStruct *font; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1414 int c; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1415 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1416 XCharStruct *s; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1417 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1418 /* Find the bounding-box info for C. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1419 if (font->per_char == 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1420 s = &font->max_bounds; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1421 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1422 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1423 int rowlen = font->max_char_or_byte2 - font->min_char_or_byte2 + 1; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1424 int row, within; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1425 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1426 /* Decode char into row number (byte 1) and code within row (byte 2). */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1427 row = c >> 8; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1428 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1429 if (!(within >= font->min_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1430 && within <= font->max_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1431 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1432 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1433 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1434 /* If char is out of range, try the font's default char instead. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1435 c = font->default_char; |
13363
941c37982f37
(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
Karl Heuer <kwzh@gnu.org>
parents:
13232
diff
changeset
|
1436 row = c >> (BITS_PER_INT - 8); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1437 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1438 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1439 if (!(within >= font->min_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1440 && within <= font->max_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1441 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1442 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1443 /* Still out of range means this char does not overlap. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1444 return 0; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1445 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1446 /* We found the info for this char. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1447 s = (font->per_char + (within - font->min_char_or_byte2) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1448 + row * rowlen); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1449 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1450 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1451 return (s && s->lbearing < 0); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1452 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1453 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1454 /* Return 1 if character C in font F extends past its right edge. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1455 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1456 static int |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1457 font_char_overlap_right (font, c) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1458 XFontStruct *font; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1459 int c; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1460 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1461 XCharStruct *s; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1462 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1463 /* Find the bounding-box info for C. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1464 if (font->per_char == 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1465 s = &font->max_bounds; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1466 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1467 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1468 int rowlen = font->max_char_or_byte2 - font->min_char_or_byte2 + 1; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1469 int row, within; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1470 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1471 /* Decode char into row number (byte 1) and code within row (byte 2). */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1472 row = c >> 8; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1473 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1474 if (!(within >= font->min_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1475 && within <= font->max_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1476 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1477 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1478 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1479 /* If char is out of range, try the font's default char instead. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1480 c = font->default_char; |
13363
941c37982f37
(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
Karl Heuer <kwzh@gnu.org>
parents:
13232
diff
changeset
|
1481 row = c >> (BITS_PER_INT - 8); |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1482 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1483 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1484 if (!(within >= font->min_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1485 && within <= font->max_char_or_byte2 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1486 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1487 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1488 /* Still out of range means this char does not overlap. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1489 return 0; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1490 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1491 /* We found the info for this char. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1492 s = (font->per_char + (within - font->min_char_or_byte2) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1493 + row * rowlen); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1494 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1495 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1496 return (s && s->rbearing >= s->width); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1497 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1498 #endif /* 0 */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1499 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1500 /* Invert the middle quarter of the frame for .15 sec. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1501 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1502 /* We use the select system call to do the waiting, so we have to make sure |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3585
diff
changeset
|
1503 it's available. If it isn't, we just won't do visual bells. */ |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1504 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1505 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1506 /* Subtract the `struct timeval' values X and Y, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1507 storing the result in RESULT. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1508 Return 1 if the difference is negative, otherwise 0. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1509 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1510 static int |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1511 timeval_subtract (result, x, y) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1512 struct timeval *result, x, y; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1513 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1514 /* Perform the carry for the later subtraction by updating y. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1515 This is safer because on some systems |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1516 the tv_sec member is unsigned. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1517 if (x.tv_usec < y.tv_usec) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1518 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1519 int nsec = (y.tv_usec - x.tv_usec) / 1000000 + 1; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1520 y.tv_usec -= 1000000 * nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1521 y.tv_sec += nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1522 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1523 if (x.tv_usec - y.tv_usec > 1000000) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1524 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1525 int nsec = (y.tv_usec - x.tv_usec) / 1000000; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1526 y.tv_usec += 1000000 * nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1527 y.tv_sec -= nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1528 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1529 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1530 /* Compute the time remaining to wait. tv_usec is certainly positive. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1531 result->tv_sec = x.tv_sec - y.tv_sec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1532 result->tv_usec = x.tv_usec - y.tv_usec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1533 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1534 /* Return indication of whether the result should be considered negative. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1535 return x.tv_sec < y.tv_sec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1536 } |
286 | 1537 |
21514 | 1538 void |
771 | 1539 XTflash (f) |
1540 struct frame *f; | |
286 | 1541 { |
1542 BLOCK_INPUT; | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1543 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1544 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1545 GC gc; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1546 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1547 /* Create a GC that will use the GXxor function to flip foreground pixels |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1548 into background pixels. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1549 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1550 XGCValues values; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1551 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1552 values.function = GXxor; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1553 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:
12657
diff
changeset
|
1554 ^ f->output_data.x->background_pixel); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1555 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1556 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1557 GCFunction | GCForeground, &values); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1558 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1559 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1560 { |
16352
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1561 /* Get the height not including a menu bar widget. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1562 int height = CHAR_TO_PIXEL_HEIGHT (f, FRAME_HEIGHT (f)); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1563 /* Height of each line to flash. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1564 int flash_height = FRAME_LINE_HEIGHT (f); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1565 /* These will be the left and right margins of the rectangles. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1566 int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1567 int flash_right = PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1568 |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1569 int width; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1570 |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1571 /* Don't flash the area between a scroll bar and the frame |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1572 edge it is next to. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1573 switch (FRAME_VERTICAL_SCROLL_BAR_TYPE (f)) |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1574 { |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1575 case vertical_scroll_bar_left: |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1576 flash_left += VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1577 break; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1578 |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1579 case vertical_scroll_bar_right: |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1580 flash_right -= VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1581 break; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1582 } |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1583 |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1584 width = flash_right - flash_left; |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1585 |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1586 /* If window is tall, flash top and bottom line. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1587 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1588 { |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1589 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1590 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1591 width, flash_height); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1592 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1593 flash_left, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1594 (height - flash_height |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1595 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1596 width, flash_height); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1597 } |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1598 else |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1599 /* If it is short, flash it all. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1600 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1601 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1602 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1603 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1604 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1605 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1606 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1607 struct timeval wakeup, now; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1608 |
5362
d1fa597d923d
(XTflush): FIx typo in last change.
Richard M. Stallman <rms@gnu.org>
parents:
5357
diff
changeset
|
1609 EMACS_GET_TIME (wakeup); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1610 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1611 /* Compute time to wait until, propagating carry from usecs. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1612 wakeup.tv_usec += 150000; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1613 wakeup.tv_sec += (wakeup.tv_usec / 1000000); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1614 wakeup.tv_usec %= 1000000; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1615 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1616 /* Keep waiting until past the time wakeup. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1617 while (1) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1618 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1619 struct timeval timeout; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1620 |
5362
d1fa597d923d
(XTflush): FIx typo in last change.
Richard M. Stallman <rms@gnu.org>
parents:
5357
diff
changeset
|
1621 EMACS_GET_TIME (timeout); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1622 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1623 /* In effect, timeout = wakeup - timeout. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1624 Break if result would be negative. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1625 if (timeval_subtract (&timeout, wakeup, timeout)) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1626 break; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1627 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1628 /* Try to wait that long--but we might wake up sooner. */ |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
1629 select (0, NULL, NULL, NULL, &timeout); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1630 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1631 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1632 |
16352
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1633 /* If window is tall, flash top and bottom line. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1634 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1635 { |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1636 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1637 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1638 width, flash_height); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1639 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1640 flash_left, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1641 (height - flash_height |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1642 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1643 width, flash_height); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1644 } |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1645 else |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1646 /* If it is short, flash it all. */ |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1647 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1648 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1649 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); |
dfe3713f8c75
(XTflash): Don't flash in the internal borders.
Richard M. Stallman <rms@gnu.org>
parents:
16330
diff
changeset
|
1650 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1651 XFreeGC (FRAME_X_DISPLAY (f), gc); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1652 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1653 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1654 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1655 |
286 | 1656 UNBLOCK_INPUT; |
1657 } | |
1658 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1659 #endif |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1660 |
286 | 1661 |
1662 /* Make audible bell. */ | |
1663 | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1664 #define XRINGBELL XBell (FRAME_X_DISPLAY (selected_frame), 0) |
286 | 1665 |
21514 | 1666 void |
286 | 1667 XTring_bell () |
1668 { | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1669 if (FRAME_X_DISPLAY (selected_frame) == 0) |
3243
48d20a0b229a
(XTring_bell): Do nothing if x_current_connection is 0.
Richard M. Stallman <rms@gnu.org>
parents:
3218
diff
changeset
|
1670 return; |
48d20a0b229a
(XTring_bell): Do nothing if x_current_connection is 0.
Richard M. Stallman <rms@gnu.org>
parents:
3218
diff
changeset
|
1671 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1672 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
286 | 1673 if (visible_bell) |
771 | 1674 XTflash (selected_frame); |
286 | 1675 else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1676 #endif |
286 | 1677 { |
1678 BLOCK_INPUT; | |
1679 XRINGBELL; | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1680 XFlush (FRAME_X_DISPLAY (selected_frame)); |
286 | 1681 UNBLOCK_INPUT; |
1682 } | |
1683 } | |
1684 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1685 /* Insert and delete character. |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1686 These are not supposed to be used because we are supposed to turn |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1687 off the feature of using them. */ |
286 | 1688 |
21514 | 1689 static void |
286 | 1690 XTinsert_glyphs (start, len) |
1691 register char *start; | |
1692 register int len; | |
1693 { | |
1694 abort (); | |
1695 } | |
1696 | |
21514 | 1697 static void |
286 | 1698 XTdelete_glyphs (n) |
1699 register int n; | |
1700 { | |
1701 abort (); | |
1702 } | |
1703 | |
1704 /* Specify how many text lines, from the top of the window, | |
1705 should be affected by insert-lines and delete-lines operations. | |
1706 This, and those operations, are used only within an update | |
1707 that is bounded by calls to XTupdate_begin and XTupdate_end. */ | |
1708 | |
21514 | 1709 static void |
286 | 1710 XTset_terminal_window (n) |
1711 register int n; | |
1712 { | |
771 | 1713 if (updating_frame == 0) |
286 | 1714 abort (); |
1715 | |
771 | 1716 if ((n <= 0) || (n > updating_frame->height)) |
1717 flexlines = updating_frame->height; | |
286 | 1718 else |
1719 flexlines = n; | |
1720 } | |
1721 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1722 /* These variables need not be per frame |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1723 because redisplay is done on a frame-by-frame basis |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1724 and the line dance for one frame is finished before |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1725 anything is done for anoter frame. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1726 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1727 /* Array of line numbers from cached insert/delete operations. |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1728 line_dance[i] is the old position of the line that we want |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1729 to move to line i, or -1 if we want a blank line there. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1730 static int *line_dance; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1731 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1732 /* Allocated length of that array. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1733 static int line_dance_len; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1734 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1735 /* Flag indicating whether we've done any work. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1736 static int line_dance_in_progress; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1737 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1738 /* Perform an insert-lines or delete-lines operation, |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1739 inserting N lines or deleting -N lines at vertical position VPOS. */ |
21514 | 1740 void |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1741 XTins_del_lines (vpos, n) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1742 int vpos, n; |
286 | 1743 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1744 register int fence, i; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1745 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1746 if (vpos >= flexlines) |
286 | 1747 return; |
1748 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1749 if (!line_dance_in_progress) |
286 | 1750 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1751 int ht = updating_frame->height; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1752 if (ht > line_dance_len) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1753 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1754 line_dance = (int *)xrealloc (line_dance, ht * sizeof (int)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1755 line_dance_len = ht; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1756 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1757 for (i = 0; i < ht; ++i) line_dance[i] = i; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1758 line_dance_in_progress = 1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1759 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1760 if (n >= 0) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1761 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1762 if (n > flexlines - vpos) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1763 n = flexlines - vpos; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1764 fence = vpos + n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1765 for (i = flexlines; --i >= fence;) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1766 line_dance[i] = line_dance[i-n]; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1767 for (i = fence; --i >= vpos;) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1768 line_dance[i] = -1; |
286 | 1769 } |
1770 else | |
1771 { | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1772 n = -n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1773 if (n > flexlines - vpos) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1774 n = flexlines - vpos; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1775 fence = flexlines - n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1776 for (i = vpos; i < fence; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1777 line_dance[i] = line_dance[i + n]; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1778 for (i = fence; i < flexlines; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1779 line_dance[i] = -1; |
286 | 1780 } |
1781 } | |
1782 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1783 /* Here's where we actually move the pixels around. |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1784 Must be called with input blocked. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1785 static void |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1786 do_line_dance () |
286 | 1787 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1788 register int i, j, distance; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1789 register struct frame *f; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1790 int ht; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1791 int intborder; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1792 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1793 /* Must check this flag first. If it's not set, then not only is the |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1794 array uninitialized, but we might not even have a frame. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1795 if (!line_dance_in_progress) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1796 return; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1797 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1798 f = updating_frame; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1799 if (f == 0) |
286 | 1800 abort (); |
1801 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1802 ht = f->height; |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
1803 intborder = CHAR_TO_PIXEL_COL (f, FRAME_LEFT_SCROLL_BAR_WIDTH (f)); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1804 |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
1805 x_update_cursor (updating_frame, 0); |
286 | 1806 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1807 for (i = 0; i < ht; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1808 if (line_dance[i] != -1 && (distance = line_dance[i]-i) > 0) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1809 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1810 for (j = i; (j < ht && line_dance[j] != -1 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1811 && line_dance[j]-j == distance); ++j); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1812 /* Copy [i,j) upward from [i+distance,j+distance) */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1813 XCopyArea (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:
12657
diff
changeset
|
1814 FRAME_X_WINDOW (f), f->output_data.x->normal_gc, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1815 intborder, CHAR_TO_PIXEL_ROW (f, i+distance), |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
1816 FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1817 (j-i) * f->output_data.x->line_height, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1818 intborder, CHAR_TO_PIXEL_ROW (f, i)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1819 i = j-1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1820 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1821 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1822 for (i = ht; --i >=0; ) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1823 if (line_dance[i] != -1 && (distance = line_dance[i]-i) < 0) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1824 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1825 for (j = i; (--j >= 0 && line_dance[j] != -1 |
9577
3bf81e215f18
(do_line_dance): Decrement index only once per loop.
Karl Heuer <kwzh@gnu.org>
parents:
9572
diff
changeset
|
1826 && line_dance[j]-j == distance);); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1827 /* Copy (j,i] downward from (j+distance, i+distance] */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1828 XCopyArea (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:
12657
diff
changeset
|
1829 FRAME_X_WINDOW (f), f->output_data.x->normal_gc, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1830 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance), |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
1831 FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1832 (i-j) * f->output_data.x->line_height, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1833 intborder, CHAR_TO_PIXEL_ROW (f, j+1)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1834 i = j+1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1835 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1836 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1837 for (i = 0; i < ht; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1838 if (line_dance[i] == -1) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1839 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1840 for (j = i; j < ht && line_dance[j] == -1; ++j); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1841 /* Clear [i,j) */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1842 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1843 intborder, CHAR_TO_PIXEL_ROW (f, i), |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
1844 FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1845 (j-i) * f->output_data.x->line_height, False); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1846 i = j-1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1847 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1848 line_dance_in_progress = 0; |
286 | 1849 } |
1850 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1851 /* Support routines for exposure events. */ |
286 | 1852 static void clear_cursor (); |
1853 | |
771 | 1854 /* Output into a rectangle of an X-window (for frame F) |
1855 the characters in f->phys_lines that overlap that rectangle. | |
286 | 1856 TOP and LEFT are the position of the upper left corner of the rectangle. |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
1857 ROWS and COLS are the size of the rectangle. |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
1858 Call this function with input blocked. */ |
286 | 1859 |
1860 static void | |
771 | 1861 dumprectangle (f, left, top, cols, rows) |
1862 struct frame *f; | |
286 | 1863 register int left, top, cols, rows; |
1864 { | |
771 | 1865 register struct frame_glyphs *active_frame = FRAME_CURRENT_GLYPHS (f); |
286 | 1866 int cursor_cleared = 0; |
1867 int bottom, right; | |
1868 register int y; | |
1869 | |
771 | 1870 if (FRAME_GARBAGED_P (f)) |
286 | 1871 return; |
1872 | |
1873 /* Express rectangle as four edges, instead of position-and-size. */ | |
1874 bottom = top + rows; | |
1875 right = left + cols; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1876 |
286 | 1877 /* Convert rectangle edges in pixels to edges in chars. |
1878 Round down for left and top, up for right and bottom. */ | |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1879 top = PIXEL_TO_CHAR_ROW (f, top); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1880 left = PIXEL_TO_CHAR_COL (f, left); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1881 bottom += (f->output_data.x->line_height - 1); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1882 right += (FONT_WIDTH (f->output_data.x->font) - 1); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1883 bottom = PIXEL_TO_CHAR_ROW (f, bottom); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1884 right = PIXEL_TO_CHAR_COL (f, right); |
286 | 1885 |
1886 /* Clip the rectangle to what can be visible. */ | |
1887 if (left < 0) | |
1888 left = 0; | |
1889 if (top < 0) | |
1890 top = 0; | |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
1891 if (right > FRAME_WINDOW_WIDTH (f)) |
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
1892 right = FRAME_WINDOW_WIDTH (f); |
771 | 1893 if (bottom > f->height) |
1894 bottom = f->height; | |
286 | 1895 |
1896 /* Get size in chars of the rectangle. */ | |
1897 cols = right - left; | |
1898 rows = bottom - top; | |
1899 | |
1900 /* If rectangle has zero area, return. */ | |
1901 if (rows <= 0) return; | |
1902 if (cols <= 0) return; | |
1903 | |
1904 /* Turn off the cursor if it is in the rectangle. | |
1905 We will turn it back on afterward. */ | |
771 | 1906 if ((f->phys_cursor_x >= left) && (f->phys_cursor_x < right) |
1907 && (f->phys_cursor_y >= top) && (f->phys_cursor_y < bottom)) | |
286 | 1908 { |
771 | 1909 clear_cursor (f); |
286 | 1910 cursor_cleared = 1; |
1911 } | |
1912 | |
1913 /* Display the text in the rectangle, one text line at a time. */ | |
1914 | |
1915 for (y = top; y < bottom; y++) | |
1916 { | |
771 | 1917 GLYPH *line = &active_frame->glyphs[y][left]; |
1918 | |
1919 if (! active_frame->enable[y] || left > active_frame->used[y]) | |
286 | 1920 continue; |
1921 | |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1922 while (*line & GLYPH_MASK_PADDING) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1923 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1924 /* We must display the whole glyph of a wide-column |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1925 character. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1926 left--; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1927 line--; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1928 cols++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1929 } |
771 | 1930 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1931 CHAR_TO_PIXEL_COL (f, left), |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1932 CHAR_TO_PIXEL_ROW (f, y), |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1933 line, min (cols, active_frame->used[y] - left), |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
1934 active_frame->highlight[y], 0, NULL); |
286 | 1935 } |
1936 | |
1937 /* Turn the cursor on if we turned it off. */ | |
1938 | |
1939 if (cursor_cleared) | |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
1940 x_update_cursor (f, 1); |
286 | 1941 } |
1942 | |
1943 static void | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1944 frame_highlight (f) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1945 struct frame *f; |
286 | 1946 { |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1947 /* We used to only do this if Vx_no_window_manager was non-nil, but |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1948 the ICCCM (section 4.1.6) says that the window's border pixmap |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1949 and border pixel are window attributes which are "private to the |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1950 client", so we can always change it to whatever we want. */ |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1951 BLOCK_INPUT; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1952 XSetWindowBorder (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:
12657
diff
changeset
|
1953 f->output_data.x->border_pixel); |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1954 UNBLOCK_INPUT; |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
1955 x_update_cursor (f, 1); |
286 | 1956 } |
1957 | |
1958 static void | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1959 frame_unhighlight (f) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1960 struct frame *f; |
286 | 1961 { |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1962 /* We used to only do this if Vx_no_window_manager was non-nil, but |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1963 the ICCCM (section 4.1.6) says that the window's border pixmap |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1964 and border pixel are window attributes which are "private to the |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1965 client", so we can always change it to whatever we want. */ |
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1966 BLOCK_INPUT; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1967 XSetWindowBorderPixmap (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:
12657
diff
changeset
|
1968 f->output_data.x->border_tile); |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1969 UNBLOCK_INPUT; |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
1970 x_update_cursor (f, 1); |
286 | 1971 } |
1972 | |
771 | 1973 static void XTframe_rehighlight (); |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1974 static void x_frame_rehighlight (); |
771 | 1975 |
1976 /* The focus has changed. Update the frames as necessary to reflect | |
1977 the new situation. Note that we can't change the selected frame | |
10546
7515c28a59d9
(x_destroy_window): Don't let frame being destroyed remain in
Richard M. Stallman <rms@gnu.org>
parents:
10366
diff
changeset
|
1978 here, because the Lisp code we are interrupting might become confused. |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3585
diff
changeset
|
1979 Each event gets marked with the frame in which it occurred, so the |
10546
7515c28a59d9
(x_destroy_window): Don't let frame being destroyed remain in
Richard M. Stallman <rms@gnu.org>
parents:
10366
diff
changeset
|
1980 Lisp code can tell when the switch took place by examining the events. */ |
369 | 1981 |
1982 static void | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1983 x_new_focus_frame (dpyinfo, frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1984 struct x_display_info *dpyinfo; |
771 | 1985 struct frame *frame; |
286 | 1986 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1987 struct frame *old_focus = dpyinfo->x_focus_frame; |
286 | 1988 int events_enqueued = 0; |
1989 | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1990 if (frame != dpyinfo->x_focus_frame) |
286 | 1991 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1992 /* Set this before calling other routines, so that they see |
771 | 1993 the correct value of x_focus_frame. */ |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1994 dpyinfo->x_focus_frame = frame; |
369 | 1995 |
1996 if (old_focus && old_focus->auto_lower) | |
771 | 1997 x_lower_frame (old_focus); |
286 | 1998 |
1999 #if 0 | |
771 | 2000 selected_frame = frame; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2001 XSETFRAME (XWINDOW (selected_frame->selected_window)->frame, |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2002 selected_frame); |
771 | 2003 Fselect_window (selected_frame->selected_window); |
2004 choose_minibuf_frame (); | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
2005 #endif /* ! 0 */ |
286 | 2006 |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2007 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2008 pending_autoraise_frame = dpyinfo->x_focus_frame; |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
2009 else |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
2010 pending_autoraise_frame = 0; |
369 | 2011 } |
2012 | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2013 x_frame_rehighlight (dpyinfo); |
369 | 2014 } |
2015 | |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
2016 /* Handle an event saying the mouse has moved out of an Emacs frame. */ |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
2017 |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
2018 void |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2019 x_mouse_leave (dpyinfo) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2020 struct x_display_info *dpyinfo; |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
2021 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2022 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
2023 } |
369 | 2024 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2025 /* The focus has changed, or we have redirected a frame's focus to |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2026 another frame (this happens when a frame uses a surrogate |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2027 minibuffer frame). Shift the highlight as appropriate. |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2028 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2029 The FRAME argument doesn't necessarily have anything to do with which |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2030 frame is being highlighted or unhighlighted; we only use it to find |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2031 the appropriate X display info. */ |
369 | 2032 static void |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2033 XTframe_rehighlight (frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2034 struct frame *frame; |
369 | 2035 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2036 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2037 } |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2038 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2039 static void |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2040 x_frame_rehighlight (dpyinfo) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2041 struct x_display_info *dpyinfo; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2042 { |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2043 struct frame *old_highlight = dpyinfo->x_highlight_frame; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2044 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2045 if (dpyinfo->x_focus_frame) |
286 | 2046 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2047 dpyinfo->x_highlight_frame |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2048 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2049 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2050 : dpyinfo->x_focus_frame); |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2051 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2052 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2053 FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2054 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2055 } |
286 | 2056 } |
369 | 2057 else |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2058 dpyinfo->x_highlight_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2059 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2060 if (dpyinfo->x_highlight_frame != old_highlight) |
369 | 2061 { |
2062 if (old_highlight) | |
771 | 2063 frame_unhighlight (old_highlight); |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2064 if (dpyinfo->x_highlight_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
2065 frame_highlight (dpyinfo->x_highlight_frame); |
369 | 2066 } |
286 | 2067 } |
2068 | |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2069 /* Keyboard processing - modifier keys, vendor-specific keysyms, etc. */ |
286 | 2070 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2071 /* Initialize mode_switch_bit and modifier_meaning. */ |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2072 static void |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2073 x_find_modifier_meanings (dpyinfo) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2074 struct x_display_info *dpyinfo; |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2075 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2076 int min_code, max_code; |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2077 KeySym *syms; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2078 int syms_per_code; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2079 XModifierKeymap *mods; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2080 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2081 dpyinfo->meta_mod_mask = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2082 dpyinfo->shift_lock_mask = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2083 dpyinfo->alt_mod_mask = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2084 dpyinfo->super_mod_mask = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2085 dpyinfo->hyper_mod_mask = 0; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2086 |
2127
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
2087 #ifdef HAVE_X11R4 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2088 XDisplayKeycodes (dpyinfo->display, &min_code, &max_code); |
2127
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
2089 #else |
13884
26245345f6f1
(x_find_modifier_meanings): Fix !X11R4 code to use dpyinfo.
Richard M. Stallman <rms@gnu.org>
parents:
13782
diff
changeset
|
2090 min_code = dpyinfo->display->min_keycode; |
26245345f6f1
(x_find_modifier_meanings): Fix !X11R4 code to use dpyinfo.
Richard M. Stallman <rms@gnu.org>
parents:
13782
diff
changeset
|
2091 max_code = dpyinfo->display->max_keycode; |
2127
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
2092 #endif |
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
2093 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2094 syms = XGetKeyboardMapping (dpyinfo->display, |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2095 min_code, max_code - min_code + 1, |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2096 &syms_per_code); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2097 mods = XGetModifierMapping (dpyinfo->display); |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2098 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2099 /* Scan the modifier table to see which modifier bits the Meta and |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2100 Alt keysyms are on. */ |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2101 { |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2102 int row, col; /* The row and column in the modifier table. */ |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2103 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2104 for (row = 3; row < 8; row++) |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2105 for (col = 0; col < mods->max_keypermod; col++) |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2106 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2107 KeyCode code |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2108 = mods->modifiermap[(row * mods->max_keypermod) + col]; |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2109 |
6560
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
2110 /* Zeroes are used for filler. Skip them. */ |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
2111 if (code == 0) |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
2112 continue; |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
2113 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2114 /* Are any of this keycode's keysyms a meta key? */ |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2115 { |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2116 int code_col; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2117 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2118 for (code_col = 0; code_col < syms_per_code; code_col++) |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2119 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2120 int sym = syms[((code - min_code) * syms_per_code) + code_col]; |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2121 |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2122 switch (sym) |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2123 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2124 case XK_Meta_L: |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2125 case XK_Meta_R: |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2126 dpyinfo->meta_mod_mask |= (1 << row); |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2127 break; |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2128 |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2129 case XK_Alt_L: |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2130 case XK_Alt_R: |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2131 dpyinfo->alt_mod_mask |= (1 << row); |
2047
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2132 break; |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2133 |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2134 case XK_Hyper_L: |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2135 case XK_Hyper_R: |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2136 dpyinfo->hyper_mod_mask |= (1 << row); |
2047
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2137 break; |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2138 |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2139 case XK_Super_L: |
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2140 case XK_Super_R: |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2141 dpyinfo->super_mod_mask |= (1 << row); |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2142 break; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2143 |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2144 case XK_Shift_Lock: |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2145 /* Ignore this if it's not on the lock modifier. */ |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2146 if ((1 << row) == LockMask) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2147 dpyinfo->shift_lock_mask = LockMask; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
2148 break; |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2149 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2150 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2151 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2152 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2153 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2154 |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2155 /* If we couldn't find any meta keys, accept any alt keys as meta keys. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2156 if (! dpyinfo->meta_mod_mask) |
2047
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2157 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2158 dpyinfo->meta_mod_mask = dpyinfo->alt_mod_mask; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2159 dpyinfo->alt_mod_mask = 0; |
2047
e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
Richard M. Stallman <rms@gnu.org>
parents:
2016
diff
changeset
|
2160 } |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2161 |
2923
c8997402dd6b
(x_find_modifier_meanings): If some keys are meta and alt,
Richard M. Stallman <rms@gnu.org>
parents:
2882
diff
changeset
|
2162 /* If some keys are both alt and meta, |
c8997402dd6b
(x_find_modifier_meanings): If some keys are meta and alt,
Richard M. Stallman <rms@gnu.org>
parents:
2882
diff
changeset
|
2163 make them just meta, not alt. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2164 if (dpyinfo->alt_mod_mask & dpyinfo->meta_mod_mask) |
2923
c8997402dd6b
(x_find_modifier_meanings): If some keys are meta and alt,
Richard M. Stallman <rms@gnu.org>
parents:
2882
diff
changeset
|
2165 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2166 dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask; |
2923
c8997402dd6b
(x_find_modifier_meanings): If some keys are meta and alt,
Richard M. Stallman <rms@gnu.org>
parents:
2882
diff
changeset
|
2167 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2168 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2169 XFree ((char *) syms); |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2170 XFreeModifiermap (mods); |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2171 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
2172 |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2173 /* Convert between the modifier bits X uses and the modifier bits |
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2174 Emacs uses. */ |
1530
a7f8a1fe258e
* xterm.c (x_convert_modifiers): Declare this to return an
Jim Blandy <jimb@redhat.com>
parents:
1436
diff
changeset
|
2175 static unsigned int |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2176 x_x_to_emacs_modifiers (dpyinfo, state) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2177 struct x_display_info *dpyinfo; |
286 | 2178 unsigned int state; |
2179 { | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2180 return ( ((state & (ShiftMask | dpyinfo->shift_lock_mask)) ? shift_modifier : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2181 | ((state & ControlMask) ? ctrl_modifier : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2182 | ((state & dpyinfo->meta_mod_mask) ? meta_modifier : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2183 | ((state & dpyinfo->alt_mod_mask) ? alt_modifier : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2184 | ((state & dpyinfo->super_mod_mask) ? super_modifier : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2185 | ((state & dpyinfo->hyper_mod_mask) ? hyper_modifier : 0)); |
286 | 2186 } |
2187 | |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2188 static unsigned int |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2189 x_emacs_to_x_modifiers (dpyinfo, state) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2190 struct x_display_info *dpyinfo; |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2191 unsigned int state; |
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2192 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2193 return ( ((state & alt_modifier) ? dpyinfo->alt_mod_mask : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2194 | ((state & super_modifier) ? dpyinfo->super_mod_mask : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2195 | ((state & hyper_modifier) ? dpyinfo->hyper_mod_mask : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2196 | ((state & shift_modifier) ? ShiftMask : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2197 | ((state & ctrl_modifier) ? ControlMask : 0) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2198 | ((state & meta_modifier) ? dpyinfo->meta_mod_mask : 0)); |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
2199 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2200 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2201 /* Convert a keysym to its name. */ |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2202 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2203 char * |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2204 x_get_keysym_name (keysym) |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2205 KeySym keysym; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2206 { |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2207 char *value; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2208 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2209 BLOCK_INPUT; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2210 value = XKeysymToString (keysym); |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2211 UNBLOCK_INPUT; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2212 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2213 return value; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
2214 } |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2215 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2216 /* Mouse clicks and mouse movement. Rah. */ |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2217 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2218 /* Given a pixel position (PIX_X, PIX_Y) on the frame F, return |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2219 glyph co-ordinates in (*X, *Y). Set *BOUNDS to the rectangle |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2220 that the glyph at X, Y occupies, if BOUNDS != 0. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2221 If NOCLIP is nonzero, do not force the value into range. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2222 |
6023
67aa546e4ff1
(construct_menu_click): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
6022
diff
changeset
|
2223 void |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2224 pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip) |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2225 FRAME_PTR f; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2226 register int pix_x, pix_y; |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2227 register int *x, *y; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2228 XRectangle *bounds; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2229 int noclip; |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2230 { |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2231 /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2232 even for negative values. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2233 if (pix_x < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
2234 pix_x -= FONT_WIDTH ((f)->output_data.x->font) - 1; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2235 if (pix_y < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
2236 pix_y -= (f)->output_data.x->line_height - 1; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2237 |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2238 pix_x = PIXEL_TO_CHAR_COL (f, pix_x); |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2239 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y); |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2240 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2241 if (bounds) |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2242 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
2243 bounds->width = 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:
12657
diff
changeset
|
2244 bounds->height = f->output_data.x->line_height; |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2245 bounds->x = CHAR_TO_PIXEL_COL (f, pix_x); |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2246 bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y); |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2247 } |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2248 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2249 if (!noclip) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2250 { |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2251 if (pix_x < 0) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2252 pix_x = 0; |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
2253 else if (pix_x > FRAME_WINDOW_WIDTH (f)) |
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
2254 pix_x = FRAME_WINDOW_WIDTH (f); |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2255 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2256 if (pix_y < 0) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2257 pix_y = 0; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2258 else if (pix_y > f->height) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2259 pix_y = f->height; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2260 } |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2261 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2262 *x = pix_x; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2263 *y = pix_y; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2264 } |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
2265 |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2266 void |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2267 glyph_to_pixel_coords (f, x, y, pix_x, pix_y) |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2268 FRAME_PTR f; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2269 register int x, y; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2270 register int *pix_x, *pix_y; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2271 { |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2272 *pix_x = CHAR_TO_PIXEL_COL (f, x); |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2273 *pix_y = CHAR_TO_PIXEL_ROW (f, y); |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2274 } |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2275 |
286 | 2276 /* Prepare a mouse-event in *RESULT for placement in the input queue. |
2277 | |
2278 If the event is a button press, then note that we have grabbed | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2279 the mouse. */ |
286 | 2280 |
2281 static Lisp_Object | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2282 construct_mouse_click (result, event, f) |
286 | 2283 struct input_event *result; |
2284 XButtonEvent *event; | |
771 | 2285 struct frame *f; |
286 | 2286 { |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2287 /* Make the event type no_event; we'll change that when we decide |
286 | 2288 otherwise. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2289 result->kind = mouse_click; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2290 result->code = event->button - Button1; |
708 | 2291 result->timestamp = event->time; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2292 result->modifiers = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2293 event->state) |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2294 | (event->type == ButtonRelease |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2295 ? up_modifier |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
2296 : down_modifier)); |
286 | 2297 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2298 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2299 int row, column; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2300 |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2301 #if 0 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2302 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL, 0); |
9340
97cfba406b7b
(construct_mouse_click): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9338
diff
changeset
|
2303 XSETFASTINT (result->x, column); |
97cfba406b7b
(construct_mouse_click): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9338
diff
changeset
|
2304 XSETFASTINT (result->y, row); |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2305 #endif |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2306 XSETINT (result->x, event->x); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2307 XSETINT (result->y, event->y); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2308 XSETFRAME (result->frame_or_window, f); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2309 } |
286 | 2310 } |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2311 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2312 /* Prepare a menu-event in *RESULT for placement in the input queue. */ |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2313 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2314 static Lisp_Object |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2315 construct_menu_click (result, event, f) |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2316 struct input_event *result; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2317 XButtonEvent *event; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2318 struct frame *f; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2319 { |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2320 /* Make the event type no_event; we'll change that when we decide |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2321 otherwise. */ |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2322 result->kind = mouse_click; |
17371
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2323 result->code = event->button - Button1; |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2324 result->timestamp = event->time; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2325 result->modifiers = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2326 event->state) |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2327 | (event->type == ButtonRelease |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2328 ? up_modifier |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2329 : down_modifier)); |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2330 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2331 XSETINT (result->x, event->x); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2332 XSETINT (result->y, -1); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2333 XSETFRAME (result->frame_or_window, f); |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
2334 } |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2335 |
429 | 2336 /* Function to report a mouse movement to the mainstream Emacs code. |
2337 The input handler calls this. | |
2338 | |
2339 We have received a mouse movement event, which is given in *event. | |
2340 If the mouse is over a different glyph than it was last time, tell | |
2341 the mainstream emacs code by setting mouse_moved. If not, ask for | |
2342 another motion event, so we can check again the next time it moves. */ | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2343 |
429 | 2344 static void |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2345 note_mouse_movement (frame, event) |
771 | 2346 FRAME_PTR frame; |
429 | 2347 XMotionEvent *event; |
2348 { | |
732 | 2349 last_mouse_movement_time = event->time; |
2350 | |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2351 if (event->window != FRAME_X_WINDOW (frame)) |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2352 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2353 frame->mouse_moved = 1; |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2354 last_mouse_scroll_bar = Qnil; |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2355 |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2356 note_mouse_highlight (frame, -1, -1); |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2357 } |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2358 |
429 | 2359 /* Has the mouse moved off the glyph it was on at the last sighting? */ |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2360 else if (event->x < last_mouse_glyph.x |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2361 || event->x >= last_mouse_glyph.x + last_mouse_glyph.width |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2362 || event->y < last_mouse_glyph.y |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2363 || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2364 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2365 frame->mouse_moved = 1; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2366 last_mouse_scroll_bar = Qnil; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2367 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2368 note_mouse_highlight (frame, event->x, event->y); |
429 | 2369 } |
2370 } | |
2371 | |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2372 /* This is used for debugging, to turn off note_mouse_highlight. */ |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2373 static int disable_mouse_highlight; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2374 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2375 /* Take proper action when the mouse has moved to position X, Y on frame F |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2376 as regards highlighting characters that have mouse-face properties. |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2377 Also dehighlighting chars where the mouse was before. |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2378 X and Y can be negative or out of range. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2379 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2380 static void |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2381 note_mouse_highlight (f, x, y) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2382 FRAME_PTR f; |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
2383 int x, y; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2384 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2385 int row, column, portion; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2386 XRectangle new_glyph; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2387 Lisp_Object window; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2388 struct window *w; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2389 |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2390 if (disable_mouse_highlight) |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2391 return; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2392 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2393 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_x = x; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2394 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_y = y; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2395 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame = f; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2396 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2397 if (FRAME_X_DISPLAY_INFO (f)->mouse_face_defer) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2398 return; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2399 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2400 if (gc_in_progress) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2401 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2402 FRAME_X_DISPLAY_INFO (f)->mouse_face_deferred_gc = 1; |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2403 return; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2404 } |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2405 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2406 /* Find out which glyph the mouse is on. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2407 pixel_to_glyph_coords (f, x, y, &column, &row, |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2408 &new_glyph, FRAME_X_DISPLAY_INFO (f)->grabbed); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2409 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2410 /* Which window is that in? */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2411 window = window_from_coordinates (f, column, row, &portion); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2412 w = XWINDOW (window); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2413 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2414 /* If we were displaying active text in another window, clear that. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2415 if (! EQ (window, FRAME_X_DISPLAY_INFO (f)->mouse_face_window)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2416 clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2417 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
2418 /* Are we in a window whose display is up to date? |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
2419 And verify the buffer's text has not changed. */ |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2420 if (WINDOWP (window) && portion == 0 && row >= 0 && column >= 0 |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
2421 && row < FRAME_HEIGHT (f) && column < FRAME_WIDTH (f) |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
2422 && EQ (w->window_end_valid, w->buffer) |
17371
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2423 && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer)) |
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2424 && (XFASTINT (w->last_overlay_modified) |
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2425 == BUF_OVERLAY_MODIFF (XBUFFER (w->buffer)))) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2426 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2427 int *ptr = FRAME_CURRENT_GLYPHS (f)->charstarts[row]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2428 int i, pos; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2429 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2430 /* Find which buffer position the mouse corresponds to. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2431 for (i = column; i >= 0; i--) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2432 if (ptr[i] > 0) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2433 break; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2434 pos = ptr[i]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2435 /* Is it outside the displayed active region (if any)? */ |
7282
2bc4929691e9
(show_mouse_face): Fix test for cursor in highlighted area.
Karl Heuer <kwzh@gnu.org>
parents:
7264
diff
changeset
|
2436 if (pos <= 0) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2437 clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2438 else if (! (EQ (window, FRAME_X_DISPLAY_INFO (f)->mouse_face_window) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2439 && row >= FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2440 && row <= FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2441 && (row > FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2442 || column >= FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2443 && (row < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2444 || column < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2445 || FRAME_X_DISPLAY_INFO (f)->mouse_face_past_end))) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2446 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2447 Lisp_Object mouse_face, overlay, position; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2448 Lisp_Object *overlay_vec; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2449 int len, noverlays, ignor1; |
6649
1305248ee38a
(note_mouse_highlight): Reject out-of-range pos value
Richard M. Stallman <rms@gnu.org>
parents:
6644
diff
changeset
|
2450 struct buffer *obuf; |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2451 int obegv, ozv; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2452 |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2453 /* If we get an out-of-range value, return now; avoid an error. */ |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2454 if (pos > BUF_Z (XBUFFER (w->buffer))) |
6649
1305248ee38a
(note_mouse_highlight): Reject out-of-range pos value
Richard M. Stallman <rms@gnu.org>
parents:
6644
diff
changeset
|
2455 return; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2456 |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2457 /* Make the window's buffer temporarily current for |
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2458 overlays_at and compute_char_face. */ |
6649
1305248ee38a
(note_mouse_highlight): Reject out-of-range pos value
Richard M. Stallman <rms@gnu.org>
parents:
6644
diff
changeset
|
2459 obuf = current_buffer; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2460 current_buffer = XBUFFER (w->buffer); |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2461 obegv = BEGV; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2462 ozv = ZV; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2463 BEGV = BEG; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2464 ZV = Z; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2465 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2466 /* Yes. Clear the display of the old active region, if any. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2467 clear_mouse_face (FRAME_X_DISPLAY_INFO (f)); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2468 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2469 /* Is this char mouse-active? */ |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2470 XSETINT (position, pos); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2471 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2472 len = 10; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2473 overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2474 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2475 /* Put all the overlays we want in a vector in overlay_vec. |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2476 Store the length in len. */ |
17371
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2477 noverlays = overlays_at (pos, 1, &overlay_vec, &len, |
8964
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
2478 NULL, NULL); |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2479 noverlays = sort_overlays (overlay_vec, noverlays, w); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2480 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2481 /* Find the highest priority overlay that has a mouse-face prop. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2482 overlay = Qnil; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2483 for (i = 0; i < noverlays; i++) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2484 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2485 mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2486 if (!NILP (mouse_face)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2487 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2488 overlay = overlay_vec[i]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2489 break; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2490 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2491 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2492 free (overlay_vec); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2493 /* If no overlay applies, get a text property. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2494 if (NILP (overlay)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2495 mouse_face = Fget_text_property (position, Qmouse_face, w->buffer); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2496 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2497 /* Handle the overlay case. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2498 if (! NILP (overlay)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2499 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2500 /* Find the range of text around this char that |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2501 should be active. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2502 Lisp_Object before, after; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2503 int ignore; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2504 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2505 before = Foverlay_start (overlay); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2506 after = Foverlay_end (overlay); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2507 /* Record this as the current active region. */ |
16104
f55ff5de378f
(note_mouse_highlight): Pass POS argument to fast_find_position as int.
Richard M. Stallman <rms@gnu.org>
parents:
16048
diff
changeset
|
2508 fast_find_position (window, XFASTINT (before), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2509 &FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2510 &FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2511 FRAME_X_DISPLAY_INFO (f)->mouse_face_past_end |
16104
f55ff5de378f
(note_mouse_highlight): Pass POS argument to fast_find_position as int.
Richard M. Stallman <rms@gnu.org>
parents:
16048
diff
changeset
|
2512 = !fast_find_position (window, XFASTINT (after), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2513 &FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2514 &FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2515 FRAME_X_DISPLAY_INFO (f)->mouse_face_window = window; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2516 FRAME_X_DISPLAY_INFO (f)->mouse_face_face_id |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2517 = compute_char_face (f, w, pos, 0, 0, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2518 &ignore, pos + 1, 1); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2519 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2520 /* Display it as active. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2521 show_mouse_face (FRAME_X_DISPLAY_INFO (f), 1); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2522 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2523 /* Handle the text property case. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2524 else if (! NILP (mouse_face)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2525 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2526 /* Find the range of text around this char that |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2527 should be active. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2528 Lisp_Object before, after, beginning, end; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2529 int ignore; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2530 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2531 beginning = Fmarker_position (w->start); |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2532 XSETINT (end, (BUF_Z (XBUFFER (w->buffer)) |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2533 - XFASTINT (w->window_end_pos))); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2534 before |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2535 = Fprevious_single_property_change (make_number (pos + 1), |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2536 Qmouse_face, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2537 w->buffer, beginning); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2538 after |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2539 = Fnext_single_property_change (position, Qmouse_face, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2540 w->buffer, end); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2541 /* Record this as the current active region. */ |
16104
f55ff5de378f
(note_mouse_highlight): Pass POS argument to fast_find_position as int.
Richard M. Stallman <rms@gnu.org>
parents:
16048
diff
changeset
|
2542 fast_find_position (window, XFASTINT (before), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2543 &FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2544 &FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2545 FRAME_X_DISPLAY_INFO (f)->mouse_face_past_end |
16104
f55ff5de378f
(note_mouse_highlight): Pass POS argument to fast_find_position as int.
Richard M. Stallman <rms@gnu.org>
parents:
16048
diff
changeset
|
2546 = !fast_find_position (window, XFASTINT (after), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2547 &FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2548 &FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2549 FRAME_X_DISPLAY_INFO (f)->mouse_face_window = window; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2550 FRAME_X_DISPLAY_INFO (f)->mouse_face_face_id |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2551 = compute_char_face (f, w, pos, 0, 0, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2552 &ignore, pos + 1, 1); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2553 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2554 /* Display it as active. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2555 show_mouse_face (FRAME_X_DISPLAY_INFO (f), 1); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2556 } |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2557 BEGV = obegv; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2558 ZV = ozv; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2559 current_buffer = obuf; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2560 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2561 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2562 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2563 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2564 /* Find the row and column of position POS in window WINDOW. |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2565 Store them in *COLUMNP and *ROWP. |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2566 This assumes display in WINDOW is up to date. |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2567 If POS is above start of WINDOW, return coords |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2568 of start of first screen line. |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2569 If POS is after end of WINDOW, return coords of end of last screen line. |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2570 |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2571 Value is 1 if POS is in range, 0 if it was off screen. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2572 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2573 static int |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2574 fast_find_position (window, pos, columnp, rowp) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2575 Lisp_Object window; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2576 int pos; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2577 int *columnp, *rowp; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2578 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2579 struct window *w = XWINDOW (window); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2580 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2581 int i; |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2582 int row = 0; |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
2583 int left = WINDOW_LEFT_MARGIN (w); |
17371
97283cd93432
(construct_menu_click, note_mouse_highlight, fast_find_position):
Karl Heuer <kwzh@gnu.org>
parents:
17316
diff
changeset
|
2584 int top = XFASTINT (w->top); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2585 int height = XFASTINT (w->height) - ! MINI_WINDOW_P (w); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2586 int width = window_internal_width (w); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2587 int *charstarts; |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2588 int lastcol; |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2589 int maybe_next_line = 0; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2590 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2591 /* Find the right row. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2592 for (i = 0; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2593 i < height; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2594 i++) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2595 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2596 int linestart = FRAME_CURRENT_GLYPHS (f)->charstarts[top + i][left]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2597 if (linestart > pos) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2598 break; |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2599 /* If the position sought is the end of the buffer, |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2600 don't include the blank lines at the bottom of the window. */ |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2601 if (linestart == pos && pos == BUF_ZV (XBUFFER (w->buffer))) |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2602 { |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2603 maybe_next_line = 1; |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2604 break; |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2605 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2606 if (linestart > 0) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2607 row = i; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2608 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2609 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2610 /* Find the right column with in it. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2611 charstarts = FRAME_CURRENT_GLYPHS (f)->charstarts[top + row]; |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2612 lastcol = left; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2613 for (i = 0; i < width; i++) |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2614 { |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2615 if (charstarts[left + i] == pos) |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2616 { |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2617 *rowp = row + top; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2618 *columnp = i + left; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2619 return 1; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2620 } |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2621 else if (charstarts[left + i] > pos) |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2622 break; |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2623 else if (charstarts[left + i] > 0) |
22907
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
2624 lastcol = left + i + 1; |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2625 } |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2626 |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2627 /* If we're looking for the end of the buffer, |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2628 and we didn't find it in the line we scanned, |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2629 use the start of the following line. */ |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2630 if (maybe_next_line) |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2631 { |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2632 row++; |
15928
2882af484d9c
(fast_find_position): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents:
15924
diff
changeset
|
2633 lastcol = left; |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2634 } |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2635 |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2636 *rowp = row + top; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2637 *columnp = lastcol; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2638 return 0; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2639 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2640 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2641 /* Display the active region described by mouse_face_* |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2642 in its mouse-face if HL > 0, in its normal face if HL = 0. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2643 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2644 static void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2645 show_mouse_face (dpyinfo, hl) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2646 struct x_display_info *dpyinfo; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2647 int hl; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2648 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2649 struct window *w = XWINDOW (dpyinfo->mouse_face_window); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2650 int width = window_internal_width (w); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2651 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2652 int i; |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2653 int cursor_off = 0; |
16365
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2654 int old_curs_x = curs_x; |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2655 int old_curs_y = curs_y; |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2656 |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2657 /* Set these variables temporarily |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2658 so that if we have to turn the cursor off and on again |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2659 we will put it back at the same place. */ |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2660 curs_x = f->phys_cursor_x; |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2661 curs_y = f->phys_cursor_y; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2662 for (i = FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2663 i <= FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row; i++) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2664 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2665 int column = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2666 ? FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
2667 : WINDOW_LEFT_MARGIN (w)); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2668 int endcolumn = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2669 ? FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
2670 : WINDOW_LEFT_MARGIN (w) + width); |
7992
7bb45acbcaa6
(show_mouse_face): Set endcolumn ok in side-by-side windows.
Richard M. Stallman <rms@gnu.org>
parents:
7959
diff
changeset
|
2671 endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]); |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2672 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2673 /* If the cursor's in the text we are about to rewrite, |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2674 turn the cursor off. */ |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2675 if (i == curs_y |
13598
4fbb17b559bf
(show_mouse_face): When clearing cursor, use proper column range.
Richard M. Stallman <rms@gnu.org>
parents:
13561
diff
changeset
|
2676 && curs_x >= column - 1 |
4fbb17b559bf
(show_mouse_face): When clearing cursor, use proper column range.
Richard M. Stallman <rms@gnu.org>
parents:
13561
diff
changeset
|
2677 && curs_x <= endcolumn) |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2678 { |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
2679 x_update_cursor (f, 0); |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2680 cursor_off = 1; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2681 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2682 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2683 dumpglyphs (f, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2684 CHAR_TO_PIXEL_COL (f, column), |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2685 CHAR_TO_PIXEL_ROW (f, i), |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2686 FRAME_CURRENT_GLYPHS (f)->glyphs[i] + column, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2687 endcolumn - column, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2688 /* Highlight with mouse face if hl > 0. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
2689 hl > 0 ? 3 : 0, 0, NULL); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2690 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2691 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2692 /* If we turned the cursor off, turn it back on. */ |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2693 if (cursor_off) |
16365
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2694 x_display_cursor (f, 1, curs_x, curs_y); |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2695 |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2696 curs_x = old_curs_x; |
63eb95eea4ef
(show_mouse_face): Undo 1996-08-30 change.
Richard M. Stallman <rms@gnu.org>
parents:
16352
diff
changeset
|
2697 curs_y = old_curs_y; |
8164
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2698 |
6757
770fe370479b
(show_mouse_face): Change the mouse cursor accordingly.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6683
diff
changeset
|
2699 /* Change the mouse cursor according to the value of HL. */ |
770fe370479b
(show_mouse_face): Change the mouse cursor accordingly.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6683
diff
changeset
|
2700 if (hl > 0) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2701 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:
12657
diff
changeset
|
2702 f->output_data.x->cross_cursor); |
6757
770fe370479b
(show_mouse_face): Change the mouse cursor accordingly.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6683
diff
changeset
|
2703 else |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2704 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:
12657
diff
changeset
|
2705 f->output_data.x->text_cursor); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2706 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2707 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2708 /* Clear out the mouse-highlighted active region. |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2709 Redraw it unhighlighted first. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2710 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2711 static void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2712 clear_mouse_face (dpyinfo) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2713 struct x_display_info *dpyinfo; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2714 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2715 if (! NILP (dpyinfo->mouse_face_window)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2716 show_mouse_face (dpyinfo, 0); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2717 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2718 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2719 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2720 dpyinfo->mouse_face_window = Qnil; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2721 } |
16491
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2722 |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2723 /* Just discard the mouse face information for frame F, if any. |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2724 This is used when the size of F is changed. */ |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2725 |
21514 | 2726 void |
16491
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2727 cancel_mouse_face (f) |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2728 FRAME_PTR f; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2729 { |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2730 Lisp_Object window; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2731 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2732 |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2733 window = dpyinfo->mouse_face_window; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2734 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2735 { |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2736 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2737 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2738 dpyinfo->mouse_face_window = Qnil; |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2739 } |
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
2740 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2741 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2742 static struct scroll_bar *x_window_to_scroll_bar (); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2743 static void x_scroll_bar_report_motion (); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2744 |
429 | 2745 /* Return the current position of the mouse. |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2746 *fp should be a frame which indicates which display to ask about. |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2747 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2748 If the mouse movement started in a scroll bar, set *fp, *bar_window, |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2749 and *part to the frame, window, and scroll bar part that the mouse |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2750 is over. Set *x and *y to the portion and whole of the mouse's |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2751 position on the scroll bar. |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2752 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2753 If the mouse movement started elsewhere, set *fp to the frame the |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2754 mouse is on, *bar_window to nil, and *x and *y to the character cell |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2755 the mouse is over. |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2756 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2757 Set *time to the server timestamp for the time at which the mouse |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2758 was at this position. |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2759 |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2760 Don't store anything if we don't have a valid set of values to report. |
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2761 |
429 | 2762 This clears the mouse_moved flag, so we can wait for the next mouse |
15042
c99dd01d9334
(note_mouse_movement): Don't call XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
14963
diff
changeset
|
2763 movement. */ |
429 | 2764 |
2765 static void | |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2766 XTmouse_position (fp, insist, bar_window, part, x, y, time) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2767 FRAME_PTR *fp; |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2768 int insist; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2769 Lisp_Object *bar_window; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2770 enum scroll_bar_part *part; |
429 | 2771 Lisp_Object *x, *y; |
732 | 2772 unsigned long *time; |
429 | 2773 { |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2774 FRAME_PTR f1; |
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2775 |
429 | 2776 BLOCK_INPUT; |
2777 | |
20180
bfbf6a2939a3
(XTmouse_position): Handle INSIST < 0.
Karl Heuer <kwzh@gnu.org>
parents:
19447
diff
changeset
|
2778 if (! NILP (last_mouse_scroll_bar) && insist == 0) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2779 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); |
429 | 2780 else |
2781 { | |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2782 Window root; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2783 int root_x, root_y; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2784 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2785 Window dummy_window; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2786 int dummy; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2787 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2788 Lisp_Object frame, tail; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2789 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2790 /* Clear the mouse-moved flag for every frame on this display. */ |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2791 FOR_EACH_FRAME (tail, frame) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2792 if (FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp)) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2793 XFRAME (frame)->mouse_moved = 0; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2794 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2795 last_mouse_scroll_bar = Qnil; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2796 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2797 /* Figure out which root window we're on. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2798 XQueryPointer (FRAME_X_DISPLAY (*fp), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2799 DefaultRootWindow (FRAME_X_DISPLAY (*fp)), |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2800 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2801 /* The root window which contains the pointer. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2802 &root, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2803 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2804 /* Trash which we can't trust if the pointer is on |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2805 a different screen. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2806 &dummy_window, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2807 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2808 /* The position on that root window. */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2809 &root_x, &root_y, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2810 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2811 /* More trash we can't trust. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2812 &dummy, &dummy, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2813 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2814 /* Modifier keys and pointer buttons, about which |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2815 we don't care. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2816 (unsigned int *) &dummy); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2817 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2818 /* Now we have a position on the root; find the innermost window |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2819 containing the pointer. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2820 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2821 Window win, child; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2822 int win_x, win_y; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2823 int parent_x, parent_y; |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
2824 int count; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2825 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2826 win = root; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2827 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2828 /* XTranslateCoordinates can get errors if the window |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2829 structure is changing at the same time this function |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2830 is running. So at least we must not crash from them. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2831 |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
2832 count = x_catch_errors (FRAME_X_DISPLAY (*fp)); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2833 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2834 if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame |
8430
356e5509efda
(construct_mouse_click, construct_menu_click):
Richard M. Stallman <rms@gnu.org>
parents:
8353
diff
changeset
|
2835 && FRAME_LIVE_P (last_mouse_frame)) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2836 { |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2837 /* If mouse was grabbed on a frame, give coords for that frame |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2838 even if the mouse is now outside it. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2839 XTranslateCoordinates (FRAME_X_DISPLAY (*fp), |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2840 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2841 /* From-window, to-window. */ |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2842 root, FRAME_X_WINDOW (last_mouse_frame), |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2843 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2844 /* From-position, to-position. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2845 root_x, root_y, &win_x, &win_y, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2846 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2847 /* Child of win. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2848 &child); |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2849 f1 = last_mouse_frame; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2850 } |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2851 else |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2852 { |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2853 while (1) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2854 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2855 XTranslateCoordinates (FRAME_X_DISPLAY (*fp), |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2856 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2857 /* From-window, to-window. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2858 root, win, |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2859 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2860 /* From-position, to-position. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2861 root_x, root_y, &win_x, &win_y, |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2862 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2863 /* Child of win. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2864 &child); |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2865 |
13627
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
2866 if (child == None || child == win) |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2867 break; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2868 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2869 win = child; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2870 parent_x = win_x; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2871 parent_y = win_y; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2872 } |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2873 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2874 /* Now we know that: |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2875 win is the innermost window containing the pointer |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2876 (XTC says it has no child containing the pointer), |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2877 win_x and win_y are the pointer's position in it |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2878 (XTC did this the last time through), and |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2879 parent_x and parent_y are the pointer's position in win's parent. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2880 (They are what win_x and win_y were when win was child. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2881 If win is the root window, it has no parent, and |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2882 parent_{x,y} are invalid, but that's okay, because we'll |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2883 never use them in that case.) */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2884 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2885 /* Is win one of our frames? */ |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
2886 f1 = x_any_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win); |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2887 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2888 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2889 if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2890 f1 = 0; |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2891 |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
2892 x_uncatch_errors (FRAME_X_DISPLAY (*fp), count); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2893 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2894 /* If not, is it one of our scroll bars? */ |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2895 if (! f1) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2896 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2897 struct scroll_bar *bar = x_window_to_scroll_bar (win); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2898 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2899 if (bar) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2900 { |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2901 f1 = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2902 win_x = parent_x; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2903 win_y = parent_y; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2904 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2905 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2906 |
20180
bfbf6a2939a3
(XTmouse_position): Handle INSIST < 0.
Karl Heuer <kwzh@gnu.org>
parents:
19447
diff
changeset
|
2907 if (f1 == 0 && insist > 0) |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2908 f1 = selected_frame; |
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2909 |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2910 if (f1) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2911 { |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2912 int ignore1, ignore2; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2913 |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2914 /* Ok, we found a frame. Store all the values. */ |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2915 |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2916 pixel_to_glyph_coords (f1, win_x, win_y, &ignore1, &ignore2, |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2917 &last_mouse_glyph, |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2918 FRAME_X_DISPLAY_INFO (f1)->grabbed |
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2919 || insist); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2920 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2921 *bar_window = Qnil; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2922 *part = 0; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2923 *fp = f1; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2924 XSETINT (*x, win_x); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2925 XSETINT (*y, win_y); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2926 *time = last_mouse_movement_time; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2927 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2928 } |
429 | 2929 } |
2930 | |
2931 UNBLOCK_INPUT; | |
2932 } | |
2933 | |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2934 /* Scroll bar support. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2935 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2936 /* Given an X window ID, find the struct scroll_bar which manages it. |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2937 This can be called in GC, so we have to make sure to strip off mark |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2938 bits. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2939 static struct scroll_bar * |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2940 x_window_to_scroll_bar (window_id) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2941 Window window_id; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2942 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2943 Lisp_Object tail, frame; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2944 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2945 for (tail = Vframe_list; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2946 XGCTYPE (tail) == Lisp_Cons; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2947 tail = XCONS (tail)->cdr) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2948 { |
6521
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
2949 Lisp_Object frame, bar, condemned; |
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
2950 |
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
2951 frame = XCONS (tail)->car; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2952 /* All elements of Vframe_list should be frames. */ |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2953 if (! GC_FRAMEP (frame)) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2954 abort (); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2955 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2956 /* Scan this frame's scroll bar list for a scroll bar with the |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2957 right window ID. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2958 condemned = FRAME_CONDEMNED_SCROLL_BARS (XFRAME (frame)); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2959 for (bar = FRAME_SCROLL_BARS (XFRAME (frame)); |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
2960 /* This trick allows us to search both the ordinary and |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2961 condemned scroll bar lists with one loop. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2962 ! GC_NILP (bar) || (bar = condemned, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2963 condemned = Qnil, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2964 ! GC_NILP (bar)); |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
2965 bar = XSCROLL_BAR (bar)->next) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2966 if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2967 return XSCROLL_BAR (bar); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2968 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2969 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2970 return 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2971 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2972 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2973 /* Open a new X window to serve as a scroll bar, and return the |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2974 scroll bar vector for it. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2975 static struct scroll_bar * |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2976 x_scroll_bar_create (window, top, left, width, height) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2977 struct window *window; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2978 int top, left, width, height; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2979 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2980 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2981 struct scroll_bar *bar |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2982 = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2983 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2984 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2985 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2986 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2987 XSetWindowAttributes a; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2988 unsigned long mask; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
2989 a.background_pixel = f->output_data.x->background_pixel; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2990 a.event_mask = (ButtonPressMask | ButtonReleaseMask |
1793
cf4c3f01ddb9
* xterm.c (x_scrollbar_create): Include PointerMotionHintMask in
Jim Blandy <jimb@redhat.com>
parents:
1787
diff
changeset
|
2991 | ButtonMotionMask | PointerMotionHintMask |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2992 | ExposureMask); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2993 a.cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
2994 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
2995 mask = (CWBackPixel | CWEventMask | CWCursor); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2996 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2997 #if 0 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2998 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2999 ac = 0; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3000 XtSetArg (al[ac], XtNx, left); ac++; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3001 XtSetArg (al[ac], XtNy, top); ac++; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3002 XtSetArg (al[ac], XtNwidth, width); ac++; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3003 XtSetArg (al[ac], XtNheight, height); ac++; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3004 XtSetArg (al[ac], XtNborderWidth, 0); ac++; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3005 sb_widget = XtCreateManagedWidget ("box", |
5916
4e827db2523a
(x_scroll_bar_create): Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents:
5898
diff
changeset
|
3006 boxWidgetClass, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3007 f->output_data.x->edit_widget, al, ac); |
5916
4e827db2523a
(x_scroll_bar_create): Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents:
5898
diff
changeset
|
3008 SET_SCROLL_BAR_X_WINDOW |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3009 (bar, sb_widget->core.window); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3010 #endif |
5916
4e827db2523a
(x_scroll_bar_create): Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents:
5898
diff
changeset
|
3011 SET_SCROLL_BAR_X_WINDOW |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3012 (bar, |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3013 XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3014 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3015 /* Position and size of scroll bar. */ |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3016 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, top, |
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3017 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, height, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3018 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3019 /* Border width, depth, class, and visual. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3020 0, CopyFromParent, CopyFromParent, CopyFromParent, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3021 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3022 /* Attributes. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3023 mask, &a)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3024 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3025 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3026 XSETWINDOW (bar->window, window); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3027 XSETINT (bar->top, top); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3028 XSETINT (bar->left, left); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3029 XSETINT (bar->width, width); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3030 XSETINT (bar->height, height); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3031 XSETINT (bar->start, 0); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3032 XSETINT (bar->end, 0); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3033 bar->dragging = Qnil; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3034 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3035 /* Add bar to its frame's list of scroll bars. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3036 bar->next = FRAME_SCROLL_BARS (f); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3037 bar->prev = Qnil; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3038 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3039 if (! NILP (bar->next)) |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3040 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3041 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
3042 XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3043 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3044 UNBLOCK_INPUT; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3045 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3046 return bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3047 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3048 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3049 /* Draw BAR's handle in the proper position. |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3050 If the handle is already drawn from START to END, don't bother |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3051 redrawing it, unless REBUILD is non-zero; in that case, always |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3052 redraw it. (REBUILD is handy for drawing the handle after expose |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3053 events.) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3054 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3055 Normally, we want to constrain the start and end of the handle to |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3056 fit inside its rectangle, but if the user is dragging the scroll bar |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3057 handle, we want to let them drag it down all the way, so that the |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3058 bar's top is as far down as it goes; otherwise, there's no way to |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3059 move to the very end of the buffer. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3060 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3061 x_scroll_bar_set_handle (bar, start, end, rebuild) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3062 struct scroll_bar *bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3063 int start, end; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3064 int rebuild; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3065 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3066 int dragging = ! NILP (bar->dragging); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3067 Window w = SCROLL_BAR_X_WINDOW (bar); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3068 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3069 GC gc = f->output_data.x->normal_gc; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3070 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3071 /* If the display is already accurate, do nothing. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3072 if (! rebuild |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3073 && start == XINT (bar->start) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3074 && end == XINT (bar->end)) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3075 return; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3076 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3077 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3078 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3079 { |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3080 int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (f, XINT (bar->width)); |
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3081 int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3082 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3083 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3084 /* Make sure the values are reasonable, and try to preserve |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3085 the distance between start and end. */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3086 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3087 int length = end - start; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3088 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3089 if (start < 0) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3090 start = 0; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3091 else if (start > top_range) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3092 start = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3093 end = start + length; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3094 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3095 if (end < start) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3096 end = start; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3097 else if (end > top_range && ! dragging) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3098 end = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3099 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3100 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3101 /* Store the adjusted setting in the scroll bar. */ |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3102 XSETINT (bar->start, start); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3103 XSETINT (bar->end, end); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3104 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3105 /* Clip the end position, just for display. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3106 if (end > top_range) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3107 end = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3108 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3109 /* Draw bottom positions VERTICAL_SCROLL_BAR_MIN_HANDLE pixels |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3110 below top positions, to make sure the handle is always at least |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3111 that many pixels tall. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3112 end += VERTICAL_SCROLL_BAR_MIN_HANDLE; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3113 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3114 /* Draw the empty space above the handle. Note that we can't clear |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3115 zero-height areas; that means "clear to end of window." */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3116 if (0 < start) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3117 XClearArea (FRAME_X_DISPLAY (f), w, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3118 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3119 /* x, y, width, height, and exposures. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3120 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3121 VERTICAL_SCROLL_BAR_TOP_BORDER, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3122 inside_width, start, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3123 False); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3124 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3125 /* Draw the handle itself. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3126 XFillRectangle (FRAME_X_DISPLAY (f), w, gc, |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3127 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3128 /* x, y, width, height */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3129 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3130 VERTICAL_SCROLL_BAR_TOP_BORDER + start, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3131 inside_width, end - start); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3132 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3133 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3134 /* Draw the empty space below the handle. Note that we can't |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3135 clear zero-height areas; that means "clear to end of window." */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3136 if (end < inside_height) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3137 XClearArea (FRAME_X_DISPLAY (f), w, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3138 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3139 /* x, y, width, height, and exposures. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3140 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3141 VERTICAL_SCROLL_BAR_TOP_BORDER + end, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3142 inside_width, inside_height - end, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3143 False); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3144 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3145 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3146 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3147 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3148 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3149 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3585
diff
changeset
|
3150 /* Move a scroll bar around on the screen, to accommodate changing |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3151 window configurations. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3152 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3153 x_scroll_bar_move (bar, top, left, width, height) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3154 struct scroll_bar *bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3155 int top, left, width, height; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3156 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3157 Window w = SCROLL_BAR_X_WINDOW (bar); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3158 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3159 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3160 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3161 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3162 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3163 XWindowChanges wc; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3164 unsigned int mask = 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3165 |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3166 wc.x = left + VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3167 wc.y = top; |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3168 |
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3169 wc.width = width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3170 wc.height = height; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3171 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3172 if (left != XINT (bar->left)) mask |= CWX; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3173 if (top != XINT (bar->top)) mask |= CWY; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3174 if (width != XINT (bar->width)) mask |= CWWidth; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3175 if (height != XINT (bar->height)) mask |= CWHeight; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3176 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3177 if (mask) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3178 XConfigureWindow (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar), |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3179 mask, &wc); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3180 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3181 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3182 XSETINT (bar->left, left); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3183 XSETINT (bar->top, top); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3184 XSETINT (bar->width, width); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3185 XSETINT (bar->height, height); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3186 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3187 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3188 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3189 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3190 /* Destroy the X window for BAR, and set its Emacs window's scroll bar |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3191 to nil. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3192 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3193 x_scroll_bar_remove (bar) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3194 struct scroll_bar *bar; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3195 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3196 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3197 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3198 BLOCK_INPUT; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3199 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3200 /* Destroy the window. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3201 XDestroyWindow (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3202 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3203 /* Disassociate this scroll bar from its window. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3204 XWINDOW (bar->window)->vertical_scroll_bar = Qnil; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3205 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3206 UNBLOCK_INPUT; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3207 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3208 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3209 /* Set the handle of the vertical scroll bar for WINDOW to indicate |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3210 that we are displaying PORTION characters out of a total of WHOLE |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3211 characters, starting at POSITION. If WINDOW has no scroll bar, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3212 create one. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3213 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3214 XTset_vertical_scroll_bar (window, portion, whole, position) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3215 struct window *window; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3216 int portion, whole, position; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3217 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3218 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3219 int top = XINT (window->top); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3220 int left = WINDOW_VERTICAL_SCROLL_BAR_COLUMN (window); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3221 int height = WINDOW_VERTICAL_SCROLL_BAR_HEIGHT (window); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3222 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3223 /* Where should this scroll bar be, pixelwise? */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3224 int pixel_top = CHAR_TO_PIXEL_ROW (f, top); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3225 int pixel_left = CHAR_TO_PIXEL_COL (f, left); |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
3226 int pixel_width |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
3227 = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
3228 ? 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:
12657
diff
changeset
|
3229 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3230 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3231 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3232 struct scroll_bar *bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3233 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3234 /* Does the scroll bar exist yet? */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3235 if (NILP (window->vertical_scroll_bar)) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3236 bar = x_scroll_bar_create (window, |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3237 pixel_top, pixel_left, |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3238 pixel_width, pixel_height); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3239 else |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3240 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3241 /* It may just need to be moved and resized. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3242 bar = XSCROLL_BAR (window->vertical_scroll_bar); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3243 x_scroll_bar_move (bar, pixel_top, pixel_left, pixel_width, pixel_height); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3244 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3245 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3246 /* Set the scroll bar's current state, unless we're currently being |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3247 dragged. */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3248 if (NILP (bar->dragging)) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3249 { |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3250 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, pixel_height); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3251 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3252 if (whole == 0) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3253 x_scroll_bar_set_handle (bar, 0, top_range, 0); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3254 else |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3255 { |
3686
910ea1d66bfd
* xterm.c (XTset_vertical_scroll_bar): Use double type for
Jim Blandy <jimb@redhat.com>
parents:
3683
diff
changeset
|
3256 int start = ((double) position * top_range) / whole; |
910ea1d66bfd
* xterm.c (XTset_vertical_scroll_bar): Use double type for
Jim Blandy <jimb@redhat.com>
parents:
3683
diff
changeset
|
3257 int end = ((double) (position + portion) * top_range) / whole; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3258 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3259 x_scroll_bar_set_handle (bar, start, end, 0); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3260 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3261 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3262 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3263 XSETVECTOR (window->vertical_scroll_bar, bar); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3264 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3265 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3266 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3267 /* The following three hooks are used when we're doing a thorough |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3268 redisplay of the frame. We don't explicitly know which scroll bars |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3269 are going to be deleted, because keeping track of when windows go |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3270 away is a real pain - "Can you say set-window-configuration, boys |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3271 and girls?" Instead, we just assert at the beginning of redisplay |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3272 that *all* scroll bars are to be removed, and then save a scroll bar |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3273 from the fiery pit when we actually redisplay its window. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3274 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3275 /* Arrange for all scroll bars on FRAME to be removed at the next call |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3276 to `*judge_scroll_bars_hook'. A scroll bar may be spared if |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3277 `*redeem_scroll_bar_hook' is applied to its window before the judgement. */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3278 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3279 XTcondemn_scroll_bars (frame) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3280 FRAME_PTR frame; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3281 { |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3282 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3283 while (! NILP (FRAME_SCROLL_BARS (frame))) |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3284 { |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3285 Lisp_Object bar; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3286 bar = FRAME_SCROLL_BARS (frame); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3287 FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3288 XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3289 XSCROLL_BAR (bar)->prev = Qnil; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3290 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame))) |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3291 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3292 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3293 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3294 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3295 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3296 /* Unmark WINDOW's scroll bar for deletion in this judgement cycle. |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3297 Note that WINDOW isn't necessarily condemned at all. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3298 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3299 XTredeem_scroll_bar (window) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3300 struct window *window; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3301 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3302 struct scroll_bar *bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3303 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3304 /* We can't redeem this window's scroll bar if it doesn't have one. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3305 if (NILP (window->vertical_scroll_bar)) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3306 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3307 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3308 bar = XSCROLL_BAR (window->vertical_scroll_bar); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3309 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3310 /* Unlink it from the condemned list. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3311 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3312 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3313 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3314 if (NILP (bar->prev)) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3315 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3316 /* If the prev pointer is nil, it must be the first in one of |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3317 the lists. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3318 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3319 /* It's not condemned. Everything's fine. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3320 return; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3321 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3322 window->vertical_scroll_bar)) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3323 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3324 else |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3325 /* If its prev pointer is nil, it must be at the front of |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3326 one or the other! */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3327 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3328 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3329 else |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3330 XSCROLL_BAR (bar->prev)->next = bar->next; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3331 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3332 if (! NILP (bar->next)) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3333 XSCROLL_BAR (bar->next)->prev = bar->prev; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3334 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3335 bar->next = FRAME_SCROLL_BARS (f); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3336 bar->prev = Qnil; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3337 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3338 if (! NILP (bar->next)) |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3339 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3340 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3341 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3342 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3343 /* Remove all scroll bars on FRAME that haven't been saved since the |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3344 last call to `*condemn_scroll_bars_hook'. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3345 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3346 XTjudge_scroll_bars (f) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3347 FRAME_PTR f; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3348 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3349 Lisp_Object bar, next; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3350 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3351 bar = FRAME_CONDEMNED_SCROLL_BARS (f); |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3352 |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3353 /* Clear out the condemned list now so we won't try to process any |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3354 more events on the hapless scroll bars. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3355 FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil; |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3356 |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3357 for (; ! NILP (bar); bar = next) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3358 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3359 struct scroll_bar *b = XSCROLL_BAR (bar); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3360 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3361 x_scroll_bar_remove (b); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3362 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3363 next = b->next; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3364 b->next = b->prev = Qnil; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3365 } |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3366 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3367 /* Now there should be no references to the condemned scroll bars, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3368 and they should get garbage-collected. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3369 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3370 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3371 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3372 /* Handle an Expose or GraphicsExpose event on a scroll bar. |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3373 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3374 This may be called from a signal handler, so we have to ignore GC |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3375 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3376 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3377 x_scroll_bar_expose (bar, event) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3378 struct scroll_bar *bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3379 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3380 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3381 Window w = SCROLL_BAR_X_WINDOW (bar); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3382 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3383 GC gc = f->output_data.x->normal_gc; |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3384 int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3385 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3386 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3387 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3388 x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3389 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3390 /* Draw a one-pixel border just inside the edges of the scroll bar. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3391 XDrawRectangle (FRAME_X_DISPLAY (f), w, gc, |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3392 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3393 /* x, y, width, height */ |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3394 0, 0, |
16301
a02555b4b2b9
(x_scroll_bar_create, x_scroll_bar_move):
Richard M. Stallman <rms@gnu.org>
parents:
16251
diff
changeset
|
3395 XINT (bar->width) - 1 - width_trim - width_trim, |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3396 XINT (bar->height) - 1); |
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3397 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3398 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3399 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3400 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3401 /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3402 is set to something other than no_event, it is enqueued. |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3403 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3404 This may be called from a signal handler, so we have to ignore GC |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3405 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3406 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3407 x_scroll_bar_handle_click (bar, event, emacs_event) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3408 struct scroll_bar *bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3409 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3410 struct input_event *emacs_event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3411 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3412 if (! GC_WINDOWP (bar->window)) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3413 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3414 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3415 emacs_event->kind = scroll_bar_click; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3416 emacs_event->code = event->xbutton.button - Button1; |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3417 emacs_event->modifiers |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3418 = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3419 (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))), |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3420 event->xbutton.state) |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3421 | (event->type == ButtonRelease |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3422 ? up_modifier |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3423 : down_modifier)); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3424 emacs_event->frame_or_window = bar->window; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3425 emacs_event->timestamp = event->xbutton.time; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3426 { |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3427 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3428 int internal_height |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3429 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3430 int top_range |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3431 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3432 int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3433 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3434 if (y < 0) y = 0; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3435 if (y > top_range) y = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3436 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3437 if (y < XINT (bar->start)) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3438 emacs_event->part = scroll_bar_above_handle; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3439 else if (y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3440 emacs_event->part = scroll_bar_handle; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3441 else |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3442 emacs_event->part = scroll_bar_below_handle; |
2953
5440f00480e6
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2923
diff
changeset
|
3443 |
5440f00480e6
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2923
diff
changeset
|
3444 /* Just because the user has clicked on the handle doesn't mean |
2958
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3445 they want to drag it. Lisp code needs to be able to decide |
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3446 whether or not we're dragging. */ |
2953
5440f00480e6
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2923
diff
changeset
|
3447 #if 0 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3448 /* If the user has just clicked on the handle, record where they're |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3449 holding it. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3450 if (event->type == ButtonPress |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3451 && emacs_event->part == scroll_bar_handle) |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3452 XSETINT (bar->dragging, y - XINT (bar->start)); |
2953
5440f00480e6
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2923
diff
changeset
|
3453 #endif |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3454 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3455 /* If the user has released the handle, set it to its final position. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3456 if (event->type == ButtonRelease |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3457 && ! NILP (bar->dragging)) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3458 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3459 int new_start = y - XINT (bar->dragging); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3460 int new_end = new_start + (XINT (bar->end) - XINT (bar->start)); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3461 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3462 x_scroll_bar_set_handle (bar, new_start, new_end, 0); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3463 bar->dragging = Qnil; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3464 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3465 |
2958
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3466 /* Same deal here as the other #if 0. */ |
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3467 #if 0 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3468 /* Clicks on the handle are always reported as occurring at the top of |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3469 the handle. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3470 if (emacs_event->part == scroll_bar_handle) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3471 emacs_event->x = bar->start; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3472 else |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3473 XSETINT (emacs_event->x, y); |
2958
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3474 #else |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3475 XSETINT (emacs_event->x, y); |
2958
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
3476 #endif |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3477 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3478 XSETINT (emacs_event->y, top_range); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3479 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3480 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3481 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3482 /* Handle some mouse motion while someone is dragging the scroll bar. |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3483 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3484 This may be called from a signal handler, so we have to ignore GC |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3485 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3486 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3487 x_scroll_bar_note_movement (bar, event) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3488 struct scroll_bar *bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3489 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3490 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
3491 FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
3492 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3493 last_mouse_movement_time = event->xmotion.time; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3494 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
3495 f->mouse_moved = 1; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3496 XSETVECTOR (last_mouse_scroll_bar, bar); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3497 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3498 /* If we're dragging the bar, display it. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3499 if (! GC_NILP (bar->dragging)) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3500 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3501 /* Where should the handle be now? */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3502 int new_start = event->xmotion.y - XINT (bar->dragging); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3503 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3504 if (new_start != XINT (bar->start)) |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3505 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3506 int new_end = new_start + (XINT (bar->end) - XINT (bar->start)); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3507 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3508 x_scroll_bar_set_handle (bar, new_start, new_end, 0); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3509 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3510 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3511 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3512 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3513 /* Return information to the user about the current position of the mouse |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3514 on the scroll bar. */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3515 static void |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3516 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3517 FRAME_PTR *fp; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3518 Lisp_Object *bar_window; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3519 enum scroll_bar_part *part; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3520 Lisp_Object *x, *y; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3521 unsigned long *time; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3522 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3523 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3524 Window w = SCROLL_BAR_X_WINDOW (bar); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3525 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3526 int win_x, win_y; |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3527 Window dummy_window; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3528 int dummy_coord; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3529 unsigned int dummy_mask; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3530 |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3531 BLOCK_INPUT; |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3532 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3533 /* Get the mouse's position relative to the scroll bar window, and |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3534 report that. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3535 if (! XQueryPointer (FRAME_X_DISPLAY (f), w, |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3536 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3537 /* Root, child, root x and root y. */ |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3538 &dummy_window, &dummy_window, |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3539 &dummy_coord, &dummy_coord, |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3540 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3541 /* Position relative to scroll bar. */ |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3542 &win_x, &win_y, |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3543 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3544 /* Mouse buttons and modifier keys. */ |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3545 &dummy_mask)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3546 ; |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3547 else |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3548 { |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3549 int inside_height |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3550 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3551 int top_range |
16251
ec1b1ae37295
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
Richard M. Stallman <rms@gnu.org>
parents:
16220
diff
changeset
|
3552 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3553 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3554 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3555 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3556 if (! NILP (bar->dragging)) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3557 win_y -= XINT (bar->dragging); |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3558 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3559 if (win_y < 0) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3560 win_y = 0; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3561 if (win_y > top_range) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3562 win_y = top_range; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3563 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3564 *fp = f; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3565 *bar_window = bar->window; |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3566 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3567 if (! NILP (bar->dragging)) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3568 *part = scroll_bar_handle; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3569 else if (win_y < XINT (bar->start)) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3570 *part = scroll_bar_above_handle; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3571 else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE) |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3572 *part = scroll_bar_handle; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3573 else |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3574 *part = scroll_bar_below_handle; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3575 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3576 XSETINT (*x, win_y); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3577 XSETINT (*y, top_range); |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3578 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
3579 f->mouse_moved = 0; |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3580 last_mouse_scroll_bar = Qnil; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3581 } |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3582 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3583 *time = last_mouse_movement_time; |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3584 |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3585 UNBLOCK_INPUT; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3586 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3587 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3588 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3589 /* The screen has been cleared so we may have changed foreground or |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3590 background colors, and the scroll bars may need to be redrawn. |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3591 Clear out the scroll bars, and ask for expose events, so we can |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3592 redraw them. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3593 |
21514 | 3594 void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3595 x_scroll_bar_clear (f) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3596 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3597 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3598 Lisp_Object bar; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3599 |
15080
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3600 /* We can have scroll bars even if this is 0, |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3601 if we just turned off scroll bar mode. |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3602 But in that case we should not clear them. */ |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3603 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3604 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3605 bar = XSCROLL_BAR (bar)->next) |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3606 XClearArea (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), |
50f527612ef6
(x_scroll_bar_clear): Do nothing if frame now has no scroll bars.
Richard M. Stallman <rms@gnu.org>
parents:
15067
diff
changeset
|
3607 0, 0, 0, 0, True); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3608 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3609 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3610 /* This processes Expose events from the menubar specific X event |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3611 loop in xmenu.c. This allows to redisplay the frame if necessary |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3612 when handling menubar or popup items. */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3613 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3614 void |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3615 process_expose_from_menu (event) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3616 XEvent event; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3617 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3618 FRAME_PTR f; |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3619 struct x_display_info *dpyinfo; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3620 |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3621 BLOCK_INPUT; |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3622 |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3623 dpyinfo = x_display_info_for_display (event.xexpose.display); |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3624 f = x_window_to_frame (dpyinfo, event.xexpose.window); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3625 if (f) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3626 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3627 if (f->async_visible == 0) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3628 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3629 f->async_visible = 1; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3630 f->async_iconified = 0; |
18074
06e42aa4c208
(process_expose_from_menu, XTread_socket):
Richard M. Stallman <rms@gnu.org>
parents:
18057
diff
changeset
|
3631 f->output_data.x->has_been_visible = 1; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3632 SET_FRAME_GARBAGED (f); |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3633 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3634 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3635 { |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3636 dumprectangle (x_window_to_frame (dpyinfo, event.xexpose.window), |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3637 event.xexpose.x, event.xexpose.y, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3638 event.xexpose.width, event.xexpose.height); |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3639 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3640 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3641 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3642 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3643 struct scroll_bar *bar |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3644 = x_window_to_scroll_bar (event.xexpose.window); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3645 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3646 if (bar) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3647 x_scroll_bar_expose (bar, &event); |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3648 } |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3649 |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3650 UNBLOCK_INPUT; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3651 } |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3652 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3653 /* Define a queue to save up SelectionRequest events for later handling. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3654 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3655 struct selection_event_queue |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3656 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3657 XEvent event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3658 struct selection_event_queue *next; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3659 }; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3660 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3661 static struct selection_event_queue *queue; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3662 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3663 /* Nonzero means queue up certain events--don't process them yet. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3664 static int x_queue_selection_requests; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3665 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3666 /* Queue up an X event *EVENT, to be processed later. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3667 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3668 static void |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3669 x_queue_event (f, event) |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3670 FRAME_PTR f; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3671 XEvent *event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3672 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3673 struct selection_event_queue *queue_tmp |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3674 = (struct selection_event_queue *) malloc (sizeof (struct selection_event_queue)); |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3675 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3676 if (queue_tmp != NULL) |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3677 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3678 queue_tmp->event = *event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3679 queue_tmp->next = queue; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3680 queue = queue_tmp; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3681 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3682 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3683 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3684 /* Take all the queued events and put them back |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3685 so that they get processed afresh. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3686 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3687 static void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3688 x_unqueue_events (display) |
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3689 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3690 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3691 while (queue != NULL) |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3692 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3693 struct selection_event_queue *queue_tmp = queue; |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3694 XPutBackEvent (display, &queue_tmp->event); |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3695 queue = queue_tmp->next; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3696 free ((char *)queue_tmp); |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3697 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3698 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3699 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3700 /* Start queuing SelectionRequest events. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3701 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3702 void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3703 x_start_queuing_selection_requests (display) |
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3704 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3705 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3706 x_queue_selection_requests++; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3707 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3708 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3709 /* Stop queuing SelectionRequest events. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3710 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3711 void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3712 x_stop_queuing_selection_requests (display) |
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3713 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3714 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3715 x_queue_selection_requests--; |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3716 x_unqueue_events (display); |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3717 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3718 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3719 /* The main X event-reading loop - XTread_socket. */ |
286 | 3720 |
3721 /* Timestamp of enter window event. This is only used by XTread_socket, | |
3722 but we have to put it out here, since static variables within functions | |
3723 sometimes don't work. */ | |
3724 static Time enter_timestamp; | |
3725 | |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3726 /* This holds the state XLookupString needs to implement dead keys |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3727 and other tricks known as "compose processing". _X Window System_ |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3728 says that a portable program can't use this, but Stephen Gildea assures |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3729 me that letting the compiler initialize it to zeros will work okay. |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3730 |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3731 This must be defined outside of XTread_socket, for the same reasons |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3732 given for enter_timestamp, above. */ |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3733 static XComposeStatus compose_status; |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3734 |
2064 | 3735 /* Record the last 100 characters stored |
3736 to help debug the loss-of-chars-during-GC problem. */ | |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3737 static int temp_index; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3738 static short temp_buffer[100]; |
2064 | 3739 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3740 /* Set this to nonzero to fake an "X I/O error" |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3741 on a particular display. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3742 struct x_display_info *XTread_socket_fake_io_error; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3743 |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3744 /* When we find no input here, we occasionally do a no-op command |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3745 to verify that the X server is still running and we can still talk with it. |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3746 We try all the open displays, one by one. |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3747 This variable is used for cycling thru the displays. */ |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3748 static struct x_display_info *next_noop_dpyinfo; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3749 |
15711
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3750 #define SET_SAVED_MENU_EVENT(size) { \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3751 if (f->output_data.x->saved_menu_event == 0) \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3752 f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent)); \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3753 bcopy (&event, f->output_data.x->saved_menu_event, size); \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3754 if (numchars >= 1) \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3755 { \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3756 bufp->kind = menu_bar_activate_event; \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3757 XSETFRAME (bufp->frame_or_window, f); \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3758 bufp++; \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3759 count++; \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3760 numchars--; \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3761 } \ |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3762 } |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3763 #define SET_SAVED_BUTTON_EVENT SET_SAVED_MENU_EVENT (sizeof (XButtonEvent)) |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3764 #define SET_SAVED_KEY_EVENT SET_SAVED_MENU_EVENT (sizeof (XKeyEvent)) |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3765 |
286 | 3766 /* Read events coming from the X server. |
3767 This routine is called by the SIGIO handler. | |
3768 We return as soon as there are no more events to be read. | |
3769 | |
3770 Events representing keys are stored in buffer BUFP, | |
3771 which can hold up to NUMCHARS characters. | |
3772 We return the number of characters stored into the buffer, | |
3773 thus pretending to be `read'. | |
3774 | |
3775 EXPECTED is nonzero if the caller knows input is available. */ | |
3776 | |
1530
a7f8a1fe258e
* xterm.c (x_convert_modifiers): Declare this to return an
Jim Blandy <jimb@redhat.com>
parents:
1436
diff
changeset
|
3777 int |
16330
e4d9d77012bc
(XTread_socket): Delete WAITP arg.
Richard M. Stallman <rms@gnu.org>
parents:
16301
diff
changeset
|
3778 XTread_socket (sd, bufp, numchars, expected) |
286 | 3779 register int sd; |
15711
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3780 /* register */ struct input_event *bufp; |
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
3781 /* register */ int numchars; |
286 | 3782 int expected; |
3783 { | |
3784 int count = 0; | |
3785 int nbytes = 0; | |
3786 int mask; | |
3787 int items_pending; /* How many items are in the X queue. */ | |
3788 XEvent event; | |
771 | 3789 struct frame *f; |
3938
83d870a52936
* xterm.c (XTread_socket): Initialize event_found to zero, and
Jim Blandy <jimb@redhat.com>
parents:
3924
diff
changeset
|
3790 int event_found = 0; |
286 | 3791 int prefix; |
3792 Lisp_Object part; | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3793 struct x_display_info *dpyinfo; |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3794 #ifdef HAVE_X_I18N |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3795 Status status_return; |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3796 #endif |
286 | 3797 |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3798 if (interrupt_input_blocked) |
286 | 3799 { |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3800 interrupt_input_pending = 1; |
286 | 3801 return -1; |
3802 } | |
3803 | |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3804 interrupt_input_pending = 0; |
286 | 3805 BLOCK_INPUT; |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3806 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3807 /* So people can tell when we have read the available input. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3808 input_signal_count++; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3809 |
286 | 3810 if (numchars <= 0) |
3811 abort (); /* Don't think this happens. */ | |
3812 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3813 /* Find the display we are supposed to read input for. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3814 It's the one communicating on descriptor SD. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3815 for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3816 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3817 #if 0 /* This ought to be unnecessary; let's verify it. */ |
286 | 3818 #ifdef FIOSNBIO |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3819 /* If available, Xlib uses FIOSNBIO to make the socket |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3820 non-blocking, and then looks for EWOULDBLOCK. If O_NDELAY is set, |
14165
65e51231924e
(XTread_socket): For selection_clear_event and
Richard M. Stallman <rms@gnu.org>
parents:
13898
diff
changeset
|
3821 FIOSNBIO is ignored, and instead of signaling EWOULDBLOCK, |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3822 a read returns 0, which Xlib interprets as equivalent to EPIPE. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3823 fcntl (dpyinfo->connection, F_SETFL, 0); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
3824 #endif /* ! defined (FIOSNBIO) */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3825 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3826 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3827 #if 0 /* This code can't be made to work, with multiple displays, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3828 and appears not to be used on any system any more. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3829 Also keyboard.c doesn't turn O_NDELAY on and off |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3830 for X connections. */ |
286 | 3831 #ifndef SIGIO |
3832 #ifndef HAVE_SELECT | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3833 if (! (fcntl (dpyinfo->connection, F_GETFL, 0) & O_NDELAY)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3834 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3835 extern int read_alarm_should_throw; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3836 read_alarm_should_throw = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3837 XPeekEvent (dpyinfo->display, &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3838 read_alarm_should_throw = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3839 } |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
3840 #endif /* HAVE_SELECT */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
3841 #endif /* SIGIO */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3842 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3843 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3844 /* For debugging, this gives a way to fake an I/O error. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3845 if (dpyinfo == XTread_socket_fake_io_error) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3846 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3847 XTread_socket_fake_io_error = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3848 x_io_error_quitter (dpyinfo->display); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3849 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3850 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3851 while (XPending (dpyinfo->display) != 0) |
286 | 3852 { |
15376
73d3ebc6aecd
(XTread_socket): Use XtAppNextEvent when using toolkit configurations.
Richard M. Stallman <rms@gnu.org>
parents:
15292
diff
changeset
|
3853 #ifdef USE_X_TOOLKIT |
73d3ebc6aecd
(XTread_socket): Use XtAppNextEvent when using toolkit configurations.
Richard M. Stallman <rms@gnu.org>
parents:
15292
diff
changeset
|
3854 /* needed to raise Motif submenus */ |
73d3ebc6aecd
(XTread_socket): Use XtAppNextEvent when using toolkit configurations.
Richard M. Stallman <rms@gnu.org>
parents:
15292
diff
changeset
|
3855 XtAppNextEvent (Xt_app_con, &event); |
73d3ebc6aecd
(XTread_socket): Use XtAppNextEvent when using toolkit configurations.
Richard M. Stallman <rms@gnu.org>
parents:
15292
diff
changeset
|
3856 #else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3857 XNextEvent (dpyinfo->display, &event); |
15376
73d3ebc6aecd
(XTread_socket): Use XtAppNextEvent when using toolkit configurations.
Richard M. Stallman <rms@gnu.org>
parents:
15292
diff
changeset
|
3858 #endif |
15973
6ad9e8fee494
(XTread_socket): Call XFilterEvent on all events,
Richard M. Stallman <rms@gnu.org>
parents:
15928
diff
changeset
|
3859 #ifdef HAVE_X_I18N |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3860 { |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3861 struct frame *f1 = x_any_window_to_frame (dpyinfo, |
22230
32f2adf05397
(XTread_socket): Fix second argument of x_any_window_to_frame.
Richard M. Stallman <rms@gnu.org>
parents:
21933
diff
changeset
|
3862 event.xclient.window); |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3863 /* The necessity of the following line took me |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3864 a full work-day to decipher from the docs!! */ |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3865 if (f1 != 0 && FRAME_XIC (f1) && XFilterEvent (&event, None)) |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3866 break; |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
3867 } |
15973
6ad9e8fee494
(XTread_socket): Call XFilterEvent on all events,
Richard M. Stallman <rms@gnu.org>
parents:
15928
diff
changeset
|
3868 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3869 event_found = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3870 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3871 switch (event.type) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3872 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3873 case ClientMessage: |
642 | 3874 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3875 if (event.xclient.message_type |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3876 == dpyinfo->Xatom_wm_protocols |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3877 && event.xclient.format == 32) |
642 | 3878 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3879 if (event.xclient.data.l[0] |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3880 == dpyinfo->Xatom_wm_take_focus) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3881 { |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
3882 /* Use x_any_window_to_frame because this |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
3883 could be the shell widget window |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
3884 if the frame has no title bar. */ |
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
3885 f = x_any_window_to_frame (dpyinfo, event.xclient.window); |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3886 #ifdef HAVE_X_I18N |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3887 /* Not quite sure this is needed -pd */ |
18885
f7b6579204b8
(XTread_socket) <ClientMessage>:
Richard M. Stallman <rms@gnu.org>
parents:
18775
diff
changeset
|
3888 if (f && FRAME_XIC (f)) |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3889 XSetICFocus (FRAME_XIC (f)); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3890 #endif |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3891 /* Since we set WM_TAKE_FOCUS, we must call |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3892 XSetInputFocus explicitly. But not if f is null, |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3893 since that might be an event for a deleted frame. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3894 if (f) |
18996
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3895 { |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3896 Display *d = event.xclient.display; |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3897 /* Catch and ignore errors, in case window has been |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3898 iconified by a window manager such as GWM. */ |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3899 int count = x_catch_errors (d); |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3900 XSetInputFocus (d, event.xclient.window, |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3901 RevertToPointerRoot, |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3902 event.xclient.data.l[1]); |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3903 /* This is needed to detect the error |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3904 if there is an error. */ |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3905 XSync (d, False); |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3906 x_uncatch_errors (d, count); |
ef81a8b79506
(dumpglyphs): Check the dimension of FONT while
Richard M. Stallman <rms@gnu.org>
parents:
18885
diff
changeset
|
3907 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3908 /* Not certain about handling scroll bars here */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3909 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3910 else if (event.xclient.data.l[0] |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3911 == dpyinfo->Xatom_wm_save_yourself) |
642 | 3912 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3913 /* Save state modify the WM_COMMAND property to |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3914 something which can reinstate us. This notifies |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3915 the session manager, who's looking for such a |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3916 PropertyNotify. Can restart processing when |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3917 a keyboard or mouse event arrives. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3918 if (numchars > 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3919 { |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3920 f = x_top_window_to_frame (dpyinfo, |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3921 event.xclient.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3922 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3923 /* This is just so we only give real data once |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3924 for a single Emacs process. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3925 if (f == selected_frame) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3926 XSetCommand (FRAME_X_DISPLAY (f), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3927 event.xclient.window, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3928 initial_argv, initial_argc); |
15519
045a36502ad4
(XTread_socket, Xatom_wm_save_yourself clause):
Richard M. Stallman <rms@gnu.org>
parents:
15515
diff
changeset
|
3929 else if (f) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3930 XSetCommand (FRAME_X_DISPLAY (f), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3931 event.xclient.window, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3932 0, 0); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3933 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3934 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3935 else if (event.xclient.data.l[0] |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3936 == dpyinfo->Xatom_wm_delete_window) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3937 { |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3938 struct frame *f |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3939 = x_any_window_to_frame (dpyinfo, |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3940 event.xclient.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3941 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3942 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3943 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3944 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3945 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3946 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3947 bufp->kind = delete_window_event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3948 XSETFRAME (bufp->frame_or_window, f); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3949 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3950 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3951 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3952 numchars -= 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3953 } |
642 | 3954 } |
3955 } | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3956 else if (event.xclient.message_type |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3957 == dpyinfo->Xatom_wm_configure_denied) |
642 | 3958 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3959 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3960 else if (event.xclient.message_type |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3961 == dpyinfo->Xatom_wm_window_moved) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3962 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3963 int new_x, new_y; |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3964 struct frame *f |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3965 = x_window_to_frame (dpyinfo, event.xclient.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3966 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3967 new_x = event.xclient.data.s[0]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3968 new_y = event.xclient.data.s[1]; |
771 | 3969 |
3970 if (f) | |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3971 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3972 f->output_data.x->left_pos = new_x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3973 f->output_data.x->top_pos = new_y; |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3974 } |
642 | 3975 } |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
3976 #ifdef HACK_EDITRES |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3977 else if (event.xclient.message_type |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3978 == dpyinfo->Xatom_editres) |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3979 { |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3980 struct frame *f |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3981 = x_any_window_to_frame (dpyinfo, event.xclient.window); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3982 _XEditResCheckMessages (f->output_data.x->widget, NULL, |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3983 &event, NULL); |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3984 } |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
3985 #endif /* HACK_EDITRES */ |
642 | 3986 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3987 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3988 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3989 case SelectionNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3990 #ifdef USE_X_TOOLKIT |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3991 if (! x_window_to_frame (dpyinfo, event.xselection.requestor)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3992 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3993 #endif /* not USE_X_TOOLKIT */ |
21514 | 3994 x_handle_selection_notify (&event.xselection); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3995 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3996 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3997 case SelectionClear: /* Someone has grabbed ownership. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3998 #ifdef USE_X_TOOLKIT |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
3999 if (! x_window_to_frame (dpyinfo, event.xselectionclear.window)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4000 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4001 #endif /* USE_X_TOOLKIT */ |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
4002 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4003 XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4004 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4005 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4006 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4007 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4008 bufp->kind = selection_clear_event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4009 SELECTION_EVENT_DISPLAY (bufp) = eventp->display; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4010 SELECTION_EVENT_SELECTION (bufp) = eventp->selection; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4011 SELECTION_EVENT_TIME (bufp) = eventp->time; |
14165
65e51231924e
(XTread_socket): For selection_clear_event and
Richard M. Stallman <rms@gnu.org>
parents:
13898
diff
changeset
|
4012 bufp->frame_or_window = Qnil; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4013 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4014 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4015 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4016 numchars -= 1; |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
4017 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4018 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4019 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4020 case SelectionRequest: /* Someone wants our selection. */ |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4021 #ifdef USE_X_TOOLKIT |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4022 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4023 goto OTHER; |
6984
8e9465c13702
(XTread_socket): Delete the non-NEW_SELECTIONS code
Richard M. Stallman <rms@gnu.org>
parents:
6983
diff
changeset
|
4024 #endif /* USE_X_TOOLKIT */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4025 if (x_queue_selection_requests) |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4026 x_queue_event (x_window_to_frame (dpyinfo, event.xselectionrequest.owner), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4027 &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4028 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4029 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4030 XSelectionRequestEvent *eventp = (XSelectionRequestEvent *) &event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4031 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4032 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4033 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4034 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4035 bufp->kind = selection_request_event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4036 SELECTION_EVENT_DISPLAY (bufp) = eventp->display; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4037 SELECTION_EVENT_REQUESTOR (bufp) = eventp->requestor; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4038 SELECTION_EVENT_SELECTION (bufp) = eventp->selection; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4039 SELECTION_EVENT_TARGET (bufp) = eventp->target; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4040 SELECTION_EVENT_PROPERTY (bufp) = eventp->property; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4041 SELECTION_EVENT_TIME (bufp) = eventp->time; |
14165
65e51231924e
(XTread_socket): For selection_clear_event and
Richard M. Stallman <rms@gnu.org>
parents:
13898
diff
changeset
|
4042 bufp->frame_or_window = Qnil; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4043 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4044 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4045 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4046 numchars -= 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4047 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4048 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4049 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4050 case PropertyNotify: |
6984
8e9465c13702
(XTread_socket): Delete the non-NEW_SELECTIONS code
Richard M. Stallman <rms@gnu.org>
parents:
6983
diff
changeset
|
4051 #ifdef USE_X_TOOLKIT |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4052 if (!x_any_window_to_frame (dpyinfo, event.xproperty.window)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4053 goto OTHER; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4054 #endif /* not USE_X_TOOLKIT */ |
21514 | 4055 x_handle_property_notify (&event.xproperty); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4056 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4057 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4058 case ReparentNotify: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4059 f = x_top_window_to_frame (dpyinfo, event.xreparent.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4060 if (f) |
286 | 4061 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4062 int x, y; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4063 f->output_data.x->parent_desc = event.xreparent.parent; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4064 x_real_positions (f, &x, &y); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4065 f->output_data.x->left_pos = x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4066 f->output_data.x->top_pos = y; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4067 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4068 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4069 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4070 case Expose: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4071 f = x_window_to_frame (dpyinfo, event.xexpose.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4072 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4073 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4074 if (f->async_visible == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4075 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4076 f->async_visible = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4077 f->async_iconified = 0; |
18074
06e42aa4c208
(process_expose_from_menu, XTread_socket):
Richard M. Stallman <rms@gnu.org>
parents:
18057
diff
changeset
|
4078 f->output_data.x->has_been_visible = 1; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4079 SET_FRAME_GARBAGED (f); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4080 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4081 else |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4082 dumprectangle (x_window_to_frame (dpyinfo, |
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4083 event.xexpose.window), |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4084 event.xexpose.x, event.xexpose.y, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4085 event.xexpose.width, event.xexpose.height); |
286 | 4086 } |
4087 else | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4088 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4089 struct scroll_bar *bar |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4090 = x_window_to_scroll_bar (event.xexpose.window); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4091 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4092 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4093 x_scroll_bar_expose (bar, &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4094 #ifdef USE_X_TOOLKIT |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4095 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4096 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4097 #endif /* USE_X_TOOLKIT */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4098 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4099 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4100 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4101 case GraphicsExpose: /* This occurs when an XCopyArea's |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4102 source area was obscured or not |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4103 available.*/ |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4104 f = x_window_to_frame (dpyinfo, event.xgraphicsexpose.drawable); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4105 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4106 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4107 dumprectangle (f, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4108 event.xgraphicsexpose.x, event.xgraphicsexpose.y, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4109 event.xgraphicsexpose.width, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4110 event.xgraphicsexpose.height); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4111 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4112 #ifdef USE_X_TOOLKIT |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4113 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4114 goto OTHER; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4115 #endif /* USE_X_TOOLKIT */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4116 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4117 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4118 case NoExpose: /* This occurs when an XCopyArea's |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4119 source area was completely |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4120 available */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4121 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4122 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4123 case UnmapNotify: |
12750
7e5276da6270
(XTread_socket): For UnmapNotify, use x_top_window_to_frame.
Richard M. Stallman <rms@gnu.org>
parents:
12667
diff
changeset
|
4124 f = x_top_window_to_frame (dpyinfo, event.xunmap.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4125 if (f) /* F may no longer exist if |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4126 the frame was deleted. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4127 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4128 /* While a frame is unmapped, display generation is |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4129 disabled; you don't want to spend time updating a |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4130 display that won't ever be seen. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4131 f->async_visible = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4132 /* We can't distinguish, from the event, whether the window |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4133 has become iconified or invisible. So assume, if it |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4134 was previously visible, than now it is iconified. |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4135 But x_make_frame_invisible clears both |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4136 the visible flag and the iconified flag; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4137 and that way, we know the window is not iconified now. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4138 if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4139 { |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4140 f->async_iconified = 1; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4141 |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4142 bufp->kind = iconify_event; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4143 XSETFRAME (bufp->frame_or_window, f); |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4144 bufp++; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4145 count++; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4146 numchars--; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
4147 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4148 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4149 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4150 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4151 case MapNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4152 /* We use x_top_window_to_frame because map events can come |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4153 for subwindows and they don't mean that the frame is visible. */ |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4154 f = x_top_window_to_frame (dpyinfo, event.xmap.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4155 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4156 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4157 f->async_visible = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4158 f->async_iconified = 0; |
18074
06e42aa4c208
(process_expose_from_menu, XTread_socket):
Richard M. Stallman <rms@gnu.org>
parents:
18057
diff
changeset
|
4159 f->output_data.x->has_been_visible = 1; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4160 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4161 /* wait_reading_process_input will notice this and update |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4162 the frame's display structures. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4163 SET_FRAME_GARBAGED (f); |
9823
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
4164 |
11348
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4165 if (f->iconified) |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4166 { |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4167 bufp->kind = deiconify_event; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4168 XSETFRAME (bufp->frame_or_window, f); |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4169 bufp++; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4170 count++; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4171 numchars--; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
4172 } |
17519
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
4173 else if (! NILP (Vframe_list) |
14895
634fc7befbdf
(XTread_socket, MapNotify case):
Richard M. Stallman <rms@gnu.org>
parents:
14830
diff
changeset
|
4174 && ! NILP (XCONS (Vframe_list)->cdr)) |
11921
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
4175 /* Force a redisplay sooner or later |
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
4176 to update the frame titles |
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
4177 in case this is the second frame. */ |
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
4178 record_asynch_buffer_change (); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4179 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4180 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4181 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4182 /* Turn off processing if we become fully obscured. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4183 case VisibilityNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4184 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4185 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4186 case KeyPress: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4187 f = x_any_window_to_frame (dpyinfo, event.xkey.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4188 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4189 if (f != 0) |
286 | 4190 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4191 KeySym keysym, orig_keysym; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4192 /* al%imercury@uunet.uu.net says that making this 81 instead of |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4193 80 fixed a bug whereby meta chars made his Emacs hang. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4194 unsigned char copy_buffer[81]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4195 int modifiers; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4196 |
15806
a3f1489198ea
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15803
diff
changeset
|
4197 #if 0 /* This was how we made f10 work in Motif. |
a3f1489198ea
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15803
diff
changeset
|
4198 The drawback is, you can't type at Emacs when the |
a3f1489198ea
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15803
diff
changeset
|
4199 the mouse is in the menu bar. So it is better to |
a3f1489198ea
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15803
diff
changeset
|
4200 turn off f10 in Motif and let Emacs handle it. */ |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4201 #ifdef USE_MOTIF |
15629 | 4202 if (lw_window_is_in_menubar (event.xkey.window, |
4203 f->output_data.x->menubar_widget | |
4204 )) | |
4205 { | |
15711
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
4206 SET_SAVED_KEY_EVENT; |
15629 | 4207 break; |
4208 } | |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4209 #endif /* USE_MOTIF */ |
15806
a3f1489198ea
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15803
diff
changeset
|
4210 #endif /* 0 */ |
15639
2ca62609dd67
(XTread_socket): Add #ifdef for previous change.
Karl Heuer <kwzh@gnu.org>
parents:
15629
diff
changeset
|
4211 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4212 event.xkey.state |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4213 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4214 extra_keyboard_modifiers); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4215 modifiers = event.xkey.state; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4216 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4217 /* This will have to go some day... */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4218 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4219 /* make_lispy_event turns chars into control chars. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4220 Don't do it here because XLookupString is too eager. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4221 event.xkey.state &= ~ControlMask; |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4222 event.xkey.state &= ~(dpyinfo->meta_mod_mask |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4223 | dpyinfo->super_mod_mask |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4224 | dpyinfo->hyper_mod_mask |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4225 | dpyinfo->alt_mod_mask); |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4226 |
16483
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4227 /* In case Meta is ComposeCharacter, |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4228 clear its status. According to Markus Ehrnsperger |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4229 Markus.Ehrnsperger@lehrstuhl-bross.physik.uni-muenchen.de |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4230 this enables ComposeCharacter to work whether or |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4231 not it is combined with Meta. */ |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4232 if (modifiers & dpyinfo->meta_mod_mask) |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4233 bzero (&compose_status, sizeof (compose_status)); |
1b53fdb98184
(XTread_socket, KeyPress case): Clear compose_status
Richard M. Stallman <rms@gnu.org>
parents:
16430
diff
changeset
|
4234 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4235 #ifdef HAVE_X_I18N |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4236 if (FRAME_XIC (f)) |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4237 { |
18705
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
4238 /* The necessity of the following line took me |
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
4239 a full work-day to decipher from the docs!! */ |
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
4240 if (XFilterEvent (&event, None)) |
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
4241 break; |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4242 nbytes = XmbLookupString (FRAME_XIC (f), |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4243 &event.xkey, copy_buffer, |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4244 80, &keysym, |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4245 &status_return); |
23567
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4246 if (status_return == XLookupNone) |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4247 break; |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4248 else if (status_return == XLookupChars) |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4249 keysym = NoSymbol; |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4250 else if (status_return != XLookupKeySym |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4251 && status_return != XLookupBoth) |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4252 abort (); |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4253 } |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4254 else |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4255 nbytes = XLookupString (&event.xkey, copy_buffer, |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4256 80, &keysym, &compose_status); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4257 #else |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
4258 nbytes = XLookupString (&event.xkey, copy_buffer, |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
4259 80, &keysym, &compose_status); |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4260 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4261 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4262 orig_keysym = keysym; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4263 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4264 if (numchars > 1) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4265 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4266 if (((keysym >= XK_BackSpace && keysym <= XK_Escape) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4267 || keysym == XK_Delete |
17227
d11d6c9a48e8
(XTread_socket): Handle ISO_Left_Tab.
Richard M. Stallman <rms@gnu.org>
parents:
17194
diff
changeset
|
4268 #ifdef XK_ISO_Left_Tab |
17232
4604d19bd730
(XTread_socket): Accept XK_ISO_* keys.
Richard M. Stallman <rms@gnu.org>
parents:
17227
diff
changeset
|
4269 || (keysym >= XK_ISO_Left_Tab && keysym <= XK_ISO_Enter) |
17227
d11d6c9a48e8
(XTread_socket): Handle ISO_Left_Tab.
Richard M. Stallman <rms@gnu.org>
parents:
17194
diff
changeset
|
4270 #endif |
22400
8fbe6f509385
(XTread_socket): Accept Japanese XK keysyms.
Richard M. Stallman <rms@gnu.org>
parents:
22230
diff
changeset
|
4271 || (keysym >= XK_Kanji && keysym <= XK_Eisu_toggle) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4272 || IsCursorKey (keysym) /* 0xff50 <= x < 0xff60 */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4273 || IsMiscFunctionKey (keysym) /* 0xff60 <= x < VARIES */ |
3218
0069a30d083f
(XTread_socket, case KeyPress) [HPUX]:
Richard M. Stallman <rms@gnu.org>
parents:
3135
diff
changeset
|
4274 #ifdef HPUX |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4275 /* This recognizes the "extended function keys". |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4276 It seems there's no cleaner way. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4277 Test IsModifierKey to avoid handling mode_switch |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4278 incorrectly. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4279 || ((unsigned) (keysym) >= XK_Select |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4280 && (unsigned)(keysym) < XK_KP_Space) |
3218
0069a30d083f
(XTread_socket, case KeyPress) [HPUX]:
Richard M. Stallman <rms@gnu.org>
parents:
3135
diff
changeset
|
4281 #endif |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4282 #ifdef XK_dead_circumflex |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4283 || orig_keysym == XK_dead_circumflex |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4284 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4285 #ifdef XK_dead_grave |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4286 || orig_keysym == XK_dead_grave |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4287 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4288 #ifdef XK_dead_tilde |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4289 || orig_keysym == XK_dead_tilde |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4290 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4291 #ifdef XK_dead_diaeresis |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4292 || orig_keysym == XK_dead_diaeresis |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4293 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4294 #ifdef XK_dead_macron |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4295 || orig_keysym == XK_dead_macron |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4296 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4297 #ifdef XK_dead_degree |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4298 || orig_keysym == XK_dead_degree |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4299 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4300 #ifdef XK_dead_acute |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4301 || orig_keysym == XK_dead_acute |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4302 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4303 #ifdef XK_dead_cedilla |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4304 || orig_keysym == XK_dead_cedilla |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4305 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4306 #ifdef XK_dead_breve |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4307 || orig_keysym == XK_dead_breve |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4308 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4309 #ifdef XK_dead_ogonek |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4310 || orig_keysym == XK_dead_ogonek |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4311 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4312 #ifdef XK_dead_caron |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4313 || orig_keysym == XK_dead_caron |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4314 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4315 #ifdef XK_dead_doubleacute |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4316 || orig_keysym == XK_dead_doubleacute |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4317 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4318 #ifdef XK_dead_abovedot |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4319 || orig_keysym == XK_dead_abovedot |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
4320 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4321 || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4322 || IsFunctionKey (keysym) /* 0xffbe <= x < 0xffe1 */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4323 /* Any "vendor-specific" key is ok. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4324 || (orig_keysym & (1 << 28))) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4325 && ! (IsModifierKey (orig_keysym) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4326 #ifndef HAVE_X11R5 |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4327 #ifdef XK_Mode_switch |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4328 || ((unsigned)(orig_keysym) == XK_Mode_switch) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4329 #endif |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4330 #ifdef XK_Num_Lock |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4331 || ((unsigned)(orig_keysym) == XK_Num_Lock) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4332 #endif |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
4333 #endif /* not HAVE_X11R5 */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4334 )) |
286 | 4335 { |
2064 | 4336 if (temp_index == sizeof temp_buffer / sizeof (short)) |
4337 temp_index = 0; | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4338 temp_buffer[temp_index++] = keysym; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4339 bufp->kind = non_ascii_keystroke; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4340 bufp->code = keysym; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
4341 XSETFRAME (bufp->frame_or_window, f); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4342 bufp->modifiers |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4343 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4344 modifiers); |
708 | 4345 bufp->timestamp = event.xkey.time; |
286 | 4346 bufp++; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4347 count++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4348 numchars--; |
286 | 4349 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4350 else if (numchars > nbytes) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4351 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4352 register int i; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4353 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4354 for (i = 0; i < nbytes; i++) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4355 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4356 if (temp_index == sizeof temp_buffer / sizeof (short)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4357 temp_index = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4358 temp_buffer[temp_index++] = copy_buffer[i]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4359 bufp->kind = ascii_keystroke; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4360 bufp->code = copy_buffer[i]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4361 XSETFRAME (bufp->frame_or_window, f); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4362 bufp->modifiers |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4363 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4364 modifiers); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4365 bufp->timestamp = event.xkey.time; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4366 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4367 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4368 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4369 count += nbytes; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4370 numchars -= nbytes; |
23567
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4371 |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4372 if (keysym == NoSymbol) |
5a0cdfd791a2
(XTread_socket): Check the returned value of XmbLookupString more carefully.
Paul Eggert <eggert@twinsun.com>
parents:
23515
diff
changeset
|
4373 break; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4374 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4375 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4376 abort (); |
286 | 4377 } |
2064 | 4378 else |
4379 abort (); | |
286 | 4380 } |
13898
dceb33c07f9e
(XTread_socket): Pass KeyPress events to the toolkit.
Richard M. Stallman <rms@gnu.org>
parents:
13884
diff
changeset
|
4381 goto OTHER; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4382 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4383 /* Here's a possible interpretation of the whole |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4384 FocusIn-EnterNotify FocusOut-LeaveNotify mess. If you get a |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4385 FocusIn event, you have to get a FocusOut event before you |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4386 relinquish the focus. If you haven't received a FocusIn event, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4387 then a mere LeaveNotify is enough to free you. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4388 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4389 case EnterNotify: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4390 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4391 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4392 if (event.xcrossing.focus) /* Entered Window */ |
286 | 4393 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4394 /* Avoid nasty pop/raise loops. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4395 if (f && (!(f->auto_raise) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4396 || !(f->auto_lower) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4397 || (event.xcrossing.time - enter_timestamp) > 500)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4398 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4399 x_new_focus_frame (dpyinfo, f); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4400 enter_timestamp = event.xcrossing.time; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4401 } |
286 | 4402 } |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4403 else if (f == dpyinfo->x_focus_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4404 x_new_focus_frame (dpyinfo, 0); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4405 /* EnterNotify counts as mouse movement, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4406 so update things that depend on mouse position. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4407 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4408 note_mouse_movement (f, &event.xmotion); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4409 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4410 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4411 case FocusIn: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4412 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4413 if (event.xfocus.detail != NotifyPointer) |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4414 dpyinfo->x_focus_event_frame = f; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4415 if (f) |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4416 x_new_focus_frame (dpyinfo, f); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4417 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4418 #ifdef HAVE_X_I18N |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4419 if (f && FRAME_XIC (f)) |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4420 XSetICFocus (FRAME_XIC (f)); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4421 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4422 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4423 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4424 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4425 case LeaveNotify: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4426 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4427 if (f) |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
4428 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4429 if (f == dpyinfo->mouse_face_mouse_frame) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4430 /* If we move outside the frame, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4431 then we're certainly no longer on any text in the frame. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4432 clear_mouse_face (dpyinfo); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4433 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4434 if (event.xcrossing.focus) |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4435 x_mouse_leave (dpyinfo); |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
4436 else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4437 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4438 if (f == dpyinfo->x_focus_event_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4439 dpyinfo->x_focus_event_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4440 if (f == dpyinfo->x_focus_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4441 x_new_focus_frame (dpyinfo, 0); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4442 } |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
4443 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4444 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4445 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4446 case FocusOut: |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4447 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4448 if (event.xfocus.detail != NotifyPointer |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4449 && f == dpyinfo->x_focus_event_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4450 dpyinfo->x_focus_event_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4451 if (f && f == dpyinfo->x_focus_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4452 x_new_focus_frame (dpyinfo, 0); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4453 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4454 #ifdef HAVE_X_I18N |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4455 if (f && FRAME_XIC (f)) |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4456 XUnsetICFocus (FRAME_XIC (f)); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4457 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
4458 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4459 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4460 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4461 case MotionNotify: |
286 | 4462 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4463 if (dpyinfo->grabbed && last_mouse_frame |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4464 && FRAME_LIVE_P (last_mouse_frame)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4465 f = last_mouse_frame; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4466 else |
11198
571306c7b038
New arg DPYINFO to all callers of x_window_to_frame, x_any_window_to_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11166
diff
changeset
|
4467 f = x_window_to_frame (dpyinfo, event.xmotion.window); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4468 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4469 note_mouse_movement (f, &event.xmotion); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4470 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4471 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4472 struct scroll_bar *bar |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4473 = x_window_to_scroll_bar (event.xmotion.window); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4474 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4475 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4476 x_scroll_bar_note_movement (bar, &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4477 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4478 /* If we move outside the frame, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4479 then we're certainly no longer on any text in the frame. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4480 clear_mouse_face (dpyinfo); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4481 } |
286 | 4482 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4483 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4484 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4485 case ConfigureNotify: |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
4486 f = x_top_window_to_frame (dpyinfo, event.xconfigure.window); |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
4487 if (f) |
3030
2c5ea1c98256
(XTread_socket): For ConfigureNotify event,
Richard M. Stallman <rms@gnu.org>
parents:
3016
diff
changeset
|
4488 { |
24489
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4489 int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height); |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4490 int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4491 #ifndef USE_X_TOOLKIT |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4492 /* In the toolkit version, change_frame_size |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4493 is called by the code that handles resizing |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4494 of the EmacsFrame widget. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4495 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4496 /* Even if the number of character rows and columns has |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4497 not changed, the font size may have changed, so we need |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4498 to check the pixel dimensions as well. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4499 if (columns != f->width |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4500 || rows != f->height |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4501 || event.xconfigure.width != f->output_data.x->pixel_width |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4502 || event.xconfigure.height != f->output_data.x->pixel_height) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4503 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4504 change_frame_size (f, rows, columns, 0, 1); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4505 SET_FRAME_GARBAGED (f); |
16491
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
4506 cancel_mouse_face (f); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4507 } |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4508 #endif |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4509 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4510 f->output_data.x->pixel_width = event.xconfigure.width; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4511 f->output_data.x->pixel_height = event.xconfigure.height; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4512 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4513 /* What we have now is the position of Emacs's own window. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4514 Convert that to the position of the window manager window. */ |
18008
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4515 x_real_positions (f, &f->output_data.x->left_pos, |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4516 &f->output_data.x->top_pos); |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4517 |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4518 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4519 { |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4520 /* Since the WM decorations come below top_pos now, |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4521 we must put them below top_pos in the future. */ |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4522 f->output_data.x->win_gravity = NorthWestGravity; |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4523 x_wm_set_size_hint (f, (long) 0, 0); |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
4524 } |
20182
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4525 #ifdef USE_MOTIF |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4526 /* Some window managers pass (0,0) as the location of |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4527 the window, and the Motif event handler stores it |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4528 in the emacs widget, which messes up Motif menus. */ |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4529 if (event.xconfigure.x == 0 && event.xconfigure.y == 0) |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4530 { |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4531 event.xconfigure.x = f->output_data.x->widget->core.x; |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4532 event.xconfigure.y = f->output_data.x->widget->core.y; |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4533 } |
9f3dd970927e
(XTread_socket): Check for bogus (0,0) location.
Karl Heuer <kwzh@gnu.org>
parents:
20180
diff
changeset
|
4534 #endif |
24489
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4535 /* If cursor was outside the new size, mark it as off. */ |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4536 if (f->phys_cursor_y >= rows |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4537 || f->phys_cursor_x >= columns) |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4538 { |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4539 f->phys_cursor_x = 0; |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4540 f->phys_cursor_y = 0; |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4541 f->phys_cursor_on = 0; |
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4542 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4543 } |
24489
abf5b4802f9b
(XTread_socket) <ConfigureNotify>:
Karl Heuer <kwzh@gnu.org>
parents:
24484
diff
changeset
|
4544 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
4545 goto OTHER; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4546 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4547 case ButtonPress: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4548 case ButtonRelease: |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4549 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4550 /* If we decide we want to generate an event to be seen |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4551 by the rest of Emacs, we put it here. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4552 struct input_event emacs_event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4553 emacs_event.kind = no_event; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4554 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4555 bzero (&compose_status, sizeof (compose_status)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4556 |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4557 if (dpyinfo->grabbed && last_mouse_frame |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4558 && FRAME_LIVE_P (last_mouse_frame)) |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4559 f = last_mouse_frame; |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4560 else |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4561 f = x_window_to_frame (dpyinfo, event.xbutton.window); |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4562 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4563 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4564 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4565 if (!dpyinfo->x_focus_frame || f == dpyinfo->x_focus_frame) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4566 construct_mouse_click (&emacs_event, &event, f); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4567 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4568 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4569 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4570 struct scroll_bar *bar |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4571 = x_window_to_scroll_bar (event.xbutton.window); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4572 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4573 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4574 x_scroll_bar_handle_click (bar, &event, &emacs_event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4575 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4576 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4577 if (event.type == ButtonPress) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4578 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4579 dpyinfo->grabbed |= (1 << event.xbutton.button); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4580 last_mouse_frame = f; |
23643
701b6bdc7a22
(XTread_socket): ButtonPress clears f->mouse_moved.
Karl Heuer <kwzh@gnu.org>
parents:
23567
diff
changeset
|
4581 /* Ignore any mouse motion that happened |
701b6bdc7a22
(XTread_socket): ButtonPress clears f->mouse_moved.
Karl Heuer <kwzh@gnu.org>
parents:
23567
diff
changeset
|
4582 before this event; any subsequent mouse-movement |
701b6bdc7a22
(XTread_socket): ButtonPress clears f->mouse_moved.
Karl Heuer <kwzh@gnu.org>
parents:
23567
diff
changeset
|
4583 Emacs events should reflect only motion after |
701b6bdc7a22
(XTread_socket): ButtonPress clears f->mouse_moved.
Karl Heuer <kwzh@gnu.org>
parents:
23567
diff
changeset
|
4584 the ButtonPress. */ |
23701
6c0896abbbd4
(XTread_socket): Fix previous change in case F == 0.
Karl Heuer <kwzh@gnu.org>
parents:
23684
diff
changeset
|
4585 if (f != 0) |
6c0896abbbd4
(XTread_socket): Fix previous change in case F == 0.
Karl Heuer <kwzh@gnu.org>
parents:
23684
diff
changeset
|
4586 f->mouse_moved = 0; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4587 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4588 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4589 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4590 dpyinfo->grabbed &= ~(1 << event.xbutton.button); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4591 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4592 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4593 if (numchars >= 1 && emacs_event.kind != no_event) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4594 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4595 bcopy (&emacs_event, bufp, sizeof (struct input_event)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4596 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4597 count++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4598 numchars--; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4599 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4600 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4601 #ifdef USE_X_TOOLKIT |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4602 f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4603 /* For a down-event in the menu bar, |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4604 don't pass it to Xt right now. |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4605 Instead, save it away |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4606 and we will pass it to Xt from kbd_buffer_get_event. |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4607 That way, we can run some Lisp code first. */ |
13561
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4608 if (f && event.type == ButtonPress |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4609 /* Verify the event is really within the menu bar |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4610 and not just sent to it due to grabbing. */ |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4611 && event.xbutton.x >= 0 |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4612 && event.xbutton.x < f->output_data.x->pixel_width |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4613 && event.xbutton.y >= 0 |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4614 && event.xbutton.y < f->output_data.x->menubar_height |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4615 && event.xbutton.same_screen) |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4616 { |
15711
099dc465c948
(SET_SAVED_MENU_EVENT): New macro.
Karl Heuer <kwzh@gnu.org>
parents:
15639
diff
changeset
|
4617 SET_SAVED_BUTTON_EVENT; |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4618 XSETFRAME (last_mouse_press_frame, f); |
15793
fc460a98a7f9
(last_mouse_press_frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15711
diff
changeset
|
4619 } |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4620 else if (event.type == ButtonPress) |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4621 { |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4622 last_mouse_press_frame = Qnil; |
15808
3afa38a18102
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15806
diff
changeset
|
4623 goto OTHER; |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4624 } |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4625 #ifdef USE_MOTIF /* This should do not harm for Lucid, |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4626 but I am trying to be cautious. */ |
15793
fc460a98a7f9
(last_mouse_press_frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15711
diff
changeset
|
4627 else if (event.type == ButtonRelease) |
fc460a98a7f9
(last_mouse_press_frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15711
diff
changeset
|
4628 { |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4629 if (!NILP (last_mouse_press_frame)) |
15794 | 4630 { |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4631 f = XFRAME (last_mouse_press_frame); |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4632 if (f->output_data.x) |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4633 { |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4634 SET_SAVED_BUTTON_EVENT; |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4635 } |
15794 | 4636 } |
15808
3afa38a18102
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15806
diff
changeset
|
4637 else |
3afa38a18102
(XTread_socket): Delete the code to pass menu bar keys
Richard M. Stallman <rms@gnu.org>
parents:
15806
diff
changeset
|
4638 goto OTHER; |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4639 } |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
4640 #endif /* USE_MOTIF */ |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4641 else |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4642 goto OTHER; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4643 #endif /* USE_X_TOOLKIT */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4644 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4645 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4646 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4647 case CirculateNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4648 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4649 case CirculateRequest: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4650 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4651 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4652 case MappingNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4653 /* Someone has changed the keyboard mapping - update the |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4654 local cache. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4655 switch (event.xmapping.request) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4656 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4657 case MappingModifier: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4658 x_find_modifier_meanings (dpyinfo); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4659 /* This is meant to fall through. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4660 case MappingKeyboard: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4661 XRefreshKeyboardMapping (&event.xmapping); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4662 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4663 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4664 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4665 default: |
13898
dceb33c07f9e
(XTread_socket): Pass KeyPress events to the toolkit.
Richard M. Stallman <rms@gnu.org>
parents:
13884
diff
changeset
|
4666 OTHER: |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4667 #ifdef USE_X_TOOLKIT |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4668 BLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4669 XtDispatchEvent (&event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4670 UNBLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4671 #endif /* USE_X_TOOLKIT */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4672 break; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
4673 } |
286 | 4674 } |
4675 } | |
4676 | |
8485
6e4b40c80021
(XTread_socket): Don't test X_IO_BUG; make that code unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
8437
diff
changeset
|
4677 /* On some systems, an X bug causes Emacs to get no more events |
6e4b40c80021
(XTread_socket): Don't test X_IO_BUG; make that code unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
8437
diff
changeset
|
4678 when the window is destroyed. Detect that. (1994.) */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4679 if (! event_found) |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4680 { |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4681 /* Emacs and the X Server eats up CPU time if XNoOp is done every time. |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4682 One XNOOP in 100 loops will make Emacs terminate. |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4683 B. Bretthauer, 1994 */ |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4684 x_noop_count++; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4685 if (x_noop_count >= 100) |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4686 { |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4687 x_noop_count=0; |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4688 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4689 if (next_noop_dpyinfo == 0) |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4690 next_noop_dpyinfo = x_display_list; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4691 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4692 XNoOp (next_noop_dpyinfo->display); |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4693 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4694 /* Each time we get here, cycle through the displays now open. */ |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4695 next_noop_dpyinfo = next_noop_dpyinfo->next; |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4696 } |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4697 } |
5753
eb44ecad5557
(XTread_socket): Add X_IO_BUG conditional.
Richard M. Stallman <rms@gnu.org>
parents:
5740
diff
changeset
|
4698 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4699 /* If the focus was just given to an autoraising frame, |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4700 raise it now. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4701 /* ??? This ought to be able to handle more than one such frame. */ |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4702 if (pending_autoraise_frame) |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4703 { |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4704 x_raise_frame (pending_autoraise_frame); |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4705 pending_autoraise_frame = 0; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4706 } |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4707 |
286 | 4708 UNBLOCK_INPUT; |
4709 return count; | |
4710 } | |
4711 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4712 /* Drawing the cursor. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4713 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4714 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4715 /* Draw a hollow box cursor on frame F at X, Y. |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4716 Don't change the inside of the box. */ |
286 | 4717 |
4718 static void | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4719 x_draw_box (f, x, y) |
771 | 4720 struct frame *f; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4721 int x, y; |
286 | 4722 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4723 int left = CHAR_TO_PIXEL_COL (f, x); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4724 int top = CHAR_TO_PIXEL_ROW (f, y); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4725 int width = 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:
12657
diff
changeset
|
4726 int height = f->output_data.x->line_height; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4727 int c = FAST_GLYPH_CHAR (f->phys_cursor_glyph); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4728 int charset = CHAR_CHARSET (c); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4729 |
18775
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4730 XGCValues xgcv; |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4731 unsigned long mask = GCForeground; |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4732 |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4733 xgcv.foreground = f->output_data.x->cursor_pixel; |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4734 |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4735 /* cursor_gc's foreground color is typically the same as the normal |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4736 background color, which can cause the cursor box to be invisible. */ |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4737 if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc) |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4738 XChangeGC (FRAME_X_DISPLAY (f), |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4739 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc, |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4740 mask, &xgcv); |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4741 else |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4742 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4743 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), mask, &xgcv); |
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4744 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4745 /* If cursor is on a multi-column character, multiply WIDTH by columns. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4746 width *= (charset == CHARSET_COMPOSITION |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4747 ? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4748 : CHARSET_WIDTH (charset)); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4749 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
18775
fcfa336f737e
(x_draw_box): Use scratch_cursor_gc to draw the cursor
Richard M. Stallman <rms@gnu.org>
parents:
18733
diff
changeset
|
4750 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc, |
286 | 4751 left, top, width - 1, height - 1); |
4752 } | |
4753 | |
771 | 4754 /* Clear the cursor of frame F to background color, |
286 | 4755 and mark the cursor as not shown. |
4756 This is used when the text where the cursor is | |
4757 is about to be rewritten. */ | |
4758 | |
4759 static void | |
771 | 4760 clear_cursor (f) |
4761 struct frame *f; | |
286 | 4762 { |
4763 int mask; | |
4764 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4765 if (! FRAME_VISIBLE_P (f) |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4766 || ! f->phys_cursor_on) |
286 | 4767 return; |
4768 | |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4769 x_update_cursor (f, 0); |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4770 f->phys_cursor_on = 0; |
286 | 4771 } |
4772 | |
771 | 4773 /* Redraw the glyph at ROW, COLUMN on frame F, in the style |
429 | 4774 HIGHLIGHT. HIGHLIGHT is as defined for dumpglyphs. Return the |
4775 glyph drawn. */ | |
286 | 4776 |
4777 static void | |
771 | 4778 x_draw_single_glyph (f, row, column, glyph, highlight) |
4779 struct frame *f; | |
286 | 4780 int row, column; |
429 | 4781 GLYPH glyph; |
286 | 4782 int highlight; |
4783 { | |
771 | 4784 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
4785 CHAR_TO_PIXEL_COL (f, column), |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
4786 CHAR_TO_PIXEL_ROW (f, row), |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
4787 &glyph, 1, highlight, 0, NULL); |
286 | 4788 } |
4789 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4790 static void |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4791 x_display_bar_cursor (f, on, x, y) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4792 struct frame *f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4793 int on; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4794 int x, y; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4795 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4796 struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4797 |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4798 /* This is pointless on invisible frames, and dangerous on garbaged |
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4799 frames; in the latter case, the frame may be in the midst of |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4800 changing its size, and x and y may be off the frame. */ |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4801 if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4802 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4803 |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4804 if (! on && ! f->phys_cursor_on) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4805 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4806 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4807 /* If there is anything wrong with the current cursor state, remove it. */ |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4808 if (f->phys_cursor_on |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4809 && (!on |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4810 || f->phys_cursor_x != x |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4811 || f->phys_cursor_y != y |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4812 || f->output_data.x->current_cursor != bar_cursor)) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4813 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4814 /* Erase the cursor by redrawing the character underneath it. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4815 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4816 f->phys_cursor_glyph, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4817 current_glyphs->highlight[f->phys_cursor_y]); |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4818 f->phys_cursor_on = 0; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4819 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4820 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4821 /* If we now need a cursor in the new place or in the new form, do it so. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4822 if (on |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4823 && (! f->phys_cursor_on |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4824 || (f->output_data.x->current_cursor != bar_cursor))) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4825 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4826 f->phys_cursor_glyph |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4827 = ((current_glyphs->enable[y] |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4828 && x < current_glyphs->used[y]) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4829 ? current_glyphs->glyphs[y][x] |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4830 : SPACEGLYPH); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4831 XFillRectangle (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:
12657
diff
changeset
|
4832 f->output_data.x->cursor_gc, |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4833 CHAR_TO_PIXEL_COL (f, x), |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4834 CHAR_TO_PIXEL_ROW (f, y), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4835 max (f->output_data.x->cursor_width, 1), |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4836 f->output_data.x->line_height); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4837 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4838 f->phys_cursor_x = x; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4839 f->phys_cursor_y = y; |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4840 f->phys_cursor_on = 1; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4841 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4842 f->output_data.x->current_cursor = bar_cursor; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4843 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4844 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4845 if (updating_frame != f) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4846 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4847 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4848 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4849 |
771 | 4850 /* Turn the displayed cursor of frame F on or off according to ON. |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4851 If ON is nonzero, where to put the cursor is specified by X and Y. */ |
286 | 4852 |
4853 static void | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4854 x_display_box_cursor (f, on, x, y) |
771 | 4855 struct frame *f; |
286 | 4856 int on; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4857 int x, y; |
286 | 4858 { |
771 | 4859 struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); |
4860 | |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4861 /* This is pointless on invisible frames, and dangerous on garbaged |
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4862 frames; in the latter case, the frame may be in the midst of |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4863 changing its size, and x and y may be off the frame. */ |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4864 if (! FRAME_VISIBLE_P (f) || FRAME_GARBAGED_P (f)) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4865 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4866 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4867 /* If cursor is off and we want it off, return quickly. */ |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4868 if (!on && ! f->phys_cursor_on) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4869 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4870 |
286 | 4871 /* If cursor is currently being shown and we don't want it to be |
4872 or it is in the wrong place, | |
4873 or we want a hollow box and it's not so, (pout!) | |
4874 erase it. */ | |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4875 if (f->phys_cursor_on |
286 | 4876 && (!on |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4877 || f->phys_cursor_x != x |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4878 || f->phys_cursor_y != y |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4879 || (f->output_data.x->current_cursor != hollow_box_cursor |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4880 && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) |
286 | 4881 { |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4882 int mouse_face_here = 0; |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4883 struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f); |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4884 |
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4885 /* If the cursor is in the mouse face area, redisplay that when |
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4886 we clear the cursor. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4887 if (f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4888 && |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4889 (f->phys_cursor_y > FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4890 || (f->phys_cursor_y == FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4891 && f->phys_cursor_x >= FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col)) |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4892 && |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4893 (f->phys_cursor_y < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4894 || (f->phys_cursor_y == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4895 && f->phys_cursor_x < FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col)) |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4896 /* Don't redraw the cursor's spot in mouse face |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4897 if it is at the end of a line (on a newline). |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4898 The cursor appears there, but mouse highlighting does not. */ |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
4899 && active_glyphs->used[f->phys_cursor_y] > f->phys_cursor_x) |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4900 mouse_face_here = 1; |
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4901 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4902 /* If the font is not as tall as a whole line, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4903 we must explicitly clear the line's whole height. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4904 if (FONT_HEIGHT (f->output_data.x->font) != f->output_data.x->line_height) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4905 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4906 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4907 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4908 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:
12657
diff
changeset
|
4909 f->output_data.x->line_height, False); |
286 | 4910 /* Erase the cursor by redrawing the character underneath it. */ |
771 | 4911 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, |
4912 f->phys_cursor_glyph, | |
7508
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4913 (mouse_face_here |
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4914 ? 3 |
a15923bc982d
(x_display_box_cursor): Preserve mouse highlight if the old cursor was in it.
Richard M. Stallman <rms@gnu.org>
parents:
7501
diff
changeset
|
4915 : current_glyphs->highlight[f->phys_cursor_y])); |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4916 f->phys_cursor_on = 0; |
286 | 4917 } |
4918 | |
4919 /* If we want to show a cursor, | |
4920 or we want a box cursor and it's not so, | |
4921 write it in the right place. */ | |
4922 if (on | |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4923 && (! f->phys_cursor_on |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4924 || (f->output_data.x->current_cursor != filled_box_cursor |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4925 && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) |
286 | 4926 { |
771 | 4927 f->phys_cursor_glyph |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4928 = ((current_glyphs->enable[y] |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4929 && x < current_glyphs->used[y]) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4930 ? current_glyphs->glyphs[y][x] |
429 | 4931 : SPACEGLYPH); |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4932 if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) |
286 | 4933 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4934 x_draw_box (f, x, y); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4935 f->output_data.x->current_cursor = hollow_box_cursor; |
286 | 4936 } |
4937 else | |
4938 { | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4939 x_draw_single_glyph (f, y, x, |
771 | 4940 f->phys_cursor_glyph, 2); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4941 f->output_data.x->current_cursor = filled_box_cursor; |
286 | 4942 } |
4943 | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4944 f->phys_cursor_x = x; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4945 f->phys_cursor_y = y; |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
4946 f->phys_cursor_on = 1; |
286 | 4947 } |
4948 | |
771 | 4949 if (updating_frame != f) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4950 XFlush (FRAME_X_DISPLAY (f)); |
286 | 4951 } |
4952 | |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4953 /* Display the cursor on frame F, or clear it, according to ON. |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4954 Also set the frame's cursor position to X and Y. */ |
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4955 |
21514 | 4956 void |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4957 x_display_cursor (f, on, x, y) |
771 | 4958 struct frame *f; |
286 | 4959 int on; |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4960 int x, y; |
286 | 4961 { |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4962 BLOCK_INPUT; |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4963 |
21764
9d02cc13f771
(x_display_cursor): Use FRAME_CURSOR_X_LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
21548
diff
changeset
|
4964 if ((unsigned) x >= FRAME_CURSOR_X_LIMIT (f) |
20488
fd12a2180159
(x_display_cursor): Abort if X or Y is out of range.
Richard M. Stallman <rms@gnu.org>
parents:
20364
diff
changeset
|
4965 || (unsigned) y >= FRAME_HEIGHT (f)) |
fd12a2180159
(x_display_cursor): Abort if X or Y is out of range.
Richard M. Stallman <rms@gnu.org>
parents:
20364
diff
changeset
|
4966 abort (); |
fd12a2180159
(x_display_cursor): Abort if X or Y is out of range.
Richard M. Stallman <rms@gnu.org>
parents:
20364
diff
changeset
|
4967 |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4968 if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4969 x_display_box_cursor (f, on, x, y); |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4970 else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
15990
1185f8fc0bfb
(do_line_dance, dumprectangle): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15973
diff
changeset
|
4971 x_display_bar_cursor (f, on, x, y); |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4972 else |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4973 /* Those are the only two we have implemented! */ |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4974 abort (); |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4975 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4976 UNBLOCK_INPUT; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4977 } |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4978 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4979 /* Display the cursor on frame F, or clear it, according to ON. |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4980 Don't change the cursor's position. */ |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4981 |
21514 | 4982 void |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4983 x_update_cursor (f, on) |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4984 struct frame *f; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4985 int on; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4986 { |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4987 BLOCK_INPUT; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4988 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4989 if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4990 x_display_box_cursor (f, on, f->phys_cursor_x, f->phys_cursor_y); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4991 else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4992 x_display_bar_cursor (f, on, f->phys_cursor_x, f->phys_cursor_y); |
286 | 4993 else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4994 /* Those are the only two we have implemented! */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4995 abort (); |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4996 |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4997 UNBLOCK_INPUT; |
286 | 4998 } |
4999 | |
5000 /* Icons. */ | |
5001 | |
771 | 5002 /* Refresh bitmap kitchen sink icon for frame F |
286 | 5003 when we get an expose event for it. */ |
5004 | |
21514 | 5005 void |
771 | 5006 refreshicon (f) |
5007 struct frame *f; | |
286 | 5008 { |
5009 /* Normally, the window manager handles this function. */ | |
5010 } | |
5011 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5012 /* Make the x-window of frame F use the gnu icon bitmap. */ |
286 | 5013 |
5014 int | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5015 x_bitmap_icon (f, file) |
771 | 5016 struct frame *f; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5017 Lisp_Object file; |
286 | 5018 { |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5019 int mask, bitmap_id; |
286 | 5020 Window icon_window; |
5021 | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5022 if (FRAME_X_WINDOW (f) == 0) |
286 | 5023 return 1; |
5024 | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5025 /* Free up our existing icon bitmap if any. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5026 if (f->output_data.x->icon_bitmap > 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5027 x_destroy_bitmap (f, f->output_data.x->icon_bitmap); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5028 f->output_data.x->icon_bitmap = 0; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5029 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5030 if (STRINGP (file)) |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5031 bitmap_id = x_create_bitmap_from_file (f, file); |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5032 else |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5033 { |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5034 /* Create the GNU bitmap if necessary. */ |
10755
e5f13cc95d02
(x_bitmap_icon): Fix test for unallocated icon bitmap.
Paul Reilly <pmr@pajato.com>
parents:
10743
diff
changeset
|
5035 if (FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id < 0) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5036 FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5037 = x_create_bitmap_from_data (f, gnu_bits, |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5038 gnu_width, gnu_height); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5039 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5040 /* The first time we create the GNU bitmap, |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5041 this increments the refcount one extra time. |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5042 As a result, the GNU bitmap is never freed. |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5043 That way, we don't have to worry about allocating it again. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5044 x_reference_bitmap (f, FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5045 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5046 bitmap_id = FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id; |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5047 } |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5048 |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5049 x_wm_set_icon_pixmap (f, bitmap_id); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5050 f->output_data.x->icon_bitmap = bitmap_id; |
286 | 5051 |
5052 return 0; | |
5053 } | |
5054 | |
5055 | |
12074
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5056 /* Make the x-window of frame F use a rectangle with text. |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5057 Use ICON_NAME as the text. */ |
286 | 5058 |
5059 int | |
771 | 5060 x_text_icon (f, icon_name) |
5061 struct frame *f; | |
286 | 5062 char *icon_name; |
5063 { | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5064 if (FRAME_X_WINDOW (f) == 0) |
286 | 5065 return 1; |
5066 | |
12074
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5067 #ifdef HAVE_X11R4 |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5068 { |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5069 XTextProperty text; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5070 text.value = (unsigned char *) icon_name; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5071 text.encoding = XA_STRING; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5072 text.format = 8; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5073 text.nitems = strlen (icon_name); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5074 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5075 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
12074
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5076 &text); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5077 #else /* not USE_X_TOOLKIT */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5078 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5079 #endif /* not USE_X_TOOLKIT */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5080 } |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5081 #else /* not HAVE_X11R4 */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5082 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), icon_name); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
5083 #endif /* not HAVE_X11R4 */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5084 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5085 if (f->output_data.x->icon_bitmap > 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5086 x_destroy_bitmap (f, f->output_data.x->icon_bitmap); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5087 f->output_data.x->icon_bitmap = 0; |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5088 x_wm_set_icon_pixmap (f, 0); |
286 | 5089 |
5090 return 0; | |
5091 } | |
5092 | |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5093 #define X_ERROR_MESSAGE_SIZE 200 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5094 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5095 /* If non-nil, this should be a string. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5096 It means catch X errors and store the error message in this string. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5097 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5098 static Lisp_Object x_error_message_string; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5099 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5100 /* An X error handler which stores the error message in |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5101 x_error_message_string. This is called from x_error_handler if |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5102 x_catch_errors is in effect. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5103 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5104 static int |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5105 x_error_catcher (display, error) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5106 Display *display; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5107 XErrorEvent *error; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5108 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5109 XGetErrorText (display, error->error_code, |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5110 XSTRING (x_error_message_string)->data, |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5111 X_ERROR_MESSAGE_SIZE); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5112 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5113 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5114 /* Begin trapping X errors for display DPY. Actually we trap X errors |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5115 for all displays, but DPY should be the display you are actually |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5116 operating on. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5117 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5118 After calling this function, X protocol errors no longer cause |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5119 Emacs to exit; instead, they are recorded in the string |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5120 stored in x_error_message_string. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5121 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5122 Calling x_check_errors signals an Emacs error if an X error has |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5123 occurred since the last call to x_catch_errors or x_check_errors. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5124 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5125 Calling x_uncatch_errors resumes the normal error handling. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5126 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5127 void x_check_errors (); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5128 static Lisp_Object x_catch_errors_unwind (); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5129 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5130 int |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5131 x_catch_errors (dpy) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5132 Display *dpy; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5133 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5134 int count = specpdl_ptr - specpdl; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5135 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5136 /* Make sure any errors from previous requests have been dealt with. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5137 XSync (dpy, False); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5138 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5139 record_unwind_protect (x_catch_errors_unwind, x_error_message_string); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5140 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5141 x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5142 XSTRING (x_error_message_string)->data[0] = 0; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5143 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5144 return count; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5145 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5146 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5147 /* Unbind the binding that we made to check for X errors. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5148 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5149 static Lisp_Object |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5150 x_catch_errors_unwind (old_val) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5151 Lisp_Object old_val; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5152 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5153 x_error_message_string = old_val; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5154 return Qnil; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5155 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5156 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5157 /* If any X protocol errors have arrived since the last call to |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5158 x_catch_errors or x_check_errors, signal an Emacs error using |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5159 sprintf (a buffer, FORMAT, the x error message text) as the text. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5160 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5161 void |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5162 x_check_errors (dpy, format) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5163 Display *dpy; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5164 char *format; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5165 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5166 /* Make sure to catch any errors incurred so far. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5167 XSync (dpy, False); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5168 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5169 if (XSTRING (x_error_message_string)->data[0]) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5170 error (format, XSTRING (x_error_message_string)->data); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5171 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5172 |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5173 /* Nonzero if we had any X protocol errors |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5174 since we did x_catch_errors on DPY. */ |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5175 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5176 int |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5177 x_had_errors_p (dpy) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5178 Display *dpy; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5179 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5180 /* Make sure to catch any errors incurred so far. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5181 XSync (dpy, False); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5182 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5183 return XSTRING (x_error_message_string)->data[0] != 0; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5184 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5185 |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5186 /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5187 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5188 int |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5189 x_clear_errors (dpy) |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5190 Display *dpy; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5191 { |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5192 XSTRING (x_error_message_string)->data[0] = 0; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5193 } |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5194 |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5195 /* Stop catching X protocol errors and let them make Emacs die. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5196 DPY should be the display that was passed to x_catch_errors. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5197 COUNT should be the value that was returned by |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5198 the corresponding call to x_catch_errors. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5199 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5200 void |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5201 x_uncatch_errors (dpy, count) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5202 Display *dpy; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5203 int count; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5204 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5205 unbind_to (count, Qnil); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5206 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5207 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5208 #if 0 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5209 static unsigned int x_wire_count; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5210 x_trace_wire () |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5211 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5212 fprintf (stderr, "Lib call: %d\n", ++x_wire_count); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5213 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5214 #endif /* ! 0 */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5215 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5216 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5217 /* Handle SIGPIPE, which can happen when the connection to a server |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5218 simply goes away. SIGPIPE is handled by x_connection_signal. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5219 Don't need to do anything, because the write which caused the |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5220 SIGPIPE will fail, causing Xlib to invoke the X IO error handler, |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5221 which will do the appropriate cleanup for us. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5222 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5223 static SIGTYPE |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5224 x_connection_signal (signalnum) /* If we don't have an argument, */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5225 int signalnum; /* some compilers complain in signal calls. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5226 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5227 #ifdef USG |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5228 /* USG systems forget handlers when they are used; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5229 must reestablish each time */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5230 signal (signalnum, x_connection_signal); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5231 #endif /* USG */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5232 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5233 |
621 | 5234 /* Handling X errors. */ |
5235 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5236 /* Handle the loss of connection to display DISPLAY. */ |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5237 |
621 | 5238 static SIGTYPE |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5239 x_connection_closed (display, error_message) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5240 Display *display; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5241 char *error_message; |
621 | 5242 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5243 struct x_display_info *dpyinfo = x_display_info_for_display (display); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5244 Lisp_Object frame, tail; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5245 |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
5246 /* Indicate that this display is dead. */ |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
5247 |
17825
281d99590839
(dumpglyphs): Draw glyphs one by one if the font for
Kenichi Handa <handa@m17n.org>
parents:
17720
diff
changeset
|
5248 #ifdef USE_X_TOOLKIT |
16179
7f8ce4d3e955
(x_connection_closed): Call XtCloseDisplay.
Richard M. Stallman <rms@gnu.org>
parents:
16104
diff
changeset
|
5249 XtCloseDisplay (display); |
17825
281d99590839
(dumpglyphs): Draw glyphs one by one if the font for
Kenichi Handa <handa@m17n.org>
parents:
17720
diff
changeset
|
5250 #endif |
16179
7f8ce4d3e955
(x_connection_closed): Call XtCloseDisplay.
Richard M. Stallman <rms@gnu.org>
parents:
16104
diff
changeset
|
5251 |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
5252 dpyinfo->display = 0; |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
5253 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5254 /* First delete frames whose minibuffers are on frames |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5255 that are on the dead display. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5256 FOR_EACH_FRAME (tail, frame) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5257 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5258 Lisp_Object minibuf_frame; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5259 minibuf_frame |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5260 = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame)))); |
10921
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5261 if (FRAME_X_P (XFRAME (frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5262 && FRAME_X_P (XFRAME (minibuf_frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5263 && ! EQ (frame, minibuf_frame) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5264 && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5265 Fdelete_frame (frame, Qt); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5266 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5267 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5268 /* Now delete all remaining frames on the dead display. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5269 We are now sure none of these is used as the minibuffer |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5270 for another frame that we need to delete. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5271 FOR_EACH_FRAME (tail, frame) |
10921
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5272 if (FRAME_X_P (XFRAME (frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
5273 && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) |
11904
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5274 { |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5275 /* Set this to t so that Fdelete_frame won't get confused |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5276 trying to find a replacement. */ |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5277 FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt; |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5278 Fdelete_frame (frame, Qt); |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
5279 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5280 |
13727
9eb09adbcb38
(x_connection_closed): Don't delete dpyinfo if it's null.
Karl Heuer <kwzh@gnu.org>
parents:
13633
diff
changeset
|
5281 if (dpyinfo) |
9eb09adbcb38
(x_connection_closed): Don't delete dpyinfo if it's null.
Karl Heuer <kwzh@gnu.org>
parents:
13633
diff
changeset
|
5282 x_delete_display (dpyinfo); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5283 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5284 if (x_display_list == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5285 { |
15515
69257ac25af4
(x_connection_closed): Add newline when printing error message on stderr.
Richard M. Stallman <rms@gnu.org>
parents:
15514
diff
changeset
|
5286 fprintf (stderr, "%s\n", error_message); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5287 shut_down_emacs (0, 0, Qnil); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5288 exit (70); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5289 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5290 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5291 /* Ordinary stack unwind doesn't deal with these. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5292 #ifdef SIGIO |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5293 sigunblock (sigmask (SIGIO)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5294 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5295 sigunblock (sigmask (SIGALRM)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5296 TOTALLY_UNBLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5297 |
15526
926ef4afc174
(x_connection_closed): Call clear_waiting_for_input.
Richard M. Stallman <rms@gnu.org>
parents:
15521
diff
changeset
|
5298 clear_waiting_for_input (); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5299 error ("%s", error_message); |
621 | 5300 } |
5301 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5302 /* This is the usual handler for X protocol errors. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5303 It kills all frames on the display that we got the error for. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5304 If that was the only one, it prints an error message and kills Emacs. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5305 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5306 static int |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5307 x_error_quitter (display, error) |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5308 Display *display; |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5309 XErrorEvent *error; |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5310 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5311 char buf[256], buf1[356]; |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5312 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5313 /* Note that there is no real way portable across R3/R4 to get the |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5314 original error handler. */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5315 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5316 XGetErrorText (display, error->error_code, buf, sizeof (buf)); |
15521
2b61a33a4576
(x_error_quitter): Delete newline from sprintf string.
Richard M. Stallman <rms@gnu.org>
parents:
15519
diff
changeset
|
5317 sprintf (buf1, "X protocol error: %s on protocol request %d", |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5318 buf, error->request_code); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5319 x_connection_closed (display, buf1); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5320 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5321 |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5322 /* This is the first-level handler for X protocol errors. |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5323 It calls x_error_quitter or x_error_catcher. */ |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5324 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5325 static int |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5326 x_error_handler (display, error) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5327 Display *display; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5328 XErrorEvent *error; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5329 { |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5330 char buf[256], buf1[356]; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5331 |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5332 if (! NILP (x_error_message_string)) |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5333 x_error_catcher (display, error); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5334 else |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5335 x_error_quitter (display, error); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5336 } |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
5337 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5338 /* This is the handler for X IO errors, always. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5339 It kills all frames on the display that we lost touch with. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5340 If that was the only one, it prints an error message and kills Emacs. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5341 |
1875
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5342 static int |
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5343 x_io_error_quitter (display) |
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5344 Display *display; |
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5345 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5346 char buf[256]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5347 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5348 sprintf (buf, "Connection lost to X server `%s'", DisplayString (display)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5349 x_connection_closed (display, buf); |
1875
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5350 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5351 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5352 /* Changing the font of the frame. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5353 |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
5354 /* Give frame F the font named FONTNAME as its default font, and |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
5355 return the full name of that font. FONTNAME may be a wildcard |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
5356 pattern; in that case, we choose some font that fits the pattern. |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
5357 The return value shows which font we chose. */ |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
5358 |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
5359 Lisp_Object |
771 | 5360 x_new_font (f, fontname) |
5361 struct frame *f; | |
286 | 5362 register char *fontname; |
5363 { | |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5364 struct font_info *fontp |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5365 = fs_load_font (f, FRAME_X_FONT_TABLE (f), CHARSET_ASCII, fontname, -1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5366 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5367 if (!fontp) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5368 return Qnil; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5369 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5370 f->output_data.x->font = (XFontStruct *) (fontp->font); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5371 f->output_data.x->font_baseline |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5372 = (f->output_data.x->font->ascent + fontp->baseline_offset); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5373 f->output_data.x->fontset = -1; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5374 |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5375 /* Compute the scroll bar width in character columns. */ |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5376 if (f->scroll_bar_pixel_width > 0) |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5377 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5378 int wid = FONT_WIDTH (f->output_data.x->font); |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5379 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5380 } |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5381 else |
19027
1171ca6f0281
(x_new_font): Follow the change in x_set_scroll_bar_width and make the
Richard M. Stallman <rms@gnu.org>
parents:
19021
diff
changeset
|
5382 { |
1171ca6f0281
(x_new_font): Follow the change in x_set_scroll_bar_width and make the
Richard M. Stallman <rms@gnu.org>
parents:
19021
diff
changeset
|
5383 int wid = FONT_WIDTH (f->output_data.x->font); |
1171ca6f0281
(x_new_font): Follow the change in x_set_scroll_bar_width and make the
Richard M. Stallman <rms@gnu.org>
parents:
19021
diff
changeset
|
5384 f->scroll_bar_cols = (14 + wid - 1) / wid; |
1171ca6f0281
(x_new_font): Follow the change in x_set_scroll_bar_width and make the
Richard M. Stallman <rms@gnu.org>
parents:
19021
diff
changeset
|
5385 } |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5386 |
771 | 5387 /* Now make the frame display the given font. */ |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5388 if (FRAME_X_WINDOW (f) != 0) |
286 | 5389 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5390 XSetFont (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:
12657
diff
changeset
|
5391 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:
12657
diff
changeset
|
5392 XSetFont (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:
12657
diff
changeset
|
5393 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:
12657
diff
changeset
|
5394 XSetFont (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:
12657
diff
changeset
|
5395 f->output_data.x->font->fid); |
771 | 5396 |
6767
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
5397 frame_update_line_height (f); |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5398 x_set_window_size (f, 0, f->width, f->height); |
286 | 5399 } |
6767
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
5400 else |
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
5401 /* If we are setting a new frame's font for the first time, |
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
5402 there are no faces yet, so this font's height is the line height. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5403 f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font); |
286 | 5404 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5405 return build_string (fontp->full_name); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5406 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5407 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5408 /* Give frame F the fontset named FONTSETNAME as its default font, and |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5409 return the full name of that fontset. FONTSETNAME may be a wildcard |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
5410 pattern; in that case, we choose some fontset that fits the pattern. |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
5411 The return value shows which fontset we chose. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5412 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5413 Lisp_Object |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5414 x_new_fontset (f, fontsetname) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5415 struct frame *f; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5416 char *fontsetname; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5417 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5418 int fontset = fs_query_fontset (f, fontsetname); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5419 struct fontset_info *fontsetp; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5420 Lisp_Object result; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5421 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5422 if (fontset < 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5423 return Qnil; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5424 |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5425 if (f->output_data.x->fontset == fontset) |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5426 /* This fontset is already set in frame F. There's nothing more |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5427 to do. */ |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5428 return build_string (fontsetname); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5429 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5430 fontsetp = FRAME_FONTSET_DATA (f)->fontset_table[fontset]; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5431 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5432 if (!fontsetp->fontname[CHARSET_ASCII]) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5433 /* This fontset doesn't contain ASCII font. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5434 return Qnil; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5435 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5436 result = x_new_font (f, fontsetp->fontname[CHARSET_ASCII]); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5437 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5438 if (!STRINGP (result)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5439 /* Can't load ASCII font. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5440 return Qnil; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5441 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5442 /* Since x_new_font doesn't update any fontset information, do it now. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5443 f->output_data.x->fontset = fontset; |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
5444 FS_LOAD_FONT (f, FRAME_X_FONT_TABLE (f), |
24223
c7888c86b9e1
(x_new_fontset): For ASCII font, don't use the font name
Kenichi Handa <handa@m17n.org>
parents:
24164
diff
changeset
|
5445 CHARSET_ASCII, fontsetp->fontname[CHARSET_ASCII], fontset); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5446 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
5447 return build_string (fontsetname); |
286 | 5448 } |
5449 | |
14826
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5450 /* Calculate the absolute position in frame F |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5451 from its current recorded position values and gravity. */ |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5452 |
21514 | 5453 void |
7264
a701bffa0f9d
(x_calc_absolute_position): Use size_hint_flags.
Richard M. Stallman <rms@gnu.org>
parents:
7262
diff
changeset
|
5454 x_calc_absolute_position (f) |
771 | 5455 struct frame *f; |
286 | 5456 { |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5457 Window win, child; |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5458 int win_x = 0, win_y = 0; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5459 int flags = f->output_data.x->size_hint_flags; |
11896
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5460 int this_window; |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5461 |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5462 /* We have nothing to do if the current position |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5463 is already for the top-left corner. */ |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5464 if (! ((flags & XNegative) || (flags & YNegative))) |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5465 return; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5466 |
11896
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5467 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5468 this_window = XtWindow (f->output_data.x->widget); |
11896
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5469 #else |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5470 this_window = FRAME_X_WINDOW (f); |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
5471 #endif |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5472 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5473 /* Find the position of the outside upper-left corner of |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5474 the inner window, with respect to the outer window. |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5475 But do this only if we will need the results. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5476 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5477 { |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5478 int count; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5479 |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5480 BLOCK_INPUT; |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5481 count = x_catch_errors (FRAME_X_DISPLAY (f)); |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5482 while (1) |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5483 { |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5484 x_clear_errors (FRAME_X_DISPLAY (f)); |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5485 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5486 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5487 /* From-window, to-window. */ |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5488 this_window, |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5489 f->output_data.x->parent_desc, |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5490 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5491 /* From-position, to-position. */ |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5492 0, 0, &win_x, &win_y, |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5493 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5494 /* Child of win. */ |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5495 &child); |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5496 if (x_had_errors_p (FRAME_X_DISPLAY (f))) |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5497 { |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5498 Window newroot, newparent = 0xdeadbeef; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5499 Window *newchildren; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5500 int nchildren; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5501 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5502 if (! XQueryTree (FRAME_X_DISPLAY (f), this_window, &newroot, |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5503 &newparent, &newchildren, &nchildren)) |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5504 break; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5505 |
23107
44eda932afcf
(x_calc_absolute_position): Cast argument to XFree, in
Karl Heuer <kwzh@gnu.org>
parents:
23095
diff
changeset
|
5506 XFree ((char *) newchildren); |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5507 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5508 f->output_data.x->parent_desc = newparent; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5509 } |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5510 else |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5511 break; |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5512 } |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5513 |
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5514 x_uncatch_errors (FRAME_X_DISPLAY (f), count); |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5515 UNBLOCK_INPUT; |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5516 } |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5517 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5518 /* Treat negative positions as relative to the leftmost bottommost |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
5519 position that fits on the screen. */ |
7262
68fc80bf10df
(x_wm_set_size_hint): Don't try to handle negative positions.
Richard M. Stallman <rms@gnu.org>
parents:
7210
diff
changeset
|
5520 if (flags & XNegative) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5521 f->output_data.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width |
14826
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5522 - 2 * f->output_data.x->border_width - win_x |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5523 - PIXEL_WIDTH (f) |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5524 + f->output_data.x->left_pos); |
771 | 5525 |
7262
68fc80bf10df
(x_wm_set_size_hint): Don't try to handle negative positions.
Richard M. Stallman <rms@gnu.org>
parents:
7210
diff
changeset
|
5526 if (flags & YNegative) |
14801
8bf3083f6499
(x_calc_absolute_position): Don't explicitly subtract
Richard M. Stallman <rms@gnu.org>
parents:
14772
diff
changeset
|
5527 /* We used to subtract f->output_data.x->menubar_height here |
8bf3083f6499
(x_calc_absolute_position): Don't explicitly subtract
Richard M. Stallman <rms@gnu.org>
parents:
14772
diff
changeset
|
5528 in the toolkit case, but PIXEL_HEIGHT already includes that. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5529 f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height |
14826
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5530 - 2 * f->output_data.x->border_width - win_y |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5531 - PIXEL_HEIGHT (f) |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5532 + f->output_data.x->top_pos); |
eec0abb31126
Comment/whitespace change.
Richard M. Stallman <rms@gnu.org>
parents:
14801
diff
changeset
|
5533 |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5534 /* The left_pos and top_pos |
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5535 are now relative to the top and left screen edges, |
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5536 so the flags should correspond. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5537 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
286 | 5538 } |
5539 | |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5540 /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, |
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5541 to really change the position, and 0 when calling from |
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5542 x_make_frame_visible (in that case, XOFF and YOFF are the current |
11988
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5543 position values). It is -1 when calling from x_set_frame_parameters, |
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5544 which means, do adjust for borders but don't change the gravity. */ |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5545 |
21514 | 5546 void |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
5547 x_set_offset (f, xoff, yoff, change_gravity) |
771 | 5548 struct frame *f; |
286 | 5549 register int xoff, yoff; |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
5550 int change_gravity; |
286 | 5551 { |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5552 int modified_top, modified_left; |
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5553 |
11988
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5554 if (change_gravity > 0) |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5555 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5556 f->output_data.x->top_pos = yoff; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5557 f->output_data.x->left_pos = xoff; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5558 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5559 if (xoff < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5560 f->output_data.x->size_hint_flags |= XNegative; |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5561 if (yoff < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5562 f->output_data.x->size_hint_flags |= YNegative; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5563 f->output_data.x->win_gravity = NorthWestGravity; |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5564 } |
7264
a701bffa0f9d
(x_calc_absolute_position): Use size_hint_flags.
Richard M. Stallman <rms@gnu.org>
parents:
7262
diff
changeset
|
5565 x_calc_absolute_position (f); |
286 | 5566 |
5567 BLOCK_INPUT; | |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
5568 x_wm_set_size_hint (f, (long) 0, 0); |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5569 |
17519
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
5570 modified_left = f->output_data.x->left_pos; |
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
5571 modified_top = f->output_data.x->top_pos; |
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
5572 #if 0 /* Running on psilocin (Debian), and displaying on the NCD X-terminal, |
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
5573 this seems to be unnecessary and incorrect. rms, 4/17/97. */ |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5574 /* It is a mystery why we need to add the border_width here |
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5575 when the frame is already visible, but experiment says we do. */ |
11988
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5576 if (change_gravity != 0) |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5577 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5578 modified_left += 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:
12657
diff
changeset
|
5579 modified_top += f->output_data.x->border_width; |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5580 } |
17519
5aa7011aa3d5
(x_set_offset): Turn off the code that added the border_width
Richard M. Stallman <rms@gnu.org>
parents:
17371
diff
changeset
|
5581 #endif |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5582 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5583 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5584 XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5585 modified_left, modified_top); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5586 #else /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5587 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5588 modified_left, modified_top); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5589 #endif /* not USE_X_TOOLKIT */ |
286 | 5590 UNBLOCK_INPUT; |
5591 } | |
5592 | |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5593 /* Call this to change the size of frame F's x-window. |
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5594 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity |
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5595 for this size change and subsequent size changes. |
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5596 Otherwise we leave the window gravity unchanged. */ |
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5597 |
21514 | 5598 void |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5599 x_set_window_size (f, change_gravity, cols, rows) |
771 | 5600 struct frame *f; |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5601 int change_gravity; |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5602 int cols, rows; |
286 | 5603 { |
5604 int pixelwidth, pixelheight; | |
5605 int mask; | |
14692
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5606 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5607 |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5608 BLOCK_INPUT; |
286 | 5609 |
5686
0c351de98a26
(x_set_window_size): Add USE_X_TOOLKIT conditional. Call EmacsFrameSetCharSize and return.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5685
diff
changeset
|
5610 #ifdef USE_X_TOOLKIT |
7415
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5611 { |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5612 /* The x and y position of the widget is clobbered by the |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5613 call to XtSetValues within EmacsFrameSetCharSize. |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5614 This is a real kludge, but I don't understand Xt so I can't |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5615 figure out a correct fix. Can anyone else tell me? -- rms. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5616 int xpos = f->output_data.x->widget->core.x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5617 int ypos = f->output_data.x->widget->core.y; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5618 EmacsFrameSetCharSize (f->output_data.x->edit_widget, cols, rows); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5619 f->output_data.x->widget->core.x = xpos; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5620 f->output_data.x->widget->core.y = ypos; |
7415
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5621 } |
5686
0c351de98a26
(x_set_window_size): Add USE_X_TOOLKIT conditional. Call EmacsFrameSetCharSize and return.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5685
diff
changeset
|
5622 |
0c351de98a26
(x_set_window_size): Add USE_X_TOOLKIT conditional. Call EmacsFrameSetCharSize and return.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5685
diff
changeset
|
5623 #else /* not USE_X_TOOLKIT */ |
0c351de98a26
(x_set_window_size): Add USE_X_TOOLKIT conditional. Call EmacsFrameSetCharSize and return.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5685
diff
changeset
|
5624 |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5625 check_frame_size (f, &rows, &cols); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5626 f->output_data.x->vertical_scroll_bar_extra |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5627 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5628 ? 0 |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5629 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
8941
71762e6d69e0
* xterm.c (x_new_font): Compute number of scrollbar columns.
Karl Heuer <kwzh@gnu.org>
parents:
8848
diff
changeset
|
5630 ? 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:
12657
diff
changeset
|
5631 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5632 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5633 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
286 | 5634 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5635 f->output_data.x->win_gravity = NorthWestGravity; |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
5636 x_wm_set_size_hint (f, (long) 0, 0); |
8781
98741404d3e0
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8724
diff
changeset
|
5637 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5638 XSync (FRAME_X_DISPLAY (f), False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5639 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5640 pixelwidth, pixelheight); |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5641 |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5642 /* Now, strictly speaking, we can't be sure that this is accurate, |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5643 but the window manager will get around to dealing with the size |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5644 change request eventually, and we'll hear how it went when the |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5645 ConfigureNotify event gets here. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5646 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5647 We could just not bother storing any of this information here, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5648 and let the ConfigureNotify event set everything up, but that |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5649 might be kind of confusing to the lisp code, since size changes |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5650 wouldn't be reported in the frame parameters until some random |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5651 point in the future when the ConfigureNotify event arrives. */ |
1875
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
5652 change_frame_size (f, rows, cols, 0, 0); |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5653 PIXEL_WIDTH (f) = pixelwidth; |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5654 PIXEL_HEIGHT (f) = pixelheight; |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5655 |
14692
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5656 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5657 receive in the ConfigureNotify event; if we get what we asked |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5658 for, then the event won't cause the screen to become garbaged, so |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5659 we have to make sure to do it here. */ |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5660 SET_FRAME_GARBAGED (f); |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5661 |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5662 XFlush (FRAME_X_DISPLAY (f)); |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5663 |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5664 #endif /* not USE_X_TOOLKIT */ |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5665 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5666 /* If cursor was outside the new size, mark it as off. */ |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5667 if (f->phys_cursor_y >= rows |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5668 || f->phys_cursor_x >= cols) |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5669 { |
16430
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
5670 f->phys_cursor_x = 0; |
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
5671 f->phys_cursor_y = 0; |
3d5ea4cec437
(XTwrite_glyphs, XTclear_end_of_line, XTclear_frame)
Richard M. Stallman <rms@gnu.org>
parents:
16365
diff
changeset
|
5672 f->phys_cursor_on = 0; |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5673 } |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5674 |
14692
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5675 /* Clear out any recollection of where the mouse highlighting was, |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5676 since it might be in a place that's outside the new frame size. |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5677 Actually checking whether it is outside is a pain in the neck, |
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5678 so don't try--just let the highlighting be done afresh with new size. */ |
16491
7094452bc337
(cancel_mouse_face): New function. Code copied from
Richard M. Stallman <rms@gnu.org>
parents:
16483
diff
changeset
|
5679 cancel_mouse_face (f); |
14692
e93656946a8c
(x_set_window_size): Clear out the mouse-highlighting data
Richard M. Stallman <rms@gnu.org>
parents:
14557
diff
changeset
|
5680 |
286 | 5681 UNBLOCK_INPUT; |
5682 } | |
5683 | |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5684 /* Mouse warping. */ |
286 | 5685 |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5686 void |
771 | 5687 x_set_mouse_position (f, x, y) |
5688 struct frame *f; | |
286 | 5689 int x, y; |
5690 { | |
5691 int pix_x, pix_y; | |
5692 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5693 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.x->font) / 2; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5694 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.x->line_height / 2; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5695 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5696 if (pix_x < 0) pix_x = 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5697 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5698 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5699 if (pix_y < 0) pix_y = 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5700 if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f); |
286 | 5701 |
5702 BLOCK_INPUT; | |
5703 | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5704 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5705 0, 0, 0, 0, pix_x, pix_y); |
286 | 5706 UNBLOCK_INPUT; |
5707 } | |
5708 | |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5709 /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5710 |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5711 void |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5712 x_set_mouse_pixel_position (f, pix_x, pix_y) |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5713 struct frame *f; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5714 int pix_x, pix_y; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5715 { |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5716 BLOCK_INPUT; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5717 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5718 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5719 0, 0, 0, 0, pix_x, pix_y); |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5720 UNBLOCK_INPUT; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5721 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5722 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5723 /* focus shifting, raising and lowering. */ |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5724 |
21514 | 5725 void |
771 | 5726 x_focus_on_frame (f) |
5727 struct frame *f; | |
286 | 5728 { |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
5729 #if 0 /* This proves to be unpleasant. */ |
771 | 5730 x_raise_frame (f); |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
5731 #endif |
369 | 5732 #if 0 |
5733 /* I don't think that the ICCCM allows programs to do things like this | |
5734 without the interaction of the window manager. Whatever you end up | |
771 | 5735 doing with this code, do it to x_unfocus_frame too. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5736 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
286 | 5737 RevertToPointerRoot, CurrentTime); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5738 #endif /* ! 0 */ |
286 | 5739 } |
5740 | |
21514 | 5741 void |
771 | 5742 x_unfocus_frame (f) |
5743 struct frame *f; | |
286 | 5744 { |
369 | 5745 #if 0 |
771 | 5746 /* Look at the remarks in x_focus_on_frame. */ |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
5747 if (FRAME_X_DISPLAY_INFO (f)->x_focus_frame == f) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5748 XSetInputFocus (FRAME_X_DISPLAY (f), PointerRoot, |
286 | 5749 RevertToPointerRoot, CurrentTime); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5750 #endif /* ! 0 */ |
286 | 5751 } |
5752 | |
771 | 5753 /* Raise frame F. */ |
5754 | |
21514 | 5755 void |
771 | 5756 x_raise_frame (f) |
5757 struct frame *f; | |
286 | 5758 { |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5759 if (f->async_visible) |
286 | 5760 { |
5761 BLOCK_INPUT; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5762 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5763 XRaiseWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget)); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5764 #else /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5765 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5766 #endif /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5767 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5768 UNBLOCK_INPUT; |
5769 } | |
5770 } | |
5771 | |
771 | 5772 /* Lower frame F. */ |
5773 | |
21514 | 5774 void |
771 | 5775 x_lower_frame (f) |
5776 struct frame *f; | |
286 | 5777 { |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5778 if (f->async_visible) |
286 | 5779 { |
5780 BLOCK_INPUT; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5781 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5782 XLowerWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget)); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5783 #else /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5784 XLowerWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5785 #endif /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5786 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5787 UNBLOCK_INPUT; |
5788 } | |
5789 } | |
5790 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5791 static void |
14411
bac274f178b0
(XTframe_raise_lower): Rename arg `raise' to `raise_flag'.
Richard M. Stallman <rms@gnu.org>
parents:
14305
diff
changeset
|
5792 XTframe_raise_lower (f, raise_flag) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5793 FRAME_PTR f; |
14411
bac274f178b0
(XTframe_raise_lower): Rename arg `raise' to `raise_flag'.
Richard M. Stallman <rms@gnu.org>
parents:
14305
diff
changeset
|
5794 int raise_flag; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5795 { |
14411
bac274f178b0
(XTframe_raise_lower): Rename arg `raise' to `raise_flag'.
Richard M. Stallman <rms@gnu.org>
parents:
14305
diff
changeset
|
5796 if (raise_flag) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5797 x_raise_frame (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5798 else |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5799 x_lower_frame (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5800 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5801 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5802 /* Change of visibility. */ |
286 | 5803 |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5804 /* This tries to wait until the frame is really visible. |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5805 However, if the window manager asks the user where to position |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5806 the frame, this will return before the user finishes doing that. |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5807 The frame will not actually be visible at that time, |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5808 but it will become visible later when the window manager |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5809 finishes with it. */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5810 |
21514 | 5811 void |
771 | 5812 x_make_frame_visible (f) |
5813 struct frame *f; | |
286 | 5814 { |
5815 int mask; | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5816 Lisp_Object type; |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5817 int starting_flags = f->output_data.x->size_hint_flags; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5818 int original_top, original_left; |
286 | 5819 |
429 | 5820 BLOCK_INPUT; |
5821 | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5822 type = x_icon_type (f); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5823 if (!NILP (type)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5824 x_bitmap_icon (f, type); |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5825 |
771 | 5826 if (! FRAME_VISIBLE_P (f)) |
286 | 5827 { |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5828 /* We test FRAME_GARBAGED_P here to make sure we don't |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5829 call x_set_offset a second time |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5830 if we get to x_make_frame_visible a second time |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5831 before the window gets really visible. */ |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5832 if (! FRAME_ICONIFIED_P (f) |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5833 && ! f->output_data.x->asked_for_visible) |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5834 x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5835 |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5836 f->output_data.x->asked_for_visible = 1; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5837 |
429 | 5838 if (! EQ (Vx_no_window_manager, Qt)) |
771 | 5839 x_wm_set_window_state (f, NormalState); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5840 #ifdef USE_X_TOOLKIT |
7167
2fa74c48e4e5
(x_make_frame_visible): Use XtMapWidget, not XtPopup.
Richard M. Stallman <rms@gnu.org>
parents:
7128
diff
changeset
|
5841 /* This was XtPopup, but that did nothing for an iconified frame. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5842 XtMapWidget (f->output_data.x->widget); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5843 #else /* not USE_X_TOOLKIT */ |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5844 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5845 #endif /* not USE_X_TOOLKIT */ |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5846 #if 0 /* This seems to bring back scroll bars in the wrong places |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5847 if the window configuration has changed. They seem |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5848 to come back ok without this. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
5849 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5850 XMapSubwindows (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5851 #endif |
429 | 5852 } |
286 | 5853 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5854 XFlush (FRAME_X_DISPLAY (f)); |
429 | 5855 |
7959
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5856 /* Synchronize to ensure Emacs knows the frame is visible |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5857 before we do anything else. We do this loop with input not blocked |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5858 so that incoming events are handled. */ |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5859 { |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5860 Lisp_Object frame; |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5861 int count = input_signal_count; |
18528
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5862 /* This must be before UNBLOCK_INPUT |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5863 since events that arrive in response to the actions above |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5864 will set it when they are handled. */ |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5865 int previously_visible = f->output_data.x->has_been_visible; |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5866 |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5867 original_left = f->output_data.x->left_pos; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5868 original_top = f->output_data.x->top_pos; |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5869 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5870 /* This must come after we set COUNT. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5871 UNBLOCK_INPUT; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5872 |
22907
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5873 /* We unblock here so that arriving X events are processed. */ |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5874 |
18008
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
5875 /* Now move the window back to where it was "supposed to be". |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
5876 But don't do it if the gravity is negative. |
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
5877 When the gravity is negative, this uses a position |
18528
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5878 that is 3 pixels too low. Perhaps that's really the border width. |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5879 |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5880 Don't do this if the window has never been visible before, |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5881 because the window manager may choose the position |
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5882 and we don't want to override it. */ |
18008
d25d2472df51
(XTread_socket) <ConfigureNotify>: Don't call
Richard M. Stallman <rms@gnu.org>
parents:
17963
diff
changeset
|
5883 |
18630
3e414b9da546
(x_make_frame_visible): Don't move the frame
Richard M. Stallman <rms@gnu.org>
parents:
18528
diff
changeset
|
5884 if (! FRAME_VISIBLE_P (f) && ! FRAME_ICONIFIED_P (f) |
18074
06e42aa4c208
(process_expose_from_menu, XTread_socket):
Richard M. Stallman <rms@gnu.org>
parents:
18057
diff
changeset
|
5885 && f->output_data.x->win_gravity == NorthWestGravity |
18528
73f4d9258f04
(x_make_frame_visible): Check has_been_visible
Richard M. Stallman <rms@gnu.org>
parents:
18347
diff
changeset
|
5886 && previously_visible) |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5887 { |
22907
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5888 Drawable rootw; |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5889 int x, y; |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5890 unsigned int width, height, border, depth; |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5891 |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5892 BLOCK_INPUT; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5893 |
22907
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5894 /* On some window managers (Such as FVWM) moving an existing window, |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5895 even to the same place, causes the window manager to introduce |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5896 an offset. This can cause the window to move to an unexpected |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5897 location. Check the geometry (A little slow here) and then verify |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5898 that the window is in the right place. If the window is not in |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5899 the right place, move it there, and take the potential window |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5900 manager hit. */ |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5901 |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5902 XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5903 &rootw, &x, &y, &width, &height, &border, &depth); |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5904 |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5905 if (original_left != x || original_top != y) |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5906 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5907 original_left, original_top); |
43e290c6fb19
(x_list_fonts): Call XFreeFont after the new call to XLoadQueryFont.
Richard M. Stallman <rms@gnu.org>
parents:
22773
diff
changeset
|
5908 |
17963
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5909 UNBLOCK_INPUT; |
b77c13e71ba3
(XTread_socket) <UnmapNotify>: Don't make an inconify_event
Richard M. Stallman <rms@gnu.org>
parents:
17953
diff
changeset
|
5910 } |
17953
96a51be54a7e
(x_make_frame_visible): Call x_set_offset only after
Richard M. Stallman <rms@gnu.org>
parents:
17877
diff
changeset
|
5911 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
5912 XSETFRAME (frame, f); |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5913 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5914 while (1) |
8098
e44c31d682b1
(x_draw_box): Use curs_x and curs_y, not f->cursor_[xy].
Richard M. Stallman <rms@gnu.org>
parents:
8036
diff
changeset
|
5915 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5916 x_sync (f); |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5917 /* Once we have handled input events, |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5918 we should have received the MapNotify if one is coming. |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5919 So if we have not got it yet, stop looping. |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5920 Some window managers make their own decisions |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5921 about visibility. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5922 if (input_signal_count != count) |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5923 break; |
8609
145a583d9128
(x_make_frame_visible): Raise a signal to cause the pending X I/O to be read.
Karl Heuer <kwzh@gnu.org>
parents:
8567
diff
changeset
|
5924 /* Machines that do polling rather than SIGIO have been observed |
8634
187df0aff719
(x_make_frame_visible): Call signal handler directly.
Karl Heuer <kwzh@gnu.org>
parents:
8609
diff
changeset
|
5925 to go into a busy-wait here. So we'll fake an alarm signal |
187df0aff719
(x_make_frame_visible): Call signal handler directly.
Karl Heuer <kwzh@gnu.org>
parents:
8609
diff
changeset
|
5926 to let the handler know that there's something to be read. |
187df0aff719
(x_make_frame_visible): Call signal handler directly.
Karl Heuer <kwzh@gnu.org>
parents:
8609
diff
changeset
|
5927 We used to raise a real alarm, but it seems that the handler |
187df0aff719
(x_make_frame_visible): Call signal handler directly.
Karl Heuer <kwzh@gnu.org>
parents:
8609
diff
changeset
|
5928 isn't always enabled here. This is probably a bug. */ |
8682
42f95b1368ea
(x_make_frame_visible): Call input_polling_used.
Richard M. Stallman <rms@gnu.org>
parents:
8652
diff
changeset
|
5929 if (input_polling_used ()) |
8652 | 5930 { |
5931 /* It could be confusing if a real alarm arrives while processing | |
5932 the fake one. Turn it off and let the handler reset it. */ | |
5933 alarm (0); | |
20364
8e58003a8d02
(x_make_frame_visible): Give dummy arg to
Kenichi Handa <handa@m17n.org>
parents:
20182
diff
changeset
|
5934 input_poll_signal (0); |
8652 | 5935 } |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5936 /* Once we have handled input events, |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5937 we should have received the MapNotify if one is coming. |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5938 So if we have not got it yet, stop looping. |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5939 Some window managers make their own decisions |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5940 about visibility. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5941 if (input_signal_count != count) |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5942 break; |
8098
e44c31d682b1
(x_draw_box): Use curs_x and curs_y, not f->cursor_[xy].
Richard M. Stallman <rms@gnu.org>
parents:
8036
diff
changeset
|
5943 } |
7959
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5944 FRAME_SAMPLE_VISIBILITY (f); |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5945 } |
286 | 5946 } |
5947 | |
5948 /* Change from mapped state to withdrawn state. */ | |
5949 | |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5950 /* Make the frame visible (mapped and not iconified). */ |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5951 |
21514 | 5952 void |
771 | 5953 x_make_frame_invisible (f) |
5954 struct frame *f; | |
286 | 5955 { |
5956 int mask; | |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5957 Window window; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5958 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5959 #ifdef USE_X_TOOLKIT |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5960 /* Use the frame's outermost window, not the one we normally draw on. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5961 window = XtWindow (f->output_data.x->widget); |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5962 #else /* not USE_X_TOOLKIT */ |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5963 window = FRAME_X_WINDOW (f); |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5964 #endif /* not USE_X_TOOLKIT */ |
286 | 5965 |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
5966 /* Don't keep the highlight on an invisible frame. */ |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
5967 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
5968 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
5969 |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5970 #if 0/* This might add unreliability; I don't trust it -- rms. */ |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
5971 if (! f->async_visible && ! f->async_iconified) |
286 | 5972 return; |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5973 #endif |
286 | 5974 |
5975 BLOCK_INPUT; | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5976 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5977 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5978 that the current position of the window is user-specified, rather than |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5979 program-specified, so that when the window is mapped again, it will be |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5980 placed at the same location, without forcing the user to position it |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5981 by hand again (they have already done that once for this window.) */ |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
5982 x_wm_set_size_hint (f, (long) 0, 1); |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5983 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5984 #ifdef HAVE_X11R4 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5985 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5986 if (! XWithdrawWindow (FRAME_X_DISPLAY (f), window, |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5987 DefaultScreen (FRAME_X_DISPLAY (f)))) |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5988 { |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5989 UNBLOCK_INPUT_RESIGNAL; |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5990 error ("Can't notify window manager of window withdrawal"); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5991 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5992 #else /* ! defined (HAVE_X11R4) */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5993 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5994 /* Tell the window manager what we're going to do. */ |
286 | 5995 if (! EQ (Vx_no_window_manager, Qt)) |
5996 { | |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5997 XEvent unmap; |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5998 |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5999 unmap.xunmap.type = UnmapNotify; |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6000 unmap.xunmap.window = window; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6001 unmap.xunmap.event = DefaultRootWindow (FRAME_X_DISPLAY (f)); |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6002 unmap.xunmap.from_configure = False; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6003 if (! XSendEvent (FRAME_X_DISPLAY (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6004 DefaultRootWindow (FRAME_X_DISPLAY (f)), |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6005 False, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6006 SubstructureRedirectMask|SubstructureNotifyMask, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6007 &unmap)) |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6008 { |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6009 UNBLOCK_INPUT_RESIGNAL; |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6010 error ("Can't notify window manager of withdrawal"); |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6011 } |
286 | 6012 } |
6013 | |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6014 /* Unmap the window ourselves. Cheeky! */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6015 XUnmapWindow (FRAME_X_DISPLAY (f), window); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6016 #endif /* ! defined (HAVE_X11R4) */ |
286 | 6017 |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6018 /* We can't distinguish this from iconification |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6019 just by the event that we get from the server. |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6020 So we can't win using the usual strategy of letting |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6021 FRAME_SAMPLE_VISIBILITY set this. So do it by hand, |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6022 and synchronize with the server to make sure we agree. */ |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6023 f->visible = 0; |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6024 FRAME_ICONIFIED_P (f) = 0; |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6025 f->async_visible = 0; |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6026 f->async_iconified = 0; |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6027 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6028 x_sync (f); |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
6029 |
286 | 6030 UNBLOCK_INPUT; |
6031 } | |
6032 | |
6033 /* Change window state from mapped to iconified. */ | |
6034 | |
21514 | 6035 void |
771 | 6036 x_iconify_frame (f) |
6037 struct frame *f; | |
286 | 6038 { |
6039 int mask; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6040 int result; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
6041 Lisp_Object type; |
286 | 6042 |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
6043 /* Don't keep the highlight on an invisible frame. */ |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6044 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6045 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
6046 |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
6047 if (f->async_iconified) |
286 | 6048 return; |
6049 | |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
6050 BLOCK_INPUT; |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
6051 |
13627
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
6052 FRAME_SAMPLE_VISIBILITY (f); |
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
6053 |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
6054 type = x_icon_type (f); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
6055 if (!NILP (type)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
6056 x_bitmap_icon (f, type); |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
6057 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6058 #ifdef USE_X_TOOLKIT |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6059 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6060 if (! FRAME_VISIBLE_P (f)) |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6061 { |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6062 if (! EQ (Vx_no_window_manager, Qt)) |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6063 x_wm_set_window_state (f, IconicState); |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6064 /* This was XtPopup, but that did nothing for an iconified frame. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6065 XtMapWidget (f->output_data.x->widget); |
15472
300b52e37681
(x_iconify_frame): If frame is invisible, explicitly mark it as iconified.
Richard M. Stallman <rms@gnu.org>
parents:
15376
diff
changeset
|
6066 /* The server won't give us any event to indicate |
300b52e37681
(x_iconify_frame): If frame is invisible, explicitly mark it as iconified.
Richard M. Stallman <rms@gnu.org>
parents:
15376
diff
changeset
|
6067 that an invisible frame was changed to an icon, |
300b52e37681
(x_iconify_frame): If frame is invisible, explicitly mark it as iconified.
Richard M. Stallman <rms@gnu.org>
parents:
15376
diff
changeset
|
6068 so we have to record it here. */ |
300b52e37681
(x_iconify_frame): If frame is invisible, explicitly mark it as iconified.
Richard M. Stallman <rms@gnu.org>
parents:
15376
diff
changeset
|
6069 f->iconified = 1; |
16753
ab63a77c3a23
(x_iconify_frame): Clear visible when we set iconified.
Richard M. Stallman <rms@gnu.org>
parents:
16491
diff
changeset
|
6070 f->visible = 1; |
15472
300b52e37681
(x_iconify_frame): If frame is invisible, explicitly mark it as iconified.
Richard M. Stallman <rms@gnu.org>
parents:
15376
diff
changeset
|
6071 f->async_iconified = 1; |
16753
ab63a77c3a23
(x_iconify_frame): Clear visible when we set iconified.
Richard M. Stallman <rms@gnu.org>
parents:
16491
diff
changeset
|
6072 f->async_visible = 0; |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6073 UNBLOCK_INPUT; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6074 return; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6075 } |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6076 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6077 result = XIconifyWindow (FRAME_X_DISPLAY (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6078 XtWindow (f->output_data.x->widget), |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6079 DefaultScreen (FRAME_X_DISPLAY (f))); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6080 UNBLOCK_INPUT; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6081 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6082 if (!result) |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6083 error ("Can't notify window manager of iconification"); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6084 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6085 f->async_iconified = 1; |
16753
ab63a77c3a23
(x_iconify_frame): Clear visible when we set iconified.
Richard M. Stallman <rms@gnu.org>
parents:
16491
diff
changeset
|
6086 f->async_visible = 0; |
ab63a77c3a23
(x_iconify_frame): Clear visible when we set iconified.
Richard M. Stallman <rms@gnu.org>
parents:
16491
diff
changeset
|
6087 |
5740
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
6088 |
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
6089 BLOCK_INPUT; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6090 XFlush (FRAME_X_DISPLAY (f)); |
5740
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
6091 UNBLOCK_INPUT; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6092 #else /* not USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6093 |
7738
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
6094 /* Make sure the X server knows where the window should be positioned, |
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
6095 in case the user deiconifies with the window manager. */ |
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
6096 if (! FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6097 x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); |
7738
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
6098 |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6099 /* Since we don't know which revision of X we're running, we'll use both |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6100 the X11R3 and X11R4 techniques. I don't know if this is a good idea. */ |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6101 |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6102 /* X11R4: send a ClientMessage to the window manager using the |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6103 WM_CHANGE_STATE type. */ |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6104 { |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6105 XEvent message; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6106 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6107 message.xclient.window = FRAME_X_WINDOW (f); |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6108 message.xclient.type = ClientMessage; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6109 message.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state; |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6110 message.xclient.format = 32; |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6111 message.xclient.data.l[0] = IconicState; |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6112 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6113 if (! XSendEvent (FRAME_X_DISPLAY (f), |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6114 DefaultRootWindow (FRAME_X_DISPLAY (f)), |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6115 False, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6116 SubstructureRedirectMask | SubstructureNotifyMask, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6117 &message)) |
286 | 6118 { |
6119 UNBLOCK_INPUT_RESIGNAL; | |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6120 error ("Can't notify window manager of iconification"); |
286 | 6121 } |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6122 } |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6123 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6124 /* X11R3: set the initial_state field of the window manager hints to |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6125 IconicState. */ |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
6126 x_wm_set_window_state (f, IconicState); |
286 | 6127 |
4304
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
6128 if (!FRAME_VISIBLE_P (f)) |
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
6129 { |
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
6130 /* If the frame was withdrawn, before, we must map it. */ |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6131 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
4304
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
6132 } |
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
6133 |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
6134 f->async_iconified = 1; |
16753
ab63a77c3a23
(x_iconify_frame): Clear visible when we set iconified.
Richard M. Stallman <rms@gnu.org>
parents:
16491
diff
changeset
|
6135 f->async_visible = 0; |
286 | 6136 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6137 XFlush (FRAME_X_DISPLAY (f)); |
286 | 6138 UNBLOCK_INPUT; |
5740
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
6139 #endif /* not USE_X_TOOLKIT */ |
286 | 6140 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
6141 |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6142 /* Destroy the X window of frame F. */ |
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6143 |
21514 | 6144 void |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6145 x_destroy_window (f) |
771 | 6146 struct frame *f; |
286 | 6147 { |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6148 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6149 |
286 | 6150 BLOCK_INPUT; |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6151 |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6152 /* If a display connection is dead, don't try sending more |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6153 commands to the X server. */ |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6154 if (dpyinfo->display != 0) |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6155 { |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6156 if (f->output_data.x->icon_desc != 0) |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6157 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); |
14830
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6158 #ifdef HAVE_X_I18N |
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6159 if (FRAME_XIM (f)) |
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6160 { |
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6161 XDestroyIC (FRAME_XIC (f)); |
14942
3432e5570488
(x_destroy_window): Do call XCloseIM if X11R6.
Richard M. Stallman <rms@gnu.org>
parents:
14921
diff
changeset
|
6162 #if ! defined (SOLARIS2) || defined (HAVE_X11R6) |
3432e5570488
(x_destroy_window): Do call XCloseIM if X11R6.
Richard M. Stallman <rms@gnu.org>
parents:
14921
diff
changeset
|
6163 /* This line causes crashes on Solaris with Openwin, |
3432e5570488
(x_destroy_window): Do call XCloseIM if X11R6.
Richard M. Stallman <rms@gnu.org>
parents:
14921
diff
changeset
|
6164 due to an apparent bug in XCloseIM. |
3432e5570488
(x_destroy_window): Do call XCloseIM if X11R6.
Richard M. Stallman <rms@gnu.org>
parents:
14921
diff
changeset
|
6165 X11R6 seems not to have the bug. */ |
14830
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6166 XCloseIM (FRAME_XIM (f)); |
14921
5a1524631bca
(x_destroy_window) [SOLARIS2]: Don't free the IC or IM.
Richard M. Stallman <rms@gnu.org>
parents:
14896
diff
changeset
|
6167 #endif |
14830
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6168 } |
34db919835d3
(x_destroy_window) [HAVE_X_I18N]: Free xic and xim of frame.
Richard M. Stallman <rms@gnu.org>
parents:
14826
diff
changeset
|
6169 #endif |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6170 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->window_desc); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6171 #ifdef USE_X_TOOLKIT |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6172 XtDestroyWidget (f->output_data.x->widget); |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6173 free_frame_menubar (f); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6174 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6175 |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6176 free_frame_faces (f); |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6177 XFlush (FRAME_X_DISPLAY (f)); |
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
6178 } |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6179 |
17575 | 6180 if (f->output_data.x->saved_menu_event) |
6181 free (f->output_data.x->saved_menu_event); | |
17574
7fe6de4949e4
(x_destroy_window): Free saved_menu_event, if any.
Richard M. Stallman <rms@gnu.org>
parents:
17519
diff
changeset
|
6182 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6183 xfree (f->output_data.x); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6184 f->output_data.x = 0; |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6185 if (f == dpyinfo->x_focus_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6186 dpyinfo->x_focus_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6187 if (f == dpyinfo->x_focus_event_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6188 dpyinfo->x_focus_event_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6189 if (f == dpyinfo->x_highlight_frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
6190 dpyinfo->x_highlight_frame = 0; |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6191 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6192 dpyinfo->reference_count--; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6193 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6194 if (f == dpyinfo->mouse_face_mouse_frame) |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
6195 { |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6196 dpyinfo->mouse_face_beg_row |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6197 = dpyinfo->mouse_face_beg_col = -1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6198 dpyinfo->mouse_face_end_row |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6199 = dpyinfo->mouse_face_end_col = -1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6200 dpyinfo->mouse_face_window = Qnil; |
21017
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
6201 dpyinfo->mouse_face_deferred_gc = 0; |
1ecfba12016a
(XTframe_up_to_date): Check that mouse_face_mouse_frame
Richard M. Stallman <rms@gnu.org>
parents:
20632
diff
changeset
|
6202 dpyinfo->mouse_face_mouse_frame = 0; |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
6203 } |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6204 |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
6205 UNBLOCK_INPUT; |
286 | 6206 } |
6207 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6208 /* Setting window manager hints. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6209 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6210 /* Set the normal size hints for the window manager, for frame F. |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6211 FLAGS is the flags word to use--or 0 meaning preserve the flags |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6212 that the window now has. |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6213 If USER_POSITION is nonzero, we set the USPosition |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6214 flag (this is useful when FLAGS is 0). */ |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6215 |
21514 | 6216 void |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6217 x_wm_set_size_hint (f, flags, user_position) |
771 | 6218 struct frame *f; |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6219 long flags; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6220 int user_position; |
286 | 6221 { |
6222 XSizeHints size_hints; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6223 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6224 #ifdef USE_X_TOOLKIT |
6631
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6225 Arg al[2]; |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6226 int ac = 0; |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6227 Dimension widget_width, widget_height; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6228 Window window = XtWindow (f->output_data.x->widget); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6229 #else /* not USE_X_TOOLKIT */ |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6230 Window window = FRAME_X_WINDOW (f); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6231 #endif /* not USE_X_TOOLKIT */ |
286 | 6232 |
7187
ca0102511d80
(x_wm_set_size_hint): Don't set PMaxSize.
Richard M. Stallman <rms@gnu.org>
parents:
7169
diff
changeset
|
6233 /* Setting PMaxSize caused various problems. */ |
ca0102511d80
(x_wm_set_size_hint): Don't set PMaxSize.
Richard M. Stallman <rms@gnu.org>
parents:
7169
diff
changeset
|
6234 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; |
286 | 6235 |
771 | 6236 flexlines = f->height; |
6237 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6238 size_hints.x = 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:
12657
diff
changeset
|
6239 size_hints.y = f->output_data.x->top_pos; |
7123
4f2c825cc0f8
(x_wm_set_size_hint): Do set max_height, max_width, and PMaxSize flag.
Richard M. Stallman <rms@gnu.org>
parents:
7122
diff
changeset
|
6240 |
6631
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6241 #ifdef USE_X_TOOLKIT |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6242 XtSetArg (al[ac], XtNwidth, &widget_width); ac++; |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6243 XtSetArg (al[ac], XtNheight, &widget_height); ac++; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6244 XtGetValues (f->output_data.x->widget, al, ac); |
6631
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6245 size_hints.height = widget_height; |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6246 size_hints.width = widget_width; |
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6247 #else /* not USE_X_TOOLKIT */ |
771 | 6248 size_hints.height = PIXEL_HEIGHT (f); |
6249 size_hints.width = PIXEL_WIDTH (f); | |
6631
eea1789dc6fd
(x_wm_set_size_hint): Add USE_X_TOOLKIT conditional and call
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6626
diff
changeset
|
6250 #endif /* not USE_X_TOOLKIT */ |
7123
4f2c825cc0f8
(x_wm_set_size_hint): Do set max_height, max_width, and PMaxSize flag.
Richard M. Stallman <rms@gnu.org>
parents:
7122
diff
changeset
|
6251 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6252 size_hints.width_inc = 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:
12657
diff
changeset
|
6253 size_hints.height_inc = f->output_data.x->line_height; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6254 size_hints.max_width |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6255 = FRAME_X_DISPLAY_INFO (f)->width - CHAR_TO_PIXEL_WIDTH (f, 0); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6256 size_hints.max_height |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6257 = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0); |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6258 |
12189 | 6259 /* Calculate the base and minimum sizes. |
6260 | |
6261 (When we use the X toolkit, we don't do it here. | |
6262 Instead we copy the values that the widgets are using, below.) */ | |
6263 #ifndef USE_X_TOOLKIT | |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
6264 { |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6265 int base_width, base_height; |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6266 int min_rows = 0, min_cols = 0; |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6267 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6268 base_width = CHAR_TO_PIXEL_WIDTH (f, 0); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6269 base_height = CHAR_TO_PIXEL_HEIGHT (f, 0); |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6270 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6271 check_frame_size (f, &min_rows, &min_cols); |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6272 |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6273 /* The window manager uses the base width hints to calculate the |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6274 current number of rows and columns in the frame while |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6275 resizing; min_width and min_height aren't useful for this |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6276 purpose, since they might not give the dimensions for a |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6277 zero-row, zero-column frame. |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6278 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6279 We use the base_width and base_height members if we have |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6280 them; otherwise, we set the min_width and min_height members |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6281 to the size for a zero x zero frame. */ |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6282 |
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6283 #ifdef HAVE_X11R4 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6284 size_hints.flags |= PBaseSize; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6285 size_hints.base_width = base_width; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6286 size_hints.base_height = base_height; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6287 size_hints.min_width = base_width + min_cols * size_hints.width_inc; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6288 size_hints.min_height = base_height + min_rows * size_hints.height_inc; |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6289 #else |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6290 size_hints.min_width = base_width; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6291 size_hints.min_height = base_height; |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6292 #endif |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
6293 } |
286 | 6294 |
12189 | 6295 /* If we don't need the old flags, we don't need the old hint at all. */ |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6296 if (flags) |
286 | 6297 { |
12189 | 6298 size_hints.flags |= flags; |
6299 goto no_read; | |
6300 } | |
6301 #endif /* not USE_X_TOOLKIT */ | |
6302 | |
6303 { | |
6304 XSizeHints hints; /* Sometimes I hate X Windows... */ | |
6305 long supplied_return; | |
6306 int value; | |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6307 |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6308 #ifdef HAVE_X11R4 |
12189 | 6309 value = XGetWMNormalHints (FRAME_X_DISPLAY (f), window, &hints, |
6310 &supplied_return); | |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6311 #else |
12189 | 6312 value = XGetNormalHints (FRAME_X_DISPLAY (f), window, &hints); |
6313 #endif | |
6314 | |
6315 #ifdef USE_X_TOOLKIT | |
6316 size_hints.base_height = hints.base_height; | |
6317 size_hints.base_width = hints.base_width; | |
6318 size_hints.min_height = hints.min_height; | |
6319 size_hints.min_width = hints.min_width; | |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6320 #endif |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6321 |
12189 | 6322 if (flags) |
6323 size_hints.flags |= flags; | |
6324 else | |
6325 { | |
6326 if (value == 0) | |
6327 hints.flags = 0; | |
6328 if (hints.flags & PSize) | |
6329 size_hints.flags |= PSize; | |
6330 if (hints.flags & PPosition) | |
6331 size_hints.flags |= PPosition; | |
6332 if (hints.flags & USPosition) | |
6333 size_hints.flags |= USPosition; | |
6334 if (hints.flags & USSize) | |
6335 size_hints.flags |= USSize; | |
6336 } | |
6337 } | |
6338 | |
6339 no_read: | |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
6340 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6341 #ifdef PWinGravity |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6342 size_hints.win_gravity = f->output_data.x->win_gravity; |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6343 size_hints.flags |= PWinGravity; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6344 |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6345 if (user_position) |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
6346 { |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6347 size_hints.flags &= ~ PPosition; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
6348 size_hints.flags |= USPosition; |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
6349 } |
4777
21ed9c9bb210
(w_wn_set_size_hint): Make recent window gravity addition
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
6350 #endif /* PWinGravity */ |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
6351 |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6352 #ifdef HAVE_X11R4 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6353 XSetWMNormalHints (FRAME_X_DISPLAY (f), window, &size_hints); |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6354 #else |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6355 XSetNormalHints (FRAME_X_DISPLAY (f), window, &size_hints); |
1127
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
6356 #endif |
286 | 6357 } |
6358 | |
6359 /* Used for IconicState or NormalState */ | |
21514 | 6360 void |
771 | 6361 x_wm_set_window_state (f, state) |
6362 struct frame *f; | |
286 | 6363 int state; |
6364 { | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6365 #ifdef USE_X_TOOLKIT |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6366 Arg al[1]; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6367 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6368 XtSetArg (al[0], XtNinitialState, state); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6369 XtSetValues (f->output_data.x->widget, al, 1); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6370 #else /* not USE_X_TOOLKIT */ |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6371 Window window = FRAME_X_WINDOW (f); |
286 | 6372 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6373 f->output_data.x->wm_hints.flags |= StateHint; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6374 f->output_data.x->wm_hints.initial_state = state; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6375 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6376 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
6377 #endif /* not USE_X_TOOLKIT */ |
286 | 6378 } |
6379 | |
21514 | 6380 void |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
6381 x_wm_set_icon_pixmap (f, pixmap_id) |
771 | 6382 struct frame *f; |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
6383 int pixmap_id; |
286 | 6384 { |
15117
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6385 Pixmap icon_pixmap; |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6386 |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6387 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6388 Window window = XtWindow (f->output_data.x->widget); |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6389 #else |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6390 Window window = FRAME_X_WINDOW (f); |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6391 #endif |
286 | 6392 |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
6393 if (pixmap_id > 0) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
6394 { |
15117
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6395 icon_pixmap = x_bitmap_pixmap (f, pixmap_id); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6396 f->output_data.x->wm_hints.icon_pixmap = icon_pixmap; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
6397 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
6398 else |
12966
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6399 { |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6400 /* It seems there is no way to turn off use of an icon pixmap. |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6401 The following line does it, only if no icon has yet been created, |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6402 for some window managers. But with mwm it crashes. |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6403 Some people say it should clear the IconPixmapHint bit in this case, |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6404 but that doesn't work, and the X consortium said it isn't the |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6405 right thing at all. Since there is no way to win, |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6406 best to explicitly give up. */ |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6407 #if 0 |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6408 f->output_data.x->wm_hints.icon_pixmap = None; |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6409 #else |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6410 return; |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6411 #endif |
ce60b1a64399
(x_wm_set_icon_pixmap): If trying to turn off icon pixmap, do nothing.
Richard M. Stallman <rms@gnu.org>
parents:
12771
diff
changeset
|
6412 } |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6413 |
15117
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6414 #ifdef USE_X_TOOLKIT /* same as in x_wm_set_window_state. */ |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6415 |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6416 { |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6417 Arg al[1]; |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6418 XtSetArg (al[0], XtNiconPixmap, icon_pixmap); |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6419 XtSetValues (f->output_data.x->widget, al, 1); |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6420 } |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6421 |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6422 #else /* not USE_X_TOOLKIT */ |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6423 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6424 f->output_data.x->wm_hints.flags |= IconPixmapHint; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6425 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
15117
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6426 |
21673af29c32
[USE_X_TOOLKIT]: Include X11/Shell.h.
Richard M. Stallman <rms@gnu.org>
parents:
15080
diff
changeset
|
6427 #endif /* not USE_X_TOOLKIT */ |
286 | 6428 } |
6429 | |
21514 | 6430 void |
771 | 6431 x_wm_set_icon_position (f, icon_x, icon_y) |
6432 struct frame *f; | |
286 | 6433 int icon_x, icon_y; |
6434 { | |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6435 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6436 Window window = XtWindow (f->output_data.x->widget); |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6437 #else |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6438 Window window = FRAME_X_WINDOW (f); |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
6439 #endif |
286 | 6440 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6441 f->output_data.x->wm_hints.flags |= IconPositionHint; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6442 f->output_data.x->wm_hints.icon_x = icon_x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6443 f->output_data.x->wm_hints.icon_y = icon_y; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6444 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
6445 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
286 | 6446 } |
6447 | |
6448 | |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6449 /* Interface to fontset handler. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6450 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6451 /* Return a pointer to struct font_info of font FONT_IDX of frame F. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6452 struct font_info * |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6453 x_get_font_info (f, font_idx) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6454 FRAME_PTR f; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6455 int font_idx; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6456 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6457 return (FRAME_X_FONT_TABLE (f) + font_idx); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6458 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6459 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6460 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6461 /* Return a list of names of available fonts matching PATTERN on frame |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6462 F. If SIZE is not 0, it is the size (maximum bound width) of fonts |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6463 to be listed. Frame F NULL means we have not yet created any |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6464 frame on X, and consult the first display in x_display_list. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6465 MAXNAMES sets a limit on how many fonts to match. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6466 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6467 Lisp_Object |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6468 x_list_fonts (f, pattern, size, maxnames) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6469 FRAME_PTR f; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6470 Lisp_Object pattern; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6471 int size; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6472 int maxnames; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6473 { |
18646
9537741e7045
(x_list_fonts): Initialize the variable LIST to Qnil.
Kenichi Handa <handa@m17n.org>
parents:
18630
diff
changeset
|
6474 Lisp_Object list = Qnil, patterns, newlist = Qnil, key, tem, second_best; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6475 Display *dpy = f != NULL ? FRAME_X_DISPLAY (f) : x_display_list->display; |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6476 int try_XLoadQueryFont = 0; |
24633
c7d905dca6ba
(x_list_fonts): Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents:
24618
diff
changeset
|
6477 int count; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6478 |
19447
34099ec680df
(x_list_fonts): Adjusted for the name change of
Kenichi Handa <handa@m17n.org>
parents:
19276
diff
changeset
|
6479 patterns = Fassoc (pattern, Valternate_fontname_alist); |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6480 if (NILP (patterns)) |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6481 patterns = Fcons (pattern, Qnil); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6482 |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6483 if (maxnames == 1 && !size) |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6484 /* We can return any single font matching PATTERN. */ |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6485 try_XLoadQueryFont = 1; |
19062
9cc02044117d
(x_list_fonts): Request at least 10 fonts by XListFonts.
Kenichi Handa <handa@m17n.org>
parents:
19060
diff
changeset
|
6486 |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6487 for (; CONSP (patterns); patterns = XCONS (patterns)->cdr) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6488 { |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6489 int num_fonts; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6490 char **names; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6491 |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6492 pattern = XCONS (patterns)->car; |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6493 /* See if we cached the result for this particular query. |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6494 The cache is an alist of the form: |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6495 (((PATTERN . MAXNAMES) (FONTNAME . WIDTH) ...) ...) |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6496 */ |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6497 if (f && (tem = XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr, |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6498 key = Fcons (pattern, make_number (maxnames)), |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6499 !NILP (list = Fassoc (key, tem)))) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6500 { |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6501 list = Fcdr_safe (list); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6502 /* We have a cashed list. Don't have to get the list again. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6503 goto label_cached; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6504 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6505 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6506 /* At first, put PATTERN in the cache. */ |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6507 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6508 BLOCK_INPUT; |
24618
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6509 count = x_catch_errors (dpy); |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6510 |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6511 if (try_XLoadQueryFont) |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6512 { |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6513 XFontStruct *font; |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6514 unsigned long value; |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6515 |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6516 font = XLoadQueryFont (dpy, XSTRING (pattern)->data); |
24618
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6517 if (x_had_errors_p (dpy)) |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6518 { |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6519 /* This error is perhaps due to insufficient memory on X |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6520 server. Let's just ignore it. */ |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6521 font = NULL; |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6522 x_clear_errors (dpy); |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6523 } |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6524 |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6525 if (font |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6526 && XGetFontProperty (font, XA_FONT, &value)) |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6527 { |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6528 char *name = (char *) XGetAtomName (dpy, (Atom) value); |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6529 int len = strlen (name); |
22530
6d2e22a16952
(x_list_fonts): Keep alloca usage simple.
Karl Heuer <kwzh@gnu.org>
parents:
22522
diff
changeset
|
6530 char *tmp; |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6531 |
23095
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6532 /* If DXPC (a Differential X Protocol Compressor) |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6533 Ver.3.7 is running, XGetAtomName will return null |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6534 string. We must avoid such a name. */ |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6535 if (len == 0) |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6536 try_XLoadQueryFont = 0; |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6537 else |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6538 { |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6539 num_fonts = 1; |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6540 names = (char **) alloca (sizeof (char *)); |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6541 /* Some systems only allow alloca assigned to a |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6542 simple var. */ |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6543 tmp = (char *) alloca (len + 1); names[0] = tmp; |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6544 bcopy (name, names[0], len + 1); |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6545 XFree (name); |
4e83e072cd97
(x_list_fonts): Work-around for the case XGetAtomName
Kenichi Handa <handa@m17n.org>
parents:
23037
diff
changeset
|
6546 } |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6547 } |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6548 else |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6549 try_XLoadQueryFont = 0; |
22943
5493321d4526
(x_list_fonts): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22907
diff
changeset
|
6550 |
5493321d4526
(x_list_fonts): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22907
diff
changeset
|
6551 if (font) |
5493321d4526
(x_list_fonts): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents:
22907
diff
changeset
|
6552 XFreeFont (dpy, font); |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6553 } |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6554 |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6555 if (!try_XLoadQueryFont) |
24618
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6556 { |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6557 /* We try at least 10 fonts because XListFonts will return |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6558 auto-scaled fonts at the head. */ |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6559 names = XListFonts (dpy, XSTRING (pattern)->data, max (maxnames, 10), |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6560 &num_fonts); |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6561 if (x_had_errors_p (dpy)) |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6562 { |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6563 /* This error is perhaps due to insufficient memory on X |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6564 server. Let's just ignore it. */ |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6565 names = NULL; |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6566 x_clear_errors (dpy); |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6567 } |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6568 } |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6569 |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6570 x_uncatch_errors (dpy, count); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6571 UNBLOCK_INPUT; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6572 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6573 if (names) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6574 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6575 int i; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6576 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6577 /* Make a list of all the fonts we got back. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6578 Store that in the font cache for the display. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6579 for (i = 0; i < num_fonts; i++) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6580 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6581 char *p = names[i]; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6582 int average_width = -1, dashes = 0, width = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6583 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6584 /* Count the number of dashes in NAMES[I]. If there are |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6585 14 dashes, and the field value following 12th dash |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6586 (AVERAGE_WIDTH) is 0, this is a auto-scaled font which |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6587 is usually too ugly to be used for editing. Let's |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6588 ignore it. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6589 while (*p) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6590 if (*p++ == '-') |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6591 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6592 dashes++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6593 if (dashes == 7) /* PIXEL_SIZE field */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6594 width = atoi (p); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6595 else if (dashes == 12) /* AVERAGE_WIDTH field */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6596 average_width = atoi (p); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6597 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6598 if (dashes < 14 || average_width != 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6599 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6600 tem = build_string (names[i]); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6601 if (NILP (Fassoc (tem, list))) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6602 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6603 if (STRINGP (Vx_pixel_size_width_font_regexp) |
18191
3c353983bba9
(x_list_fonts): fast_c_string_match_ignore_case renamed.
Richard M. Stallman <rms@gnu.org>
parents:
18188
diff
changeset
|
6604 && ((fast_c_string_match_ignore_case |
3c353983bba9
(x_list_fonts): fast_c_string_match_ignore_case renamed.
Richard M. Stallman <rms@gnu.org>
parents:
18188
diff
changeset
|
6605 (Vx_pixel_size_width_font_regexp, names[i])) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6606 >= 0)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6607 /* We can set the value of PIXEL_SIZE to the |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6608 width of this font. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6609 list = Fcons (Fcons (tem, make_number (width)), list); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6610 else |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6611 /* For the moment, width is not known. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6612 list = Fcons (Fcons (tem, Qnil), list); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6613 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6614 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6615 } |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6616 if (!try_XLoadQueryFont) |
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6617 XFreeFontNames (names); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6618 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6619 |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6620 /* Now store the result in the cache. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6621 if (f != NULL) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6622 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6623 = Fcons (Fcons (key, list), |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6624 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr); |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6625 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6626 label_cached: |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6627 if (NILP (list)) continue; /* Try the remaining alternatives. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6628 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6629 newlist = second_best = Qnil; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6630 /* Make a list of the fonts that have the right width. */ |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6631 for (; CONSP (list); list = XCONS (list)->cdr) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6632 { |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6633 int found_size; |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6634 |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6635 tem = XCONS (list)->car; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6636 |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6637 if (!CONSP (tem) || NILP (XCONS (tem)->car)) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6638 continue; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6639 if (!size) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6640 { |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6641 newlist = Fcons (XCONS (tem)->car, newlist); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6642 continue; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6643 } |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6644 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6645 if (!INTEGERP (XCONS (tem)->cdr)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6646 { |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6647 /* Since we have not yet known the size of this font, we |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6648 must try slow function call XLoadQueryFont. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6649 XFontStruct *thisinfo; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6650 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6651 BLOCK_INPUT; |
24618
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6652 count = x_catch_errors (dpy); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6653 thisinfo = XLoadQueryFont (dpy, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6654 XSTRING (XCONS (tem)->car)->data); |
24618
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6655 if (x_had_errors_p (dpy)) |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6656 { |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6657 /* This error is perhaps due to insufficient memory on X |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6658 server. Let's just ignore it. */ |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6659 thisinfo = NULL; |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6660 x_clear_errors (dpy); |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6661 } |
b18f51ec1b6c
Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24561
diff
changeset
|
6662 x_uncatch_errors (dpy, count); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6663 UNBLOCK_INPUT; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6664 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6665 if (thisinfo) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6666 { |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6667 XCONS (tem)->cdr |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6668 = (thisinfo->min_bounds.width == 0 |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6669 ? make_number (0) |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6670 : make_number (thisinfo->max_bounds.width)); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6671 XFreeFont (dpy, thisinfo); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6672 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6673 else |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6674 /* For unknown reason, the previous call of XListFont had |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6675 retruned a font which can't be opened. Record the size |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6676 as 0 not to try to open it again. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6677 XCONS (tem)->cdr = make_number (0); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6678 } |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6679 |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6680 found_size = XINT (XCONS (tem)->cdr); |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6681 if (found_size == size) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6682 newlist = Fcons (XCONS (tem)->car, newlist); |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6683 else if (found_size > 0) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6684 { |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6685 if (NILP (second_best)) |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6686 second_best = tem; |
19060
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6687 else if (found_size < size) |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6688 { |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6689 if (XINT (XCONS (second_best)->cdr) > size |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6690 || XINT (XCONS (second_best)->cdr) < found_size) |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6691 second_best = tem; |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6692 } |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6693 else |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6694 { |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6695 if (XINT (XCONS (second_best)->cdr) > size |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6696 && XINT (XCONS (second_best)->cdr) > found_size) |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6697 second_best = tem; |
7b362a9bf8e9
(x_list_fonts): Reject a font whose min_bounds.width is 0.
Richard M. Stallman <rms@gnu.org>
parents:
19027
diff
changeset
|
6698 } |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6699 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6700 } |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6701 if (!NILP (newlist)) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6702 break; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6703 else if (!NILP (second_best)) |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6704 { |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6705 newlist = Fcons (XCONS (second_best)->car, Qnil); |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6706 break; |
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6707 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6708 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6709 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6710 return newlist; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6711 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6712 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6713 /* Load font named FONTNAME of the size SIZE for frame F, and return a |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6714 pointer to the structure font_info while allocating it dynamically. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6715 If SIZE is 0, load any size of font. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6716 If loading is failed, return NULL. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6717 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6718 struct font_info * |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6719 x_load_font (f, fontname, size) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6720 struct frame *f; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6721 register char *fontname; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6722 int size; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6723 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6724 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6725 Lisp_Object font_names; |
24484
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6726 int count; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6727 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6728 /* Get a list of all the fonts that match this name. Once we |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6729 have a list of matching fonts, we compare them against the fonts |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6730 we already have by comparing names. */ |
22503
104e277d77d3
(x_list_fonts): If SIZE is zero and MAXNAMES is 1, use
Kenichi Handa <handa@m17n.org>
parents:
22400
diff
changeset
|
6731 font_names = x_list_fonts (f, build_string (fontname), size, 1); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6732 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6733 if (!NILP (font_names)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6734 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6735 Lisp_Object tail; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6736 int i; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6737 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6738 for (i = 0; i < dpyinfo->n_fonts; i++) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6739 for (tail = font_names; CONSP (tail); tail = XCONS (tail)->cdr) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6740 if (!strcmp (dpyinfo->font_table[i].name, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6741 XSTRING (XCONS (tail)->car)->data) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6742 || !strcmp (dpyinfo->font_table[i].full_name, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6743 XSTRING (XCONS (tail)->car)->data)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6744 return (dpyinfo->font_table + i); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6745 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6746 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6747 /* Load the font and add it to the table. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6748 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6749 char *full_name; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6750 XFontStruct *font; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6751 struct font_info *fontp; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6752 unsigned long value; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6753 |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6754 /* If we have found fonts by x_list_font, load one of them. If |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6755 not, we still try to load a font by the name given as FONTNAME |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6756 because XListFonts (called in x_list_font) of some X server has |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6757 a bug of not finding a font even if the font surely exists and |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6758 is loadable by XLoadQueryFont. */ |
23162
b36799069143
(x_load_font): If SIZE is 0, don't use a name x_list_font returns.
Kenichi Handa <handa@m17n.org>
parents:
23151
diff
changeset
|
6759 if (size > 0 && !NILP (font_names)) |
17825
281d99590839
(dumpglyphs): Draw glyphs one by one if the font for
Kenichi Handa <handa@m17n.org>
parents:
17720
diff
changeset
|
6760 fontname = (char *) XSTRING (XCONS (font_names)->car)->data; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6761 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6762 BLOCK_INPUT; |
24484
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6763 count = x_catch_errors (FRAME_X_DISPLAY (f)); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6764 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); |
24484
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6765 if (x_had_errors_p (FRAME_X_DISPLAY (f))) |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6766 { |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6767 /* This error is perhaps due to insufficient memory on X |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6768 server. Let's just ignore it. */ |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6769 font = NULL; |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6770 x_clear_errors (FRAME_X_DISPLAY (f)); |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6771 } |
d4ee4399e999
(x_list_fonts): Trap X errors so that Emacs doesn't die
Kenichi Handa <handa@m17n.org>
parents:
24224
diff
changeset
|
6772 x_uncatch_errors (FRAME_X_DISPLAY (f), count); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6773 UNBLOCK_INPUT; |
17194
ae76b2a59dcc
(dumpglyphs): Set a clipping region when we draw glyphs
Kenichi Handa <handa@m17n.org>
parents:
17178
diff
changeset
|
6774 if (!font) |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6775 return NULL; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6776 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6777 /* Do we need to create the table? */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6778 if (dpyinfo->font_table_size == 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6779 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6780 dpyinfo->font_table_size = 16; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6781 dpyinfo->font_table |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6782 = (struct font_info *) xmalloc (dpyinfo->font_table_size |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6783 * sizeof (struct font_info)); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6784 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6785 /* Do we need to grow the table? */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6786 else if (dpyinfo->n_fonts |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6787 >= dpyinfo->font_table_size) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6788 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6789 dpyinfo->font_table_size *= 2; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6790 dpyinfo->font_table |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6791 = (struct font_info *) xrealloc (dpyinfo->font_table, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6792 (dpyinfo->font_table_size |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6793 * sizeof (struct font_info))); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6794 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6795 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6796 fontp = dpyinfo->font_table + dpyinfo->n_fonts; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6797 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6798 /* Now fill in the slots of *FONTP. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6799 BLOCK_INPUT; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6800 fontp->font = font; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6801 fontp->font_idx = dpyinfo->n_fonts; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6802 fontp->name = (char *) xmalloc (strlen (fontname) + 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6803 bcopy (fontname, fontp->name, strlen (fontname) + 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6804 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6805 /* Try to get the full name of FONT. Put it in FULL_NAME. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6806 full_name = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6807 if (XGetFontProperty (font, XA_FONT, &value)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6808 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6809 char *name = (char *) XGetAtomName (FRAME_X_DISPLAY (f), (Atom) value); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6810 char *p = name; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6811 int dashes = 0; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6812 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6813 /* Count the number of dashes in the "full name". |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6814 If it is too few, this isn't really the font's full name, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6815 so don't use it. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6816 In X11R4, the fonts did not come with their canonical names |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6817 stored in them. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6818 while (*p) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6819 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6820 if (*p == '-') |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6821 dashes++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6822 p++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6823 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6824 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6825 if (dashes >= 13) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6826 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6827 full_name = (char *) xmalloc (p - name + 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6828 bcopy (name, full_name, p - name + 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6829 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6830 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6831 XFree (name); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6832 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6833 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6834 if (full_name != 0) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6835 fontp->full_name = full_name; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6836 else |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6837 fontp->full_name = fontp->name; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6838 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6839 fontp->size = font->max_bounds.width; |
24224
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6840 fontp->height = FONT_HEIGHT (font); |
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6841 { |
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6842 /* For some font, ascent and descent in max_bounds field is |
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6843 larger than the above value. */ |
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6844 int max_height = font->max_bounds.ascent + font->max_bounds.descent; |
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6845 if (max_height > fontp->height) |
24690
585a5e69e371
(x_load_font): Fix typo (`>' -> `=').
Kenichi Handa <handa@m17n.org>
parents:
24633
diff
changeset
|
6846 fontp->height = max_height; |
24224
4001ff593a99
(x_load_font): For the height of font, if normarl ascent and
Kenichi Handa <handa@m17n.org>
parents:
24223
diff
changeset
|
6847 } |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6848 |
18347
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6849 if (NILP (font_names)) |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6850 { |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6851 /* We come here because of a bug of XListFonts mentioned at |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6852 the head of this block. Let's store this information in |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6853 the cache for x_list_fonts. */ |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6854 Lisp_Object lispy_name = build_string (fontname); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6855 Lisp_Object lispy_full_name = build_string (fontp->full_name); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6856 |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6857 XCONS (dpyinfo->name_list_element)->cdr |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6858 = Fcons (Fcons (Fcons (lispy_name, make_number (256)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6859 Fcons (Fcons (lispy_full_name, |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6860 make_number (fontp->size)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6861 Qnil)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6862 XCONS (dpyinfo->name_list_element)->cdr); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6863 if (full_name) |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6864 XCONS (dpyinfo->name_list_element)->cdr |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6865 = Fcons (Fcons (Fcons (lispy_full_name, make_number (256)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6866 Fcons (Fcons (lispy_full_name, |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6867 make_number (fontp->size)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6868 Qnil)), |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6869 XCONS (dpyinfo->name_list_element)->cdr); |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6870 } |
b7024f44f5d2
(dumpglyphs): Use FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18191
diff
changeset
|
6871 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6872 /* The slot `encoding' specifies how to map a character |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6873 code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to |
17877
7841036d55f4
(x_load_font): Set 4 instead of -1 in fontp->encoding[1]
Kenichi Handa <handa@m17n.org>
parents:
17825
diff
changeset
|
6874 the font code-points (0:0x20..0x7F, 1:0xA0..0xFF, 0:0x2020..0x7F7F, |
18057
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6875 the font code-points (0:0x20..0x7F, 1:0xA0..0xFF, |
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6876 0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF, or |
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6877 2:0xA020..0xFF7F). For the moment, we don't know which charset |
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6878 uses this font. So, we set informatoin in fontp->encoding[1] |
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6879 which is never used by any charset. If mapping can't be |
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6880 decided, set FONT_ENCODING_NOT_DECIDED. */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6881 fontp->encoding[1] |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6882 = (font->max_byte1 == 0 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6883 /* 1-byte font */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6884 ? (font->min_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6885 ? (font->max_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6886 ? 0 /* 0x20..0x7F */ |
18057
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6887 : FONT_ENCODING_NOT_DECIDED) /* 0x20..0xFF */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6888 : 1) /* 0xA0..0xFF */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6889 /* 2-byte font */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6890 : (font->min_byte1 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6891 ? (font->max_byte1 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6892 ? (font->min_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6893 ? (font->max_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6894 ? 0 /* 0x2020..0x7F7F */ |
18057
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6895 : FONT_ENCODING_NOT_DECIDED) /* 0x2020..0x7FFF */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6896 : 3) /* 0x20A0..0x7FFF */ |
18057
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6897 : FONT_ENCODING_NOT_DECIDED) /* 0x20??..0xA0?? */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6898 : (font->min_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6899 ? (font->max_char_or_byte2 < 0x80 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6900 ? 2 /* 0xA020..0xFF7F */ |
18057
07e0112aa8f5
(x_load_font): Use macro FONT_ENCODING_NOT_DECIDED.
Richard M. Stallman <rms@gnu.org>
parents:
18008
diff
changeset
|
6901 : FONT_ENCODING_NOT_DECIDED) /* 0xA020..0xFFFF */ |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6902 : 1))); /* 0xA0A0..0xFFFF */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6903 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6904 fontp->baseline_offset |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6905 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6906 ? (long) value : 0); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6907 fontp->relative_compose |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6908 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6909 ? (long) value : 0); |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
6910 fontp->default_ascent |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
6911 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value) |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
6912 ? (long) value : 0); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6913 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6914 UNBLOCK_INPUT; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6915 dpyinfo->n_fonts++; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6916 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6917 return fontp; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6918 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6919 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6920 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6921 /* Return a pointer to struct font_info of a font named FONTNAME for frame F. |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6922 If no such font is loaded, return NULL. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6923 struct font_info * |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6924 x_query_font (f, fontname) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6925 struct frame *f; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6926 register char *fontname; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6927 { |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6928 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6929 int i; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6930 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6931 for (i = 0; i < dpyinfo->n_fonts; i++) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6932 if (!strcmp (dpyinfo->font_table[i].name, fontname) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6933 || !strcmp (dpyinfo->font_table[i].full_name, fontname)) |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6934 return (dpyinfo->font_table + i); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6935 return NULL; |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6936 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6937 |
21548
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6938 /* Find a CCL program for a font specified by FONTP, and set the memer |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6939 `encoder' of the structure. */ |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6940 |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6941 void |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6942 x_find_ccl_program (fontp) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6943 struct font_info *fontp; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6944 { |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6945 extern Lisp_Object Vfont_ccl_encoder_alist, Vccl_program_table; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6946 extern Lisp_Object Qccl_program_idx; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6947 extern Lisp_Object resolve_symbol_ccl_program (); |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6948 Lisp_Object list, elt, ccl_prog, ccl_id; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6949 |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6950 for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCONS (list)->cdr) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6951 { |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6952 elt = XCONS (list)->car; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6953 if (CONSP (elt) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6954 && STRINGP (XCONS (elt)->car) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6955 && (fast_c_string_match_ignore_case (XCONS (elt)->car, fontp->name) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6956 >= 0)) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6957 { |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6958 if (SYMBOLP (XCONS (elt)->cdr) && |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6959 (!NILP (ccl_id = Fget (XCONS (elt)->cdr, Qccl_program_idx)))) |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6960 { |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6961 ccl_prog = XVECTOR (Vccl_program_table)->contents[XUINT (ccl_id)]; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6962 if (!CONSP (ccl_prog)) continue; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6963 ccl_prog = XCONS (ccl_prog)->cdr; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6964 } |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6965 else |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6966 { |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6967 ccl_prog = XCONS (elt)->cdr; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6968 if (!VECTORP (ccl_prog)) continue; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6969 } |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6970 |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6971 fontp->font_encoder |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6972 = (struct ccl_program *) xmalloc (sizeof (struct ccl_program)); |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6973 setup_ccl_program (fontp->font_encoder, |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6974 resolve_symbol_ccl_program (ccl_prog)); |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6975 break; |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6976 } |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6977 } |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6978 } |
5d1f1ba38043
(x_find_ccl_program): New function.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
6979 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
6980 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6981 /* Initialization. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
6982 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6983 #ifdef USE_X_TOOLKIT |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6984 static XrmOptionDescRec emacs_options[] = { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6985 {"-geometry", ".geometry", XrmoptionSepArg, NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6986 {"-iconic", ".iconic", XrmoptionNoArg, (XtPointer) "yes"}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6987 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6988 {"-internal-border-width", "*EmacsScreen.internalBorderWidth", |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6989 XrmoptionSepArg, NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6990 {"-ib", "*EmacsScreen.internalBorderWidth", XrmoptionSepArg, NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6991 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6992 {"-T", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6993 {"-wn", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6994 {"-title", "*EmacsShell.title", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6995 {"-iconname", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6996 {"-in", "*EmacsShell.iconName", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6997 {"-mc", "*pointerColor", XrmoptionSepArg, (XtPointer) NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6998 {"-cr", "*cursorColor", XrmoptionSepArg, (XtPointer) NULL} |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
6999 }; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7000 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7001 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7002 static int x_initialized; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7003 |
11015 | 7004 #ifdef MULTI_KBOARD |
7005 /* Test whether two display-name strings agree up to the dot that separates | |
7006 the screen number from the server number. */ | |
7007 static int | |
7008 same_x_server (name1, name2) | |
7009 char *name1, *name2; | |
7010 { | |
7011 int seen_colon = 0; | |
24164
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7012 unsigned char *system_name = XSTRING (Vsystem_name)->data; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7013 int system_name_length = strlen (system_name); |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7014 int length_until_period = 0; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7015 |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7016 while (system_name[length_until_period] != 0 |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7017 && system_name[length_until_period] != '.') |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7018 length_until_period++; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7019 |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7020 /* Treat `unix' like an empty host name. */ |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7021 if (! strncmp (name1, "unix:", 5)) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7022 name1 += 4; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7023 if (! strncmp (name2, "unix:", 5)) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7024 name2 += 4; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7025 /* Treat this host's name like an empty host name. */ |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7026 if (! strncmp (name1, system_name, system_name_length) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7027 && name1[system_name_length] == ':') |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7028 name1 += system_name_length; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7029 if (! strncmp (name2, system_name, system_name_length) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7030 && name2[system_name_length] == ':') |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7031 name2 += system_name_length; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7032 /* Treat this host's domainless name like an empty host name. */ |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7033 if (! strncmp (name1, system_name, length_until_period) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7034 && name1[length_until_period] == ':') |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7035 name1 += length_until_period; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7036 if (! strncmp (name2, system_name, length_until_period) |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7037 && name2[length_until_period] == ':') |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7038 name2 += length_until_period; |
1f8d4cb55bd6
(same_x_server): Detect treat ":0" and "unix:0"
Richard M. Stallman <rms@gnu.org>
parents:
23925
diff
changeset
|
7039 |
11015 | 7040 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) |
7041 { | |
7042 if (*name1 == ':') | |
7043 seen_colon++; | |
7044 if (seen_colon && *name1 == '.') | |
7045 return 1; | |
7046 } | |
7047 return (seen_colon | |
7048 && (*name1 == '.' || *name1 == '\0') | |
7049 && (*name2 == '.' || *name2 == '\0')); | |
7050 } | |
7051 #endif | |
7052 | |
23115
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7053 #if defined (HAVE_X_I18N) || (defined (USE_X_TOOLKIT) && defined (HAVE_X11XTR6)) |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7054 /* Recover from setlocale (LC_ALL, ""). */ |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7055 static void |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7056 fixup_locale () |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7057 { |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7058 /* Currently we require strerror to use the "C" locale, |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7059 since we don't yet support decoding its string result. */ |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7060 #ifdef LC_MESSAGES |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7061 setlocale (LC_MESSAGES, "C"); |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7062 #endif |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7063 |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7064 /* The Emacs Lisp reader needs LC_NUMERIC to be "C", |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7065 so that numbers are read and printed properly for Emacs Lisp. */ |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7066 setlocale (LC_NUMERIC, "C"); |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7067 |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7068 /* Currently we require strftime to use the "C" locale, |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7069 since we don't yet support encoding its format argument, |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7070 or decoding its string result. */ |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7071 setlocale (LC_TIME, "C"); |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7072 } |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7073 #endif |
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7074 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7075 struct x_display_info * |
7801
10e818a0248a
(x_term_init): New args xrm_option and resource_string.
Richard M. Stallman <rms@gnu.org>
parents:
7738
diff
changeset
|
7076 x_term_init (display_name, xrm_option, resource_name) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7077 Lisp_Object display_name; |
7801
10e818a0248a
(x_term_init): New args xrm_option and resource_string.
Richard M. Stallman <rms@gnu.org>
parents:
7738
diff
changeset
|
7078 char *xrm_option; |
10e818a0248a
(x_term_init): New args xrm_option and resource_string.
Richard M. Stallman <rms@gnu.org>
parents:
7738
diff
changeset
|
7079 char *resource_name; |
286 | 7080 { |
771 | 7081 Lisp_Object frame; |
286 | 7082 char *defaultvalue; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7083 int connection; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7084 Display *dpy; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7085 struct x_display_info *dpyinfo; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7086 XrmDatabase xrdb; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7087 |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7088 BLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7089 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7090 if (!x_initialized) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7091 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7092 x_initialize (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7093 x_initialized = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7094 } |
286 | 7095 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
7096 #ifdef HAVE_X_I18N |
14489
9bc700f13f97
(x_connection_signal): Call x_connection_closed properly.
Richard M. Stallman <rms@gnu.org>
parents:
14411
diff
changeset
|
7097 setlocale (LC_ALL, ""); |
23115
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7098 fixup_locale (); |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
7099 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
7100 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7101 #ifdef USE_X_TOOLKIT |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7102 /* weiner@footloose.sps.mot.com reports that this causes |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7103 errors with X11R5: |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7104 X protocol error: BadAtom (invalid Atom parameter) |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7105 on protocol request 18skiloaf. |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7106 So let's not use it until R6. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
7107 #ifdef HAVE_X11XTR6 |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7108 XtSetLanguageProc (NULL, NULL, NULL); |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7109 #endif |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7110 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7111 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7112 int argc = 0; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7113 char *argv[3]; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7114 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7115 argv[0] = ""; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7116 argc = 1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7117 if (xrm_option) |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7118 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7119 argv[argc++] = "-xrm"; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7120 argv[argc++] = xrm_option; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7121 } |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7122 dpy = XtOpenDisplay (Xt_app_con, XSTRING (display_name)->data, |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7123 resource_name, EMACS_CLASS, |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7124 emacs_options, XtNumber (emacs_options), |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7125 &argc, argv); |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
7126 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
7127 #ifdef HAVE_X11XTR6 |
14963
6ac4f300f9b4
Include locale.h if HAVE_SETLOCALE.
Richard M. Stallman <rms@gnu.org>
parents:
14946
diff
changeset
|
7128 /* I think this is to compensate for XtSetLanguageProc. */ |
23115
b992f7bb67d7
(fixup_locale): New function. For now, it resets
Paul Eggert <eggert@twinsun.com>
parents:
23107
diff
changeset
|
7129 fixup_locale (); |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
7130 #endif |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7131 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7132 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7133 #else /* not USE_X_TOOLKIT */ |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7134 #ifdef HAVE_X11R5 |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7135 XSetLocaleModifiers (""); |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
7136 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7137 dpy = XOpenDisplay (XSTRING (display_name)->data); |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
7138 #endif /* not USE_X_TOOLKIT */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7139 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7140 /* Detect failure. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7141 if (dpy == 0) |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7142 { |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7143 UNBLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7144 return 0; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7145 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7146 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7147 /* We have definitely succeeded. Record the new connection. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7148 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7149 dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7150 |
11015 | 7151 #ifdef MULTI_KBOARD |
7152 { | |
7153 struct x_display_info *share; | |
7154 Lisp_Object tail; | |
7155 | |
7156 for (share = x_display_list, tail = x_display_name_list; share; | |
7157 share = share->next, tail = XCONS (tail)->cdr) | |
7158 if (same_x_server (XSTRING (XCONS (XCONS (tail)->car)->car)->data, | |
7159 XSTRING (display_name)->data)) | |
7160 break; | |
7161 if (share) | |
7162 dpyinfo->kboard = share->kboard; | |
7163 else | |
7164 { | |
7165 dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | |
7166 init_kboard (dpyinfo->kboard); | |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7167 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7168 { |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7169 char *vendor = ServerVendor (dpy); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7170 dpyinfo->kboard->Vsystem_key_alist |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7171 = call1 (Qvendor_specific_keysyms, |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7172 build_string (vendor ? vendor : "")); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7173 } |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7174 |
11015 | 7175 dpyinfo->kboard->next_kboard = all_kboards; |
7176 all_kboards = dpyinfo->kboard; | |
11544
cc965273a769
(x_term_init): If the previous kboard was the dummy one,
Karl Heuer <kwzh@gnu.org>
parents:
11536
diff
changeset
|
7177 /* Don't let the initial kboard remain current longer than necessary. |
cc965273a769
(x_term_init): If the previous kboard was the dummy one,
Karl Heuer <kwzh@gnu.org>
parents:
11536
diff
changeset
|
7178 That would cause problems if a file loaded on startup tries to |
cc965273a769
(x_term_init): If the previous kboard was the dummy one,
Karl Heuer <kwzh@gnu.org>
parents:
11536
diff
changeset
|
7179 prompt in the minibuffer. */ |
cc965273a769
(x_term_init): If the previous kboard was the dummy one,
Karl Heuer <kwzh@gnu.org>
parents:
11536
diff
changeset
|
7180 if (current_kboard == initial_kboard) |
cc965273a769
(x_term_init): If the previous kboard was the dummy one,
Karl Heuer <kwzh@gnu.org>
parents:
11536
diff
changeset
|
7181 current_kboard = dpyinfo->kboard; |
11015 | 7182 } |
7183 dpyinfo->kboard->reference_count++; | |
7184 } | |
10652
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7185 #endif |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7186 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7187 /* Put this display on the chain. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7188 dpyinfo->next = x_display_list; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7189 x_display_list = dpyinfo; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7190 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7191 /* Put it on x_display_name_list as well, to keep them parallel. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7192 x_display_name_list = Fcons (Fcons (display_name, Qnil), |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7193 x_display_name_list); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7194 dpyinfo->name_list_element = XCONS (x_display_name_list)->car; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7195 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7196 dpyinfo->display = dpy; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7197 |
286 | 7198 #if 0 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7199 XSetAfterFunction (x_current_display, x_trace_wire); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7200 #endif /* ! 0 */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7201 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7202 dpyinfo->x_id_name |
21244
50929073a0ba
Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents:
21017
diff
changeset
|
7203 = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name)) |
50929073a0ba
Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents:
21017
diff
changeset
|
7204 + STRING_BYTES (XSTRING (Vsystem_name)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7205 + 2); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7206 sprintf (dpyinfo->x_id_name, "%s@%s", |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7207 XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
7208 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
7209 /* Figure out which modifier bits mean what. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7210 x_find_modifier_meanings (dpyinfo); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
7211 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7212 /* Get the scroll bar cursor. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7213 dpyinfo->vertical_scroll_bar_cursor |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7214 = XCreateFontCursor (dpyinfo->display, XC_sb_v_double_arrow); |
2195
b20bb441f47f
(Xatom_wm_change_state): Define here.
Richard M. Stallman <rms@gnu.org>
parents:
2127
diff
changeset
|
7215 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7216 xrdb = x_load_resources (dpyinfo->display, xrm_option, |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7217 resource_name, EMACS_CLASS); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7218 #ifdef HAVE_XRMSETDATABASE |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7219 XrmSetDatabase (dpyinfo->display, xrdb); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7220 #else |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7221 dpyinfo->display->db = xrdb; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7222 #endif |
11162
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
7223 /* Put the rdb where we can find it in a way that works on |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7224 all versions. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7225 dpyinfo->xrdb = xrdb; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7226 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7227 dpyinfo->screen = ScreenOfDisplay (dpyinfo->display, |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7228 DefaultScreen (dpyinfo->display)); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7229 dpyinfo->visual = select_visual (dpyinfo->display, dpyinfo->screen, |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7230 &dpyinfo->n_planes); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7231 dpyinfo->height = HeightOfScreen (dpyinfo->screen); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7232 dpyinfo->width = WidthOfScreen (dpyinfo->screen); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7233 dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7234 dpyinfo->grabbed = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7235 dpyinfo->reference_count = 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7236 dpyinfo->icon_bitmap_id = -1; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7237 dpyinfo->n_fonts = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7238 dpyinfo->font_table_size = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7239 dpyinfo->bitmaps = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7240 dpyinfo->bitmaps_size = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7241 dpyinfo->bitmaps_last = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7242 dpyinfo->scratch_cursor_gc = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7243 dpyinfo->mouse_face_mouse_frame = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7244 dpyinfo->mouse_face_deferred_gc = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7245 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7246 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7247 dpyinfo->mouse_face_face_id = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7248 dpyinfo->mouse_face_window = Qnil; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7249 dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7250 dpyinfo->mouse_face_defer = 0; |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
7251 dpyinfo->x_focus_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
7252 dpyinfo->x_focus_event_frame = 0; |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
7253 dpyinfo->x_highlight_frame = 0; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7254 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7255 dpyinfo->Xatom_wm_protocols |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7256 = XInternAtom (dpyinfo->display, "WM_PROTOCOLS", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7257 dpyinfo->Xatom_wm_take_focus |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7258 = XInternAtom (dpyinfo->display, "WM_TAKE_FOCUS", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7259 dpyinfo->Xatom_wm_save_yourself |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7260 = XInternAtom (dpyinfo->display, "WM_SAVE_YOURSELF", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7261 dpyinfo->Xatom_wm_delete_window |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7262 = XInternAtom (dpyinfo->display, "WM_DELETE_WINDOW", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7263 dpyinfo->Xatom_wm_change_state |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7264 = XInternAtom (dpyinfo->display, "WM_CHANGE_STATE", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7265 dpyinfo->Xatom_wm_configure_denied |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7266 = XInternAtom (dpyinfo->display, "WM_CONFIGURE_DENIED", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7267 dpyinfo->Xatom_wm_window_moved |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7268 = XInternAtom (dpyinfo->display, "WM_MOVED", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7269 dpyinfo->Xatom_editres |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7270 = XInternAtom (dpyinfo->display, "Editres", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7271 dpyinfo->Xatom_CLIPBOARD |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7272 = XInternAtom (dpyinfo->display, "CLIPBOARD", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7273 dpyinfo->Xatom_TIMESTAMP |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7274 = XInternAtom (dpyinfo->display, "TIMESTAMP", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7275 dpyinfo->Xatom_TEXT |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7276 = XInternAtom (dpyinfo->display, "TEXT", False); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7277 dpyinfo->Xatom_COMPOUND_TEXT |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7278 = XInternAtom (dpyinfo->display, "COMPOUND_TEXT", False); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7279 dpyinfo->Xatom_DELETE |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7280 = XInternAtom (dpyinfo->display, "DELETE", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7281 dpyinfo->Xatom_MULTIPLE |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7282 = XInternAtom (dpyinfo->display, "MULTIPLE", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7283 dpyinfo->Xatom_INCR |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7284 = XInternAtom (dpyinfo->display, "INCR", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7285 dpyinfo->Xatom_EMACS_TMP |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7286 = XInternAtom (dpyinfo->display, "_EMACS_TMP_", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7287 dpyinfo->Xatom_TARGETS |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7288 = XInternAtom (dpyinfo->display, "TARGETS", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7289 dpyinfo->Xatom_NULL |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7290 = XInternAtom (dpyinfo->display, "NULL", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7291 dpyinfo->Xatom_ATOM_PAIR |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7292 = XInternAtom (dpyinfo->display, "ATOM_PAIR", False); |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7293 /* For properties of font. */ |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7294 dpyinfo->Xatom_PIXEL_SIZE |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7295 = XInternAtom (dpyinfo->display, "PIXEL_SIZE", False); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7296 dpyinfo->Xatom_MULE_BASELINE_OFFSET |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7297 = XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7298 dpyinfo->Xatom_MULE_RELATIVE_COMPOSE |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7299 = XInternAtom (dpyinfo->display, "_MULE_RELATIVE_COMPOSE", False); |
17103
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
7300 dpyinfo->Xatom_MULE_DEFAULT_ASCENT |
7cde34a6424e
(dumpglyphs): Pay attention to characters registered in
Kenichi Handa <handa@m17n.org>
parents:
17050
diff
changeset
|
7301 = XInternAtom (dpyinfo->display, "_MULE_DEFAULT_ASCENT", False); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7302 |
11162
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
7303 dpyinfo->cut_buffers_initialized = 0; |
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
7304 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7305 connection = ConnectionNumber (dpyinfo->display); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7306 dpyinfo->connection = connection; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7307 |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7308 { |
18705
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
7309 char null_bits[1]; |
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
7310 |
c4f2eab8e736
(x_term_init): Don't use initializer for null_bits.
Richard M. Stallman <rms@gnu.org>
parents:
18646
diff
changeset
|
7311 null_bits[0] = 0x00; |
17050
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7312 |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7313 dpyinfo->null_pixel |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7314 = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7315 null_bits, 1, 1, (long) 0, (long) 0, |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7316 1); |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7317 } |
1e5fa2dc98cf
Include charset.h, ccl.h, and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16898
diff
changeset
|
7318 |
9572 | 7319 #ifdef subprocesses |
7320 /* This is only needed for distinguishing keyboard and process input. */ | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7321 if (connection != 0) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7322 add_keyboard_wait_descriptor (connection); |
9572 | 7323 #endif |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7324 |
4147
c6657758fb6f
* xterm.c (x_term_init): Adjust message printed when we can't
Jim Blandy <jimb@redhat.com>
parents:
3951
diff
changeset
|
7325 #ifndef F_SETOWN_BUG |
286 | 7326 #ifdef F_SETOWN |
7327 #ifdef F_SETOWN_SOCK_NEG | |
4683
6a5197116086
(x_term_init): Call change_keyboard_wait_descriptor,
Richard M. Stallman <rms@gnu.org>
parents:
4630
diff
changeset
|
7328 /* stdin is a socket here */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7329 fcntl (connection, F_SETOWN, -getpid ()); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7330 #else /* ! defined (F_SETOWN_SOCK_NEG) */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7331 fcntl (connection, F_SETOWN, getpid ()); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7332 #endif /* ! defined (F_SETOWN_SOCK_NEG) */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7333 #endif /* ! defined (F_SETOWN) */ |
4147
c6657758fb6f
* xterm.c (x_term_init): Adjust message printed when we can't
Jim Blandy <jimb@redhat.com>
parents:
3951
diff
changeset
|
7334 #endif /* F_SETOWN_BUG */ |
286 | 7335 |
7336 #ifdef SIGIO | |
11994
b4dd8ca308dd
(x_term_init): Call init_sigio only if interrupt_input.
Karl Heuer <kwzh@gnu.org>
parents:
11988
diff
changeset
|
7337 if (interrupt_input) |
b4dd8ca308dd
(x_term_init): Call init_sigio only if interrupt_input.
Karl Heuer <kwzh@gnu.org>
parents:
11988
diff
changeset
|
7338 init_sigio (connection); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7339 #endif /* ! defined (SIGIO) */ |
286 | 7340 |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7341 #ifdef USE_LUCID |
19021
6f150e46a5fd
(x_term_init) [! HAVE_X11R5]: Don't try to use XtCvtStringToFont.
Richard M. Stallman <rms@gnu.org>
parents:
18996
diff
changeset
|
7342 #ifdef HAVE_X11R5 /* It seems X11R4 lacks XtCvtStringToFont, and XPointer. */ |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7343 /* Make sure that we have a valid font for dialog boxes |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7344 so that Xt does not crash. */ |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7345 { |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7346 Display *dpy = dpyinfo->display; |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7347 XrmValue d, fr, to; |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7348 Font font; |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7349 int count; |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7350 |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7351 d.addr = (XPointer)&dpy; |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7352 d.size = sizeof (Display *); |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7353 fr.addr = XtDefaultFont; |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7354 fr.size = sizeof (XtDefaultFont); |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7355 to.size = sizeof (Font *); |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7356 to.addr = (XPointer)&font; |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7357 count = x_catch_errors (dpy); |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7358 if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7359 abort (); |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7360 if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7361 XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7362 x_uncatch_errors (dpy, count); |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7363 } |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7364 #endif |
19021
6f150e46a5fd
(x_term_init) [! HAVE_X11R5]: Don't try to use XtCvtStringToFont.
Richard M. Stallman <rms@gnu.org>
parents:
18996
diff
changeset
|
7365 #endif |
15904
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7366 |
a31cfab57f69
(x_term_init): If the default Xt font does not exist on
Richard M. Stallman <rms@gnu.org>
parents:
15808
diff
changeset
|
7367 |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7368 UNBLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
7369 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7370 return dpyinfo; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7371 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7372 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7373 /* Get rid of display DPYINFO, assuming all frames are already gone, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7374 and without sending any more commands to the X server. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7375 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7376 void |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7377 x_delete_display (dpyinfo) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7378 struct x_display_info *dpyinfo; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7379 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7380 delete_keyboard_wait_descriptor (dpyinfo->connection); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7381 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7382 /* Discard this display from x_display_name_list and x_display_list. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7383 We can't use Fdelq because that can quit. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7384 if (! NILP (x_display_name_list) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7385 && EQ (XCONS (x_display_name_list)->car, dpyinfo->name_list_element)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7386 x_display_name_list = XCONS (x_display_name_list)->cdr; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7387 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7388 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7389 Lisp_Object tail; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7390 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7391 tail = x_display_name_list; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7392 while (CONSP (tail) && CONSP (XCONS (tail)->cdr)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7393 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7394 if (EQ (XCONS (XCONS (tail)->cdr)->car, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7395 dpyinfo->name_list_element)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7396 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7397 XCONS (tail)->cdr = XCONS (XCONS (tail)->cdr)->cdr; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7398 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7399 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7400 tail = XCONS (tail)->cdr; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7401 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7402 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7403 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7404 if (x_display_list == dpyinfo) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7405 x_display_list = dpyinfo->next; |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7406 else |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7407 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7408 struct x_display_info *tail; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7409 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7410 for (tail = x_display_list; tail; tail = tail->next) |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7411 if (tail->next == dpyinfo) |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7412 tail->next = tail->next->next; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7413 } |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7414 |
12771
6f07c79d9a05
(x_delete_display) [AIX]: Don't call XRmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
12750
diff
changeset
|
7415 #ifndef USE_X_TOOLKIT /* I'm told Xt does this itself. */ |
6f07c79d9a05
(x_delete_display) [AIX]: Don't call XRmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
12750
diff
changeset
|
7416 #ifndef AIX /* On AIX, XCloseDisplay calls this. */ |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7417 XrmDestroyDatabase (dpyinfo->xrdb); |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7418 #endif |
12771
6f07c79d9a05
(x_delete_display) [AIX]: Don't call XRmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
12750
diff
changeset
|
7419 #endif |
11015 | 7420 #ifdef MULTI_KBOARD |
7421 if (--dpyinfo->kboard->reference_count == 0) | |
11166
0e9fad3ccf03
(x_delete_display): Extract kboard deletion, for modularity.
Karl Heuer <kwzh@gnu.org>
parents:
11162
diff
changeset
|
7422 delete_kboard (dpyinfo->kboard); |
10652
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7423 #endif |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7424 xfree (dpyinfo->font_table); |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7425 xfree (dpyinfo->x_id_name); |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
7426 xfree (dpyinfo); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7427 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7428 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7429 /* Set up use of X before we make the first connection. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7430 |
21514 | 7431 void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7432 x_initialize () |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7433 { |
771 | 7434 clear_frame_hook = XTclear_frame; |
286 | 7435 clear_end_of_line_hook = XTclear_end_of_line; |
7436 ins_del_lines_hook = XTins_del_lines; | |
7437 change_line_highlight_hook = XTchange_line_highlight; | |
7438 insert_glyphs_hook = XTinsert_glyphs; | |
7439 write_glyphs_hook = XTwrite_glyphs; | |
7440 delete_glyphs_hook = XTdelete_glyphs; | |
7441 ring_bell_hook = XTring_bell; | |
7442 reset_terminal_modes_hook = XTreset_terminal_modes; | |
7443 set_terminal_modes_hook = XTset_terminal_modes; | |
7444 update_begin_hook = XTupdate_begin; | |
7445 update_end_hook = XTupdate_end; | |
7446 set_terminal_window_hook = XTset_terminal_window; | |
7447 read_socket_hook = XTread_socket; | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
7448 frame_up_to_date_hook = XTframe_up_to_date; |
286 | 7449 cursor_to_hook = XTcursor_to; |
7450 reassert_line_highlight_hook = XTreassert_line_highlight; | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
7451 mouse_position_hook = XTmouse_position; |
771 | 7452 frame_rehighlight_hook = XTframe_rehighlight; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
7453 frame_raise_lower_hook = XTframe_raise_lower; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7454 set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7455 condemn_scroll_bars_hook = XTcondemn_scroll_bars; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7456 redeem_scroll_bar_hook = XTredeem_scroll_bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7457 judge_scroll_bars_hook = XTjudge_scroll_bars; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
7458 |
771 | 7459 scroll_region_ok = 1; /* we'll scroll partial frames */ |
286 | 7460 char_ins_del_ok = 0; /* just as fast to write the line */ |
7461 line_ins_del_ok = 1; /* we'll just blt 'em */ | |
7462 fast_clear_end_of_line = 1; /* X does this well */ | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
7463 memory_below_frame = 0; /* we don't remember what scrolls |
286 | 7464 off the bottom */ |
7465 baud_rate = 19200; | |
7466 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7467 x_noop_count = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7468 |
4476
e7de1b007447
(x_term_init): Set the hooks before we call Fset_input_mode.
Richard M. Stallman <rms@gnu.org>
parents:
4304
diff
changeset
|
7469 /* Try to use interrupt input; if we can't, then start polling. */ |
e7de1b007447
(x_term_init): Set the hooks before we call Fset_input_mode.
Richard M. Stallman <rms@gnu.org>
parents:
4304
diff
changeset
|
7470 Fset_input_mode (Qt, Qnil, Qt, Qnil); |
e7de1b007447
(x_term_init): Set the hooks before we call Fset_input_mode.
Richard M. Stallman <rms@gnu.org>
parents:
4304
diff
changeset
|
7471 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7472 #ifdef USE_X_TOOLKIT |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7473 XtToolkitInitialize (); |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7474 Xt_app_con = XtCreateApplicationContext (); |
12494
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
7475 XtAppSetFallbackResources (Xt_app_con, Xt_default_resources); |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7476 #endif |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
7477 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
7478 /* Note that there is no real way portable across R3/R4 to get the |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7479 original error handler. */ |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7480 XSetErrorHandler (x_error_handler); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7481 XSetIOErrorHandler (x_io_error_quitter); |
286 | 7482 |
7483 /* Disable Window Change signals; they are handled by X events. */ | |
7484 #ifdef SIGWINCH | |
7485 signal (SIGWINCH, SIG_DFL); | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7486 #endif /* ! defined (SIGWINCH) */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
7487 |
10743
6977bff3ff38
(x_display_bar_cursor): Use frame's cursor_width.
Richard M. Stallman <rms@gnu.org>
parents:
10652
diff
changeset
|
7488 signal (SIGPIPE, x_connection_signal); |
286 | 7489 } |
395 | 7490 |
7491 void | |
7492 syms_of_xterm () | |
7493 { | |
17607
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7494 staticpro (&x_error_message_string); |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7495 x_error_message_string = Qnil; |
251e103f2d53
(XTmouse_position, x_term_init):
Richard M. Stallman <rms@gnu.org>
parents:
17575
diff
changeset
|
7496 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7497 staticpro (&x_display_name_list); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
7498 x_display_name_list = Qnil; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
7499 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
7500 staticpro (&last_mouse_scroll_bar); |
4948
7653c78ac0c1
(syms_of_xterm): Initialize last_mouse_scroll_bar.
Richard M. Stallman <rms@gnu.org>
parents:
4909
diff
changeset
|
7501 last_mouse_scroll_bar = Qnil; |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7502 |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7503 staticpro (&Qvendor_specific_keysyms); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
7504 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); |
15803
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
7505 |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
7506 staticpro (&last_mouse_press_frame); |
f214673e68a8
(XTread_socket): Pass keys in menu bar to toolkit alone
Richard M. Stallman <rms@gnu.org>
parents:
15794
diff
changeset
|
7507 last_mouse_press_frame = Qnil; |
395 | 7508 } |
14694
41de9b2640a1
(X_CONNECTION_LOCK_FLAG): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
14692
diff
changeset
|
7509 |
41de9b2640a1
(X_CONNECTION_LOCK_FLAG): New macro.
Richard M. Stallman <rms@gnu.org>
parents:
14692
diff
changeset
|
7510 #endif /* not HAVE_X_WINDOWS */ |