Mercurial > emacs
annotate src/xterm.c @ 14074:f15db8536fdd
(Ffile_name_directory, Ffile_name_nondirectory, Ffile_name_as_directory,
Fdirectory_file_name, Fexpand_file_name, Fsubstitute_in_file_name,
Fcopy_file, Fmake_directory_internal, Fdelete_directory, Fdelete_file,
Frename_file, Fadd_name_to_file, Fdefine_logical_name, Ffile_modes,
Fset_file_modes, Fset_default_file_modes, Fdo_auto_save, Fread_file_name):
Harmonize arguments with documentation.
author | Erik Naggum <erik@naggum.no> |
---|---|
date | Tue, 09 Jan 1996 00:32:04 +0000 |
parents | dceb33c07f9e |
children | 65e51231924e |
rev | line source |
---|---|
286 | 1 /* X Communication module for terminals which understand the X protocol. |
11235 | 2 Copyright (C) 1989, 1993, 1994, 1995 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 | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
20 /* 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
|
21 |
2977
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
22 /* 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
|
23 /* 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
|
24 /* 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
|
25 #include <signal.h> |
ddcad1457cd5
Move signal.h and stdio.h before config.h.
Richard M. Stallman <rms@gnu.org>
parents:
2958
diff
changeset
|
26 |
4696
1fc792473491
Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents:
4683
diff
changeset
|
27 #include <config.h> |
286 | 28 |
7902
22b9aaaf0302
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7870
diff
changeset
|
29 #include <stdio.h> |
22b9aaaf0302
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7870
diff
changeset
|
30 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
31 /* Need syssignal.h for various externs and definitions that may be required |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
32 by some configurations for calls to signal later in this source file. */ |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
33 #include "syssignal.h" |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
34 |
286 | 35 #ifdef HAVE_X_WINDOWS |
36 | |
37 #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
|
38 #include "blockinput.h" |
286 | 39 |
40 /* This may include sys/types.h, and that somehow loses | |
41 if this is not done before the other system files. */ | |
42 #include "xterm.h" | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
43 #include <X11/cursorfont.h> |
286 | 44 |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
45 #ifndef USG |
286 | 46 /* Load sys/types.h if not already loaded. |
47 In some systems loading it twice is suicidal. */ | |
48 #ifndef makedev | |
49 #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
|
50 #endif /* makedev */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
51 #endif /* USG */ |
286 | 52 |
53 #ifdef BSD | |
54 #include <sys/ioctl.h> | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
55 #endif /* ! defined (BSD) */ |
286 | 56 |
3355
e0c2e8a2ef75
(XTread_socket, case KeyPress) [HPUX]: Test IsModifiedKey.
Richard M. Stallman <rms@gnu.org>
parents:
3284
diff
changeset
|
57 #include "systty.h" |
555 | 58 #include "systime.h" |
286 | 59 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
60 #ifndef INCLUDED_FCNTL |
286 | 61 #include <fcntl.h> |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
62 #endif |
286 | 63 #include <ctype.h> |
64 #include <errno.h> | |
65 #include <setjmp.h> | |
66 #include <sys/stat.h> | |
10366 | 67 /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ |
68 /* #include <sys/param.h> */ | |
286 | 69 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
70 #include "frame.h" |
286 | 71 #include "dispextern.h" |
72 #include "termhooks.h" | |
73 #include "termopts.h" | |
74 #include "termchar.h" | |
75 #if 0 | |
76 #include "sink.h" | |
77 #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
|
78 #endif /* ! 0 */ |
286 | 79 #include "gnu.h" |
80 #include "disptab.h" | |
81 #include "buffer.h" | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
82 #include "window.h" |
8652 | 83 #include "keyboard.h" |
8848 | 84 #include "intervals.h" |
286 | 85 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
86 #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
|
87 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
|
88 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
|
89 #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
|
90 #define HACK_EDITRES |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
91 extern void _XEditResCheckMessages (); |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
92 #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
|
93 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
94 |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
95 #ifndef USE_X_TOOLKIT |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
96 #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
|
97 #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
|
98 #endif |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
99 |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
100 #ifdef USE_X_TOOLKIT |
12189 | 101 #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
|
102 #ifndef XtNinitialState |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
103 #define XtNinitialState "initialState" |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
104 #endif |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
105 #endif |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
106 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
107 #ifdef HAVE_X11XTR6 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
108 /* So we can do setlocale. */ |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
109 #include <locale.h> |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
110 #endif |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
111 |
286 | 112 #define min(a,b) ((a)<(b) ? (a) : (b)) |
113 #define max(a,b) ((a)>(b) ? (a) : (b)) | |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
114 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
115 /* 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
|
116 struct x_display_info *x_display_list; |
286 | 117 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
118 /* 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
|
119 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
|
120 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
|
121 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
|
122 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
|
123 |
2474
86c8a6e08fd4
Fix typo in comment delimiter.
Richard M. Stallman <rms@gnu.org>
parents:
2468
diff
changeset
|
124 /* 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
|
125 This is set by update_begin and looked at by all the |
286 | 126 XT functions. It is zero while not inside an update. |
771 | 127 In that case, the XT functions assume that `selected_frame' |
128 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
|
129 extern struct frame *updating_frame; |
771 | 130 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
131 /* 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
|
132 struct frame *pending_autoraise_frame; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
133 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
134 #ifdef USE_X_TOOLKIT |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
135 /* The application context for Xt use. */ |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
136 XtAppContext Xt_app_con; |
12494
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
137 |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
138 static String Xt_default_resources[] = |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
139 { |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
140 0 |
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
141 }; |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
142 #endif |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
143 |
286 | 144 /* During an update, maximum vpos for ins/del line operations to affect. */ |
145 | |
146 static int flexlines; | |
147 | |
148 /* During an update, nonzero if chars output now should be highlighted. */ | |
149 | |
150 static int highlight; | |
151 | |
152 /* Nominal cursor position -- where to draw output. | |
153 During an update, these are different from the cursor-box position. */ | |
154 | |
155 static int curs_x; | |
156 static int curs_y; | |
157 | |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
158 /* Mouse movement. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
159 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
160 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
|
161 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
|
162 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
|
163 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
|
164 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
|
165 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
|
166 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
|
167 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
|
168 tracking is on, and I suspect only negligibly worse when tracking |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
169 is off. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
170 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
171 The silly O'Reilly & Associates Nutshell guides barely document |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
172 pointer motion hints at all (I think you have to infer how they |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
173 work from an example), and the description of XQueryPointer doesn't |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
174 mention that calling it causes you to get another motion hint from |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
175 the server, which is very important. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
176 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
177 /* 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
|
178 static FRAME_PTR last_mouse_frame; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
179 static XRectangle last_mouse_glyph; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
180 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
181 /* 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
|
182 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
183 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
|
184 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
|
185 an ordinary motion. |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
186 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
187 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
|
188 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
|
189 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
|
190 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
191 /* 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
|
192 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
|
193 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
|
194 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
|
195 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
|
196 it's somewhat accurate. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
197 static Time last_mouse_movement_time; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
198 |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
199 /* 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
|
200 #ifdef __STDC__ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
201 static int volatile input_signal_count; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
202 #else |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
203 static int input_signal_count; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
204 #endif |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
205 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
206 /* 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
|
207 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
|
208 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
209 /* 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
|
210 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
|
211 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
|
212 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
213 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
|
214 |
286 | 215 /* Tells if a window manager is present or not. */ |
216 | |
217 extern Lisp_Object Vx_no_window_manager; | |
218 | |
219 /* Nonzero enables some debugging for the X interface code. */ | |
220 extern int _Xdebug; | |
221 | |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
222 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
|
223 |
286 | 224 extern int errno; |
225 | |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
226 /* 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
|
227 extern int extra_keyboard_modifiers; |
338e4ffdb54b
(XTread_socket): Support extra_keyboard_modifiers.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
228 |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
229 static Lisp_Object Qvendor_specific_keysyms; |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
230 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
231 extern XrmDatabase x_load_resources (); |
286 | 232 |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
233 extern Lisp_Object x_icon_type (); |
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
234 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
235 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
|
236 |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
237 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
|
238 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
|
239 static unsigned int x_x_to_emacs_modifiers (); |
286 | 240 |
7282
2bc4929691e9
(show_mouse_face): Fix test for cursor in highlighted area.
Karl Heuer <kwzh@gnu.org>
parents:
7264
diff
changeset
|
241 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
|
242 static void note_mouse_highlight (); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
243 static void clear_mouse_face (); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
244 static void show_mouse_face (); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
245 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
|
246 |
621 | 247 static int XTcursor_to (); |
248 static int 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
|
249 static int x_io_error_quitter (); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
250 void x_catch_errors (); |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
251 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
|
252 |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
253 #if 0 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
254 /* 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
|
255 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
|
256 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
257 struct record |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
258 { |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
259 char *locus; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
260 int type; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
261 }; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
262 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
263 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
|
264 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
265 int event_record_index; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
266 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
267 record_event (locus, type) |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
268 char *locus; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
269 int type; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
270 { |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
271 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
|
272 event_record_index = 0; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
273 |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
274 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
|
275 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
|
276 event_record_index++; |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
277 } |
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 #endif /* 0 */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
280 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
281 /* 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
|
282 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
283 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
|
284 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
|
285 Display *dpy; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
286 { |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
287 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
|
288 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
289 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
|
290 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
|
291 return dpyinfo; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
292 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
293 return 0; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
294 } |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
295 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
296 /* 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
|
297 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
298 These hooks are called by update_frame at the beginning and end |
771 | 299 of a frame update. We record in `updating_frame' the identity |
300 of the frame being updated, so that the XT... functions do not | |
301 need to take a frame as argument. Most of the XT... functions | |
286 | 302 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
|
303 being XTcursor_to, XTwrite_glyphs and XTreassert_line_highlight. */ |
286 | 304 |
305 static | |
771 | 306 XTupdate_begin (f) |
307 struct frame *f; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
308 { |
286 | 309 int mask; |
310 | |
771 | 311 if (f == 0) |
286 | 312 abort (); |
313 | |
771 | 314 flexlines = f->height; |
286 | 315 highlight = 0; |
316 | |
317 BLOCK_INPUT; | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
318 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
319 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
|
320 { |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
321 /* 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
|
322 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
|
323 |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
324 /* 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
|
325 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
|
326 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
|
327 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
|
328 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
329 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
|
330 { |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
331 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
|
332 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
|
333 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
334 /* 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
|
335 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
|
336 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
|
337 break; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
338 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
339 lastline = f->height; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
340 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
|
341 { |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
342 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
|
343 break; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
344 else |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
345 lastline = i; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
346 } |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
347 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
348 /* 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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 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
|
354 || 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
|
355 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
|
356 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
357 } |
8781
98741404d3e0
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8724
diff
changeset
|
358 |
286 | 359 UNBLOCK_INPUT; |
360 } | |
361 | |
362 static | |
771 | 363 XTupdate_end (f) |
364 struct frame *f; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
365 { |
286 | 366 int mask; |
367 | |
368 BLOCK_INPUT; | |
369 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
370 do_line_dance (); |
771 | 371 x_display_cursor (f, 1); |
372 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
373 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
|
374 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
|
375 #if 0 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
376 /* 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
|
377 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
|
378 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
|
379 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
|
380 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
|
381 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
|
382 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
|
383 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
|
384 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
|
385 #endif |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
386 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
387 XFlush (FRAME_X_DISPLAY (f)); |
286 | 388 UNBLOCK_INPUT; |
389 } | |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
390 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
391 /* 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
|
392 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
393 static |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
394 XTframe_up_to_date (f) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
395 FRAME_PTR f; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
396 { |
13633
3fa66bb82d59
(XTframe_up_to_date): Block and unblock input.
Richard M. Stallman <rms@gnu.org>
parents:
13627
diff
changeset
|
397 BLOCK_INPUT; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
398 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
|
399 || 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
|
400 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
401 note_mouse_highlight (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
|
402 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
|
403 FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_y); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
404 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
|
405 } |
13633
3fa66bb82d59
(XTframe_up_to_date): Block and unblock input.
Richard M. Stallman <rms@gnu.org>
parents:
13627
diff
changeset
|
406 UNBLOCK_INPUT; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
407 } |
286 | 408 |
409 /* External interface to control of standout mode. | |
410 Call this when about to modify line at position VPOS | |
411 and not change whether it is highlighted. */ | |
412 | |
413 XTreassert_line_highlight (new, vpos) | |
414 int new, vpos; | |
415 { | |
416 highlight = new; | |
417 } | |
418 | |
419 /* Call this when about to modify line at position VPOS | |
420 and change whether it is highlighted. */ | |
421 | |
422 static | |
423 XTchange_line_highlight (new_highlight, vpos, first_unused_hpos) | |
424 int new_highlight, vpos, first_unused_hpos; | |
425 { | |
426 highlight = new_highlight; | |
427 XTcursor_to (vpos, 0); | |
771 | 428 XTclear_end_of_line (updating_frame->width); |
286 | 429 } |
430 | |
431 /* This is used when starting Emacs and when restarting after suspend. | |
432 When starting Emacs, no X window is mapped. And nothing must be done | |
433 to Emacs's own window if it is suspended (though that rarely happens). */ | |
434 | |
435 static | |
436 XTset_terminal_modes () | |
437 { | |
438 } | |
439 | |
440 /* This is called when exiting or suspending Emacs. | |
441 Exiting will make the X-windows go away, and suspending | |
442 requires no action. */ | |
443 | |
444 static | |
445 XTreset_terminal_modes () | |
446 { | |
771 | 447 /* XTclear_frame (); */ |
286 | 448 } |
449 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
450 /* 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
|
451 This is where display update commands will take effect. |
286 | 452 This does not affect the place where the cursor-box is displayed. */ |
453 | |
621 | 454 static int |
286 | 455 XTcursor_to (row, col) |
456 register int row, col; | |
457 { | |
458 int mask; | |
459 int orow = row; | |
460 | |
461 curs_x = col; | |
462 curs_y = row; | |
463 | |
771 | 464 if (updating_frame == 0) |
286 | 465 { |
466 BLOCK_INPUT; | |
771 | 467 x_display_cursor (selected_frame, 1); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
468 XFlush (FRAME_X_DISPLAY (selected_frame)); |
286 | 469 UNBLOCK_INPUT; |
470 } | |
471 } | |
472 | |
473 /* Display a sequence of N glyphs found at GP. | |
474 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
|
475 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
|
476 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
|
477 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
|
478 don't alter the background. |
286 | 479 |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
480 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
|
481 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
482 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
|
483 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
|
484 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
|
485 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
|
486 to which we can actually apply intern_face. |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
487 Call this function with input blocked. */ |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
488 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
489 #if 1 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
490 /* 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
|
491 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
492 static void |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
493 dumpglyphs (f, left, top, gp, n, hl, just_foreground) |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
494 struct frame *f; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
495 int left, top; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
496 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
|
497 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
|
498 int hl; |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
499 int just_foreground; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
500 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
501 /* Holds characters to be displayed. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
502 char *buf = (char *) alloca (f->width * sizeof (*buf)); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
503 register char *cp; /* Steps through buf[]. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
504 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
|
505 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
|
506 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
|
507 int orig_left = left; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
508 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
509 while (n > 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
510 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
511 /* 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
|
512 int cf, len; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
513 int g = *gp; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
514 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
515 GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
6413
6eb1a3cf0371
(dumpglyphs): Use the fast macros.
Karl Heuer <kwzh@gnu.org>
parents:
6356
diff
changeset
|
516 cf = FAST_GLYPH_FACE (g); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
517 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
518 /* Find the run of consecutive glyphs with the same face-code. |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
519 Extract their character codes into BUF. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
520 cp = buf; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
521 while (n > 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
522 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
523 g = *gp; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
524 GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
6413
6eb1a3cf0371
(dumpglyphs): Use the fast macros.
Karl Heuer <kwzh@gnu.org>
parents:
6356
diff
changeset
|
525 if (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
|
526 break; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
527 |
6413
6eb1a3cf0371
(dumpglyphs): Use the fast macros.
Karl Heuer <kwzh@gnu.org>
parents:
6356
diff
changeset
|
528 *cp++ = FAST_GLYPH_CHAR (g); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
529 --n; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
530 ++gp; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
531 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
532 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
533 /* LEN gets the length of the run. */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
534 len = cp - buf; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
535 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
536 /* 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
|
537 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
|
538 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
539 struct face *face = FRAME_DEFAULT_FACE (f); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
540 XFontStruct *font = FACE_FONT (face); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
541 GC gc = FACE_GC (face); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
542 int stippled = 0; |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
543 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
544 /* 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
|
545 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
|
546 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
|
547 |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
548 /* 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
|
549 if (cf != 0) |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
550 { |
5719
d3074ff90741
(dumpglyphs): Don't crash for invalid face code.
Richard M. Stallman <rms@gnu.org>
parents:
5686
diff
changeset
|
551 /* 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
|
552 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
|
553 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
|
554 || 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
|
555 cf = 0; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
556 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
557 if (cf == 1) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
558 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
|
559 else |
3883
b9e5a869b33e
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3839
diff
changeset
|
560 face = intern_face (f, FRAME_COMPUTED_FACES (f) [cf]); |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
561 font = FACE_FONT (face); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
562 gc = FACE_GC (face); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
563 if (FACE_STIPPLE (face)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
564 stippled = 1; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
565 } |
2785
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
566 |
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
567 /* 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
|
568 else if (hl == 0) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
569 ; |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
570 else if (hl == 1) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
571 { |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
572 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
|
573 font = FACE_FONT (face); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
574 gc = FACE_GC (face); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
575 if (FACE_STIPPLE (face)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
576 stippled = 1; |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
577 } |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
578 |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
579 #define FACE_DEFAULT (~0) |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
580 |
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
581 /* 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
|
582 if (hl == 2) |
2840
12299f73584e
(dumpglyphs): Create a temporary merged gc
Richard M. Stallman <rms@gnu.org>
parents:
2785
diff
changeset
|
583 { |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
584 /* The cursor overrides stippling. */ |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
585 stippled = 0; |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
586 |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
587 if ((!face->font |
11259
81f5d9eb1484
(dumpglyphs): Cast FACE_DEFAULT to (XFontStruct *)
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
588 || face->font == (XFontStruct *) FACE_DEFAULT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
589 || face->font == 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
|
590 && face->background == f->output_data.x->background_pixel |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
591 && face->foreground == f->output_data.x->foreground_pixel) |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
592 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
593 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
|
594 } |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
595 /* 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
|
596 else |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
597 { |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
598 XGCValues xgcv; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
599 unsigned long mask; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
600 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
601 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
|
602 xgcv.foreground = face->background; |
5987
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
603 /* If the glyph would be invisible, |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
604 try a different foreground. */ |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
605 if (xgcv.foreground == xgcv.background) |
7469
24b292242269
(dumpglyphs): For cursor foreground, try the
Richard M. Stallman <rms@gnu.org>
parents:
7415
diff
changeset
|
606 xgcv.foreground = face->foreground; |
5987
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
607 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
|
608 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
|
609 if (xgcv.foreground == xgcv.background) |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
610 xgcv.foreground = face->foreground; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
611 /* 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
|
612 if (xgcv.background == face->background |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
613 && xgcv.foreground == face->foreground) |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
614 { |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
615 xgcv.background = face->foreground; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
616 xgcv.foreground = face->background; |
040bdc2fec7c
(dumpglyphs): Try various alternatives for foreground color
Richard M. Stallman <rms@gnu.org>
parents:
5986
diff
changeset
|
617 } |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
618 xgcv.font = face->font->fid; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
619 xgcv.graphics_exposures = 0; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
620 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
621 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
|
622 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
|
623 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
|
624 mask, &xgcv); |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
625 else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
626 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
|
627 = 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
|
628 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
|
629 #if 0 |
7935
f15e1a058e93
(scratch_cursor_gc): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7916
diff
changeset
|
630 /* 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
|
631 if necessary. */ |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
632 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
|
633 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
|
634 #endif |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
635 } |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
636 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
637 |
11259
81f5d9eb1484
(dumpglyphs): Cast FACE_DEFAULT to (XFontStruct *)
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
638 if (font == (XFontStruct *) FACE_DEFAULT) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
639 font = f->output_data.x->font; |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
640 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
641 if (just_foreground) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
642 XDrawString (FRAME_X_DISPLAY (f), window, gc, |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
643 left, top + FONT_BASE (font), buf, len); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
644 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
645 { |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
646 if (stippled) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
647 { |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
648 /* Turn stipple on. */ |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
649 XSetFillStyle (FRAME_X_DISPLAY (f), gc, FillOpaqueStippled); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
650 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
651 /* Draw stipple on background. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
652 XFillRectangle (FRAME_X_DISPLAY (f), window, gc, |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
653 left, top, |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
654 FONT_WIDTH (font) * len, |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
655 FONT_HEIGHT (font)); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
656 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
657 /* Turn stipple off. */ |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
658 XSetFillStyle (FRAME_X_DISPLAY (f), gc, FillSolid); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
659 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
660 /* Draw the text, solidly, onto the stipple pattern. */ |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
661 XDrawString (FRAME_X_DISPLAY (f), window, gc, |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
662 left, top + FONT_BASE (font), buf, len); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
663 } |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
664 else |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
665 XDrawImageString (FRAME_X_DISPLAY (f), window, gc, |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
666 left, top + FONT_BASE (font), buf, len); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
667 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
668 /* Clear the rest of the line's height. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
669 if (f->output_data.x->line_height != FONT_HEIGHT (font)) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
670 XClearArea (FRAME_X_DISPLAY (f), window, left, |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
671 top + FONT_HEIGHT (font), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
672 FONT_WIDTH (font) * len, |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
673 /* This is how many pixels of height |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
674 we have to clear. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
675 f->output_data.x->line_height - FONT_HEIGHT (font), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
676 False); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
677 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
678 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
679 #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
|
680 which often is not up to date yet. */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
681 if (!just_foreground) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
682 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
683 if (left == orig_left) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
684 redraw_previous_char (f, PIXEL_TO_CHAR_COL (f, left), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
685 PIXEL_TO_CHAR_ROW (f, top), hl == 1); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
686 if (n == 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
687 redraw_following_char (f, PIXEL_TO_CHAR_COL (f, left + len * FONT_WIDTH (font)), |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
688 PIXEL_TO_CHAR_ROW (f, top), hl == 1); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
689 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
690 #endif |
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 /* 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
|
693 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
|
694 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
|
695 { |
2785
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
696 int underline_position = 1; |
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
697 |
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
698 if (font->descent <= underline_position) |
55e9c556bbf8
* xterm.c (dumpglyphs): Give the cursor higher priority than the
Jim Blandy <jimb@redhat.com>
parents:
2732
diff
changeset
|
699 underline_position = font->descent - 1; |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
700 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
701 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
|
702 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
|
703 FACE_GC (face), |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
704 left, (top |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
705 + FONT_BASE (font) |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
706 + underline_position), |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
707 len * FONT_WIDTH (font), 1); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
708 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
709 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
710 left += len * FONT_WIDTH (font); |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
711 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
712 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
713 } |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
714 #endif /* 1 */ |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
715 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
716 #if 0 |
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
717 /* This is the old single-face code. */ |
286 | 718 |
719 static void | |
771 | 720 dumpglyphs (f, left, top, gp, n, hl, font) |
721 struct frame *f; | |
286 | 722 int left, top; |
723 register GLYPH *gp; /* Points to first GLYPH. */ | |
724 register int n; /* Number of glyphs to display. */ | |
725 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
|
726 XFontStruct *font; |
286 | 727 { |
728 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
|
729 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
|
730 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
|
731 : (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
|
732 : f->output_data.x->normal_gc)); |
286 | 733 |
313 | 734 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
|
735 XDrawImageString16 (FRAME_X_DISPLAY (f), window, drawing_gc, |
313 | 736 left, top + FONT_BASE (font), (XChar2b *) gp, n); |
737 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
|
738 XDrawImageString (FRAME_X_DISPLAY (f), window, drawing_gc, |
313 | 739 left, top + FONT_BASE (font), (char *) gp, n); |
740 else | |
741 /* What size of glyph ARE you using? And does X have a function to | |
742 draw them? */ | |
743 abort (); | |
286 | 744 } |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
745 #endif |
286 | 746 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
747 /* 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
|
748 Advance the cursor over the text. |
286 | 749 Output LEN glyphs at START. |
750 | |
751 `highlight', set up by XTreassert_line_highlight or XTchange_line_highlight, | |
752 controls the pixel values used for foreground and background. */ | |
753 | |
754 static | |
755 XTwrite_glyphs (start, len) | |
756 register GLYPH *start; | |
757 int len; | |
758 { | |
759 register int temp_length; | |
760 int mask; | |
771 | 761 struct frame *f; |
286 | 762 |
763 BLOCK_INPUT; | |
764 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
765 do_line_dance (); |
771 | 766 f = updating_frame; |
767 if (f == 0) | |
286 | 768 { |
771 | 769 f = selected_frame; |
286 | 770 /* If not within an update, |
771 | 771 output at the frame's visible cursor. */ |
772 curs_x = f->cursor_x; | |
773 curs_y = f->cursor_y; | |
286 | 774 } |
775 | |
771 | 776 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
777 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
|
778 CHAR_TO_PIXEL_ROW (f, curs_y), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
779 start, len, highlight, 0); |
429 | 780 |
781 /* If we drew on top of the cursor, note that it is turned off. */ | |
771 | 782 if (curs_y == f->phys_cursor_y |
783 && curs_x <= f->phys_cursor_x | |
784 && curs_x + len > f->phys_cursor_x) | |
785 f->phys_cursor_x = -1; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
786 |
771 | 787 if (updating_frame == 0) |
286 | 788 { |
771 | 789 f->cursor_x += len; |
790 x_display_cursor (f, 1); | |
791 f->cursor_x -= len; | |
286 | 792 } |
793 else | |
794 curs_x += len; | |
795 | |
796 UNBLOCK_INPUT; | |
797 } | |
798 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
799 /* 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
|
800 Erase the current text line from the nominal cursor position (inclusive) |
286 | 801 to column FIRST_UNUSED (exclusive). The idea is that everything |
802 from FIRST_UNUSED onward is already erased. */ | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
803 |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
804 static |
286 | 805 XTclear_end_of_line (first_unused) |
806 register int first_unused; | |
807 { | |
771 | 808 struct frame *f = updating_frame; |
286 | 809 int mask; |
810 | |
771 | 811 if (f == 0) |
286 | 812 abort (); |
813 | |
771 | 814 if (curs_y < 0 || curs_y >= f->height) |
286 | 815 return; |
816 if (first_unused <= 0) | |
817 return; | |
818 | |
771 | 819 if (first_unused >= f->width) |
820 first_unused = f->width; | |
286 | 821 |
822 BLOCK_INPUT; | |
823 | |
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
|
824 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
|
825 |
429 | 826 /* Notice if the cursor will be cleared by this operation. */ |
771 | 827 if (curs_y == f->phys_cursor_y |
828 && curs_x <= f->phys_cursor_x | |
829 && f->phys_cursor_x < first_unused) | |
830 f->phys_cursor_x = -1; | |
286 | 831 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
832 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
|
833 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
|
834 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
|
835 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
|
836 f->output_data.x->line_height, False); |
4277
c3fbb9249f5b
(redraw_previous_char): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4244
diff
changeset
|
837 #if 0 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
838 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
|
839 #endif |
286 | 840 |
841 UNBLOCK_INPUT; | |
842 } | |
843 | |
844 static | |
771 | 845 XTclear_frame () |
286 | 846 { |
847 int mask; | |
771 | 848 struct frame *f = updating_frame; |
849 | |
850 if (f == 0) | |
851 f = selected_frame; | |
852 | |
853 f->phys_cursor_x = -1; /* Cursor not visible. */ | |
286 | 854 curs_x = 0; /* Nominal cursor position is top left. */ |
855 curs_y = 0; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
856 |
286 | 857 BLOCK_INPUT; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
858 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
859 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
|
860 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
861 /* 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
|
862 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
|
863 x_scroll_bar_clear (f); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
864 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
865 XFlush (FRAME_X_DISPLAY (f)); |
286 | 866 UNBLOCK_INPUT; |
867 } | |
868 | |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
869 #if 0 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
870 /* 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
|
871 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
|
872 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
873 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
|
874 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
|
875 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
|
876 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
|
877 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
878 /* 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
|
879 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
|
880 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
|
881 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
|
882 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
|
883 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
884 static void |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
885 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
|
886 FRAME_PTR f; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
887 int x, y; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
888 int highlight_flag; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
889 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
890 /* 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
|
891 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
|
892 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
|
893 (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
|
894 if (x > 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
895 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
896 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
|
897 if (start_x < 0) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
898 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
|
899 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
|
900 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
|
901 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
|
902 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
|
903 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
|
904 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
905 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
|
906 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
|
907 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x], |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
908 x - start_x, highlight_flag, 1); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
909 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
910 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
911 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
912 /* 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
|
913 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
|
914 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
|
915 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
|
916 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
|
917 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
918 static void |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
919 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
|
920 FRAME_PTR f; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
921 int x, y; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
922 int highlight_flag; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
923 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
924 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
|
925 /* 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
|
926 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
|
927 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
|
928 (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
|
929 if (x < limit |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
930 && 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
|
931 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
932 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
|
933 if (end_x > limit) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
934 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
|
935 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
|
936 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
|
937 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
|
938 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
|
939 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
|
940 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
941 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
|
942 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
|
943 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][x], |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
944 end_x - x, highlight_flag, 1); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
945 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
946 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
947 #endif /* 0 */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
948 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
949 #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
|
950 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
951 /* 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
|
952 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
953 static int |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
954 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
|
955 XFontStruct *font; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
956 int c; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
957 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
958 XCharStruct *s; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
959 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
960 /* 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
|
961 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
|
962 s = &font->max_bounds; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
963 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
964 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
965 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
|
966 int row, within; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
967 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
968 /* 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
|
969 row = c >> 8; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
970 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
971 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
|
972 && 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
|
973 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
974 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
975 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
976 /* 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
|
977 c = font->default_char; |
13363
941c37982f37
(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
Karl Heuer <kwzh@gnu.org>
parents:
13232
diff
changeset
|
978 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
|
979 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
980 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
981 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
|
982 && 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
|
983 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
984 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
985 /* 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
|
986 return 0; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
987 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
988 /* 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
|
989 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
|
990 + row * rowlen); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
991 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
992 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
993 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
|
994 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
995 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
996 /* 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
|
997 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
998 static int |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
999 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
|
1000 XFontStruct *font; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1001 int c; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1002 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1003 XCharStruct *s; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1004 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1005 /* 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
|
1006 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
|
1007 s = &font->max_bounds; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1008 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1009 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1010 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
|
1011 int row, within; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1012 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1013 /* 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
|
1014 row = c >> 8; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1015 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1016 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
|
1017 && 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
|
1018 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1019 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1020 { |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1021 /* 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
|
1022 c = font->default_char; |
13363
941c37982f37
(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
Karl Heuer <kwzh@gnu.org>
parents:
13232
diff
changeset
|
1023 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
|
1024 within = c & 0177; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1025 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1026 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
|
1027 && 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
|
1028 && row >= font->min_byte1 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1029 && row <= font->max_byte1)) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1030 /* 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
|
1031 return 0; |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1032 else |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1033 /* 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
|
1034 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
|
1035 + row * rowlen); |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1036 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1037 |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1038 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
|
1039 } |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1040 #endif /* 0 */ |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1041 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1042 /* 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
|
1043 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1044 /* 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
|
1045 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
|
1046 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1047 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1048 /* Subtract the `struct timeval' values X and Y, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1049 storing the result in RESULT. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1050 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
|
1051 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1052 static int |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1053 timeval_subtract (result, x, y) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1054 struct timeval *result, x, y; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1055 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1056 /* 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
|
1057 This is safer because on some systems |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1058 the tv_sec member is unsigned. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1059 if (x.tv_usec < y.tv_usec) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1060 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1061 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
|
1062 y.tv_usec -= 1000000 * nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1063 y.tv_sec += nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1064 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1065 if (x.tv_usec - y.tv_usec > 1000000) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1066 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1067 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
|
1068 y.tv_usec += 1000000 * nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1069 y.tv_sec -= nsec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1070 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1071 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1072 /* 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
|
1073 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
|
1074 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
|
1075 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1076 /* 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
|
1077 return x.tv_sec < y.tv_sec; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1078 } |
286 | 1079 |
771 | 1080 XTflash (f) |
1081 struct frame *f; | |
286 | 1082 { |
1083 BLOCK_INPUT; | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1084 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1085 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1086 GC gc; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1087 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1088 /* 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
|
1089 into background pixels. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1090 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1091 XGCValues values; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1092 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1093 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
|
1094 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
|
1095 ^ f->output_data.x->background_pixel); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1096 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1097 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
|
1098 GCFunction | GCForeground, &values); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1099 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1100 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1101 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1102 int width = PIXEL_WIDTH (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1103 int height = PIXEL_HEIGHT (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1104 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1105 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1106 width/4, height/4, width/2, height/2); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1107 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1108 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1109 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1110 struct timeval wakeup, now; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1111 |
5362
d1fa597d923d
(XTflush): FIx typo in last change.
Richard M. Stallman <rms@gnu.org>
parents:
5357
diff
changeset
|
1112 EMACS_GET_TIME (wakeup); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1113 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1114 /* 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
|
1115 wakeup.tv_usec += 150000; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1116 wakeup.tv_sec += (wakeup.tv_usec / 1000000); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1117 wakeup.tv_usec %= 1000000; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1118 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1119 /* Keep waiting until past the time wakeup. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1120 while (1) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1121 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1122 struct timeval timeout; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1123 |
5362
d1fa597d923d
(XTflush): FIx typo in last change.
Richard M. Stallman <rms@gnu.org>
parents:
5357
diff
changeset
|
1124 EMACS_GET_TIME (timeout); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1125 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1126 /* In effect, timeout = wakeup - timeout. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1127 Break if result would be negative. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1128 if (timeval_subtract (&timeout, wakeup, timeout)) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1129 break; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1130 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1131 /* 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
|
1132 select (0, NULL, NULL, NULL, &timeout); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1133 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1134 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1135 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1136 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1137 width/4, height/4, width/2, height/2); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1138 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
|
1139 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1140 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1141 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1142 |
286 | 1143 UNBLOCK_INPUT; |
1144 } | |
1145 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1146 #endif |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1147 |
286 | 1148 |
1149 /* Make audible bell. */ | |
1150 | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1151 #define XRINGBELL XBell (FRAME_X_DISPLAY (selected_frame), 0) |
286 | 1152 |
1153 XTring_bell () | |
1154 { | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1155 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
|
1156 return; |
48d20a0b229a
(XTring_bell): Do nothing if x_current_connection is 0.
Richard M. Stallman <rms@gnu.org>
parents:
3218
diff
changeset
|
1157 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1158 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
286 | 1159 if (visible_bell) |
771 | 1160 XTflash (selected_frame); |
286 | 1161 else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
1162 #endif |
286 | 1163 { |
1164 BLOCK_INPUT; | |
1165 XRINGBELL; | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1166 XFlush (FRAME_X_DISPLAY (selected_frame)); |
286 | 1167 UNBLOCK_INPUT; |
1168 } | |
1169 } | |
1170 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1171 /* Insert and delete character. |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1172 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
|
1173 off the feature of using them. */ |
286 | 1174 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1175 static |
286 | 1176 XTinsert_glyphs (start, len) |
1177 register char *start; | |
1178 register int len; | |
1179 { | |
1180 abort (); | |
1181 } | |
1182 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1183 static |
286 | 1184 XTdelete_glyphs (n) |
1185 register int n; | |
1186 { | |
1187 abort (); | |
1188 } | |
1189 | |
1190 /* Specify how many text lines, from the top of the window, | |
1191 should be affected by insert-lines and delete-lines operations. | |
1192 This, and those operations, are used only within an update | |
1193 that is bounded by calls to XTupdate_begin and XTupdate_end. */ | |
1194 | |
1195 static | |
1196 XTset_terminal_window (n) | |
1197 register int n; | |
1198 { | |
771 | 1199 if (updating_frame == 0) |
286 | 1200 abort (); |
1201 | |
771 | 1202 if ((n <= 0) || (n > updating_frame->height)) |
1203 flexlines = updating_frame->height; | |
286 | 1204 else |
1205 flexlines = n; | |
1206 } | |
1207 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1208 /* 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
|
1209 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
|
1210 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
|
1211 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
|
1212 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1213 /* Array of line numbers from cached insert/delete operations. |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1214 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
|
1215 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
|
1216 static int *line_dance; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1217 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1218 /* Allocated length of that array. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1219 static int line_dance_len; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1220 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1221 /* Flag indicating whether we've done any work. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1222 static int line_dance_in_progress; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1223 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1224 /* Perform an insert-lines or delete-lines operation, |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1225 inserting N lines or deleting -N lines at vertical position VPOS. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1226 XTins_del_lines (vpos, n) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1227 int vpos, n; |
286 | 1228 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1229 register int fence, i; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1230 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1231 if (vpos >= flexlines) |
286 | 1232 return; |
1233 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1234 if (!line_dance_in_progress) |
286 | 1235 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1236 int ht = updating_frame->height; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1237 if (ht > line_dance_len) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1238 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1239 line_dance = (int *)xrealloc (line_dance, ht * sizeof (int)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1240 line_dance_len = ht; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1241 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1242 for (i = 0; i < ht; ++i) line_dance[i] = i; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1243 line_dance_in_progress = 1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1244 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1245 if (n >= 0) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1246 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1247 if (n > flexlines - vpos) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1248 n = flexlines - vpos; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1249 fence = vpos + n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1250 for (i = flexlines; --i >= fence;) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1251 line_dance[i] = line_dance[i-n]; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1252 for (i = fence; --i >= vpos;) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1253 line_dance[i] = -1; |
286 | 1254 } |
1255 else | |
1256 { | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1257 n = -n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1258 if (n > flexlines - vpos) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1259 n = flexlines - vpos; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1260 fence = flexlines - n; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1261 for (i = vpos; i < fence; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1262 line_dance[i] = line_dance[i + n]; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1263 for (i = fence; i < flexlines; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1264 line_dance[i] = -1; |
286 | 1265 } |
1266 } | |
1267 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1268 /* Here's where we actually move the pixels around. |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1269 Must be called with input blocked. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1270 static void |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1271 do_line_dance () |
286 | 1272 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1273 register int i, j, distance; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1274 register struct frame *f; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1275 int ht; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1276 int intborder; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1277 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1278 /* 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
|
1279 array uninitialized, but we might not even have a frame. */ |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1280 if (!line_dance_in_progress) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1281 return; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1282 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1283 f = updating_frame; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1284 if (f == 0) |
286 | 1285 abort (); |
1286 | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1287 ht = 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
|
1288 intborder = f->output_data.x->internal_border_width; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1289 |
771 | 1290 x_display_cursor (updating_frame, 0); |
286 | 1291 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1292 for (i = 0; i < ht; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1293 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
|
1294 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1295 for (j = i; (j < ht && line_dance[j] != -1 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1296 && line_dance[j]-j == distance); ++j); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1297 /* 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
|
1298 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
|
1299 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
|
1300 intborder, CHAR_TO_PIXEL_ROW (f, i+distance), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1301 f->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
|
1302 (j-i) * f->output_data.x->line_height, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1303 intborder, CHAR_TO_PIXEL_ROW (f, i)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1304 i = j-1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1305 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1306 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1307 for (i = ht; --i >=0; ) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1308 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
|
1309 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1310 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
|
1311 && line_dance[j]-j == distance);); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1312 /* 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
|
1313 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
|
1314 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
|
1315 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1316 f->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
|
1317 (i-j) * f->output_data.x->line_height, |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1318 intborder, CHAR_TO_PIXEL_ROW (f, j+1)); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1319 i = j+1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1320 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1321 |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1322 for (i = 0; i < ht; ++i) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1323 if (line_dance[i] == -1) |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1324 { |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1325 for (j = i; j < ht && line_dance[j] == -1; ++j); |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1326 /* 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
|
1327 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1328 intborder, CHAR_TO_PIXEL_ROW (f, i), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1329 f->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
|
1330 (j-i) * f->output_data.x->line_height, False); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1331 i = j-1; |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1332 } |
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1333 line_dance_in_progress = 0; |
286 | 1334 } |
1335 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1336 /* Support routines for exposure events. */ |
286 | 1337 static void clear_cursor (); |
1338 | |
771 | 1339 /* Output into a rectangle of an X-window (for frame F) |
1340 the characters in f->phys_lines that overlap that rectangle. | |
286 | 1341 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
|
1342 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
|
1343 Call this function with input blocked. */ |
286 | 1344 |
1345 static void | |
771 | 1346 dumprectangle (f, left, top, cols, rows) |
1347 struct frame *f; | |
286 | 1348 register int left, top, cols, rows; |
1349 { | |
771 | 1350 register struct frame_glyphs *active_frame = FRAME_CURRENT_GLYPHS (f); |
286 | 1351 int cursor_cleared = 0; |
1352 int bottom, right; | |
1353 register int y; | |
1354 | |
771 | 1355 if (FRAME_GARBAGED_P (f)) |
286 | 1356 return; |
1357 | |
1358 /* Express rectangle as four edges, instead of position-and-size. */ | |
1359 bottom = top + rows; | |
1360 right = left + cols; | |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1361 |
286 | 1362 /* Convert rectangle edges in pixels to edges in chars. |
1363 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
|
1364 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
|
1365 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
|
1366 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
|
1367 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
|
1368 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
|
1369 right = PIXEL_TO_CHAR_COL (f, right); |
286 | 1370 |
1371 /* Clip the rectangle to what can be visible. */ | |
1372 if (left < 0) | |
1373 left = 0; | |
1374 if (top < 0) | |
1375 top = 0; | |
771 | 1376 if (right > f->width) |
1377 right = f->width; | |
1378 if (bottom > f->height) | |
1379 bottom = f->height; | |
286 | 1380 |
1381 /* Get size in chars of the rectangle. */ | |
1382 cols = right - left; | |
1383 rows = bottom - top; | |
1384 | |
1385 /* If rectangle has zero area, return. */ | |
1386 if (rows <= 0) return; | |
1387 if (cols <= 0) return; | |
1388 | |
1389 /* Turn off the cursor if it is in the rectangle. | |
1390 We will turn it back on afterward. */ | |
771 | 1391 if ((f->phys_cursor_x >= left) && (f->phys_cursor_x < right) |
1392 && (f->phys_cursor_y >= top) && (f->phys_cursor_y < bottom)) | |
286 | 1393 { |
771 | 1394 clear_cursor (f); |
286 | 1395 cursor_cleared = 1; |
1396 } | |
1397 | |
1398 /* Display the text in the rectangle, one text line at a time. */ | |
1399 | |
1400 for (y = top; y < bottom; y++) | |
1401 { | |
771 | 1402 GLYPH *line = &active_frame->glyphs[y][left]; |
1403 | |
1404 if (! active_frame->enable[y] || left > active_frame->used[y]) | |
286 | 1405 continue; |
1406 | |
771 | 1407 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1408 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
|
1409 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
|
1410 line, min (cols, active_frame->used[y] - left), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1411 active_frame->highlight[y], 0); |
286 | 1412 } |
1413 | |
1414 /* Turn the cursor on if we turned it off. */ | |
1415 | |
1416 if (cursor_cleared) | |
771 | 1417 x_display_cursor (f, 1); |
286 | 1418 } |
1419 | |
1420 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
|
1421 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
|
1422 struct frame *f; |
286 | 1423 { |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1424 /* 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
|
1425 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
|
1426 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
|
1427 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
|
1428 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
|
1429 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
|
1430 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
|
1431 UNBLOCK_INPUT; |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
1432 x_update_cursor (f, 1); |
286 | 1433 } |
1434 | |
1435 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
|
1436 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
|
1437 struct frame *f; |
286 | 1438 { |
3943
cbdf67dd68d0
* xterm.c (frame_highlight, frame_unhighlight): Don't test
Jim Blandy <jimb@redhat.com>
parents:
3938
diff
changeset
|
1439 /* 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
|
1440 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
|
1441 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
|
1442 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
|
1443 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
|
1444 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
|
1445 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
|
1446 UNBLOCK_INPUT; |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
1447 x_update_cursor (f, 1); |
286 | 1448 } |
1449 | |
771 | 1450 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
|
1451 static void x_frame_rehighlight (); |
771 | 1452 |
1453 /* The focus has changed. Update the frames as necessary to reflect | |
1454 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
|
1455 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
|
1456 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
|
1457 Lisp code can tell when the switch took place by examining the events. */ |
369 | 1458 |
1459 static void | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1460 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
|
1461 struct x_display_info *dpyinfo; |
771 | 1462 struct frame *frame; |
286 | 1463 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1464 struct frame *old_focus = dpyinfo->x_focus_frame; |
286 | 1465 int events_enqueued = 0; |
1466 | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1467 if (frame != dpyinfo->x_focus_frame) |
286 | 1468 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1469 /* Set this before calling other routines, so that they see |
771 | 1470 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
|
1471 dpyinfo->x_focus_frame = frame; |
369 | 1472 |
1473 if (old_focus && old_focus->auto_lower) | |
771 | 1474 x_lower_frame (old_focus); |
286 | 1475 |
1476 #if 0 | |
771 | 1477 selected_frame = frame; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
1478 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
|
1479 selected_frame); |
771 | 1480 Fselect_window (selected_frame->selected_window); |
1481 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
|
1482 #endif /* ! 0 */ |
286 | 1483 |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1484 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
|
1485 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
|
1486 else |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
1487 pending_autoraise_frame = 0; |
369 | 1488 } |
1489 | |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1490 x_frame_rehighlight (dpyinfo); |
369 | 1491 } |
1492 | |
10223
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
1493 /* 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
|
1494 |
97fc8c6b4a74
(XTupdate_begin): Discard records of prior mouse highlight
Richard M. Stallman <rms@gnu.org>
parents:
9823
diff
changeset
|
1495 void |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1496 x_mouse_leave (dpyinfo) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1497 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
|
1498 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1499 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
|
1500 } |
369 | 1501 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1502 /* 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
|
1503 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
|
1504 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
|
1505 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1506 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
|
1507 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
|
1508 the appropriate X display info. */ |
369 | 1509 static void |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1510 XTframe_rehighlight (frame) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1511 struct frame *frame; |
369 | 1512 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1513 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
|
1514 } |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1515 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1516 static void |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1517 x_frame_rehighlight (dpyinfo) |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1518 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
|
1519 { |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1520 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
|
1521 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1522 if (dpyinfo->x_focus_frame) |
286 | 1523 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1524 dpyinfo->x_highlight_frame |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1525 = ((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
|
1526 ? 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
|
1527 : dpyinfo->x_focus_frame); |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1528 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
|
1529 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1530 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
|
1531 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
|
1532 } |
286 | 1533 } |
369 | 1534 else |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1535 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
|
1536 |
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
1537 if (dpyinfo->x_highlight_frame != old_highlight) |
369 | 1538 { |
1539 if (old_highlight) | |
771 | 1540 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
|
1541 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
|
1542 frame_highlight (dpyinfo->x_highlight_frame); |
369 | 1543 } |
286 | 1544 } |
1545 | |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1546 /* Keyboard processing - modifier keys, vendor-specific keysyms, etc. */ |
286 | 1547 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1548 /* 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
|
1549 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
|
1550 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
|
1551 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
|
1552 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1553 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
|
1554 KeySym *syms; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1555 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
|
1556 XModifierKeymap *mods; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1557 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1558 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
|
1559 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
|
1560 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
|
1561 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
|
1562 dpyinfo->hyper_mod_mask = 0; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1563 |
2127
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
1564 #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
|
1565 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
|
1566 #else |
13884
26245345f6f1
(x_find_modifier_meanings): Fix !X11R4 code to use dpyinfo.
Richard M. Stallman <rms@gnu.org>
parents:
13782
diff
changeset
|
1567 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
|
1568 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
|
1569 #endif |
adaf588e32a6
* xterm.c (x_find_modifier_meanings): XDisplayKeycodes only
Jim Blandy <jimb@redhat.com>
parents:
2064
diff
changeset
|
1570 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1571 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
|
1572 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
|
1573 &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
|
1574 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
|
1575 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1576 /* 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
|
1577 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
|
1578 { |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1579 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
|
1580 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1581 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
|
1582 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
|
1583 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
1584 KeyCode code |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
1585 = 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
|
1586 |
6560
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
1587 /* Zeroes are used for filler. Skip them. */ |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
1588 if (code == 0) |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
1589 continue; |
a071babfa9ea
(x_find_modifier_meanings): Skip zero entries.
Karl Heuer <kwzh@gnu.org>
parents:
6521
diff
changeset
|
1590 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1591 /* 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
|
1592 { |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1593 int code_col; |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1594 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1595 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
|
1596 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1597 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
|
1598 |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1599 switch (sym) |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1600 { |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1601 case XK_Meta_L: |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1602 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
|
1603 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
|
1604 break; |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1605 |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1606 case XK_Alt_L: |
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1607 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
|
1608 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
|
1609 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
|
1610 |
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
|
1611 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
|
1612 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
|
1613 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
|
1614 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
|
1615 |
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
|
1616 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
|
1617 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
|
1618 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
|
1619 break; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
1620 |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
1621 case XK_Shift_Lock: |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
1622 /* 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
|
1623 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
|
1624 dpyinfo->shift_lock_mask = LockMask; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
1625 break; |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1626 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1627 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1628 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1629 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1630 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1631 |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1632 /* 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
|
1633 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
|
1634 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1635 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
|
1636 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
|
1637 } |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1638 |
2923
c8997402dd6b
(x_find_modifier_meanings): If some keys are meta and alt,
Richard M. Stallman <rms@gnu.org>
parents:
2882
diff
changeset
|
1639 /* 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
|
1640 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
|
1641 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
|
1642 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1643 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
|
1644 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1645 |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1646 XFree ((char *) syms); |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1647 XFreeModifiermap (mods); |
1279
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1648 } |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
1649 |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
1650 /* 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
|
1651 Emacs uses. */ |
1530
a7f8a1fe258e
* xterm.c (x_convert_modifiers): Declare this to return an
Jim Blandy <jimb@redhat.com>
parents:
1436
diff
changeset
|
1652 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
|
1653 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
|
1654 struct x_display_info *dpyinfo; |
286 | 1655 unsigned int state; |
1656 { | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1657 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
|
1658 | ((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
|
1659 | ((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
|
1660 | ((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
|
1661 | ((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
|
1662 | ((state & dpyinfo->hyper_mod_mask) ? hyper_modifier : 0)); |
286 | 1663 } |
1664 | |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
1665 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
|
1666 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
|
1667 struct x_display_info *dpyinfo; |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
1668 unsigned int state; |
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
1669 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
1670 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
|
1671 | ((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
|
1672 | ((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
|
1673 | ((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
|
1674 | ((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
|
1675 | ((state & meta_modifier) ? dpyinfo->meta_mod_mask : 0)); |
2661
77f1457d000e
Implement extra_keyboard_modifiers properly.
Jim Blandy <jimb@redhat.com>
parents:
2474
diff
changeset
|
1676 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1677 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1678 /* Convert a keysym to its name. */ |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1679 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1680 char * |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1681 x_get_keysym_name (keysym) |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1682 KeySym keysym; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1683 { |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1684 char *value; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1685 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1686 BLOCK_INPUT; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1687 value = XKeysymToString (keysym); |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1688 UNBLOCK_INPUT; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1689 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1690 return value; |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
1691 } |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1692 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1693 /* Mouse clicks and mouse movement. Rah. */ |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1694 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1695 /* 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
|
1696 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
|
1697 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
|
1698 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
|
1699 |
6023
67aa546e4ff1
(construct_menu_click): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
6022
diff
changeset
|
1700 void |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1701 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
|
1702 FRAME_PTR f; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1703 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
|
1704 register int *x, *y; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1705 XRectangle *bounds; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1706 int noclip; |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1707 { |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1708 /* 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
|
1709 even for negative values. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1710 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
|
1711 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
|
1712 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
|
1713 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
|
1714 |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1715 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
|
1716 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
|
1717 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1718 if (bounds) |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1719 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
1720 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
|
1721 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
|
1722 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
|
1723 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
|
1724 } |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1725 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1726 if (!noclip) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1727 { |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1728 if (pix_x < 0) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1729 pix_x = 0; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1730 else if (pix_x > f->width) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1731 pix_x = f->width; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1732 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1733 if (pix_y < 0) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1734 pix_y = 0; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1735 else if (pix_y > f->height) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1736 pix_y = f->height; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1737 } |
3585
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1738 |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1739 *x = pix_x; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1740 *y = pix_y; |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1741 } |
19aab2d09a4d
* xterm.c (x_is_vendor_fkey): New function.
Jim Blandy <jimb@redhat.com>
parents:
3558
diff
changeset
|
1742 |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1743 void |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1744 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
|
1745 FRAME_PTR f; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1746 register int x, y; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1747 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
|
1748 { |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1749 *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
|
1750 *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
|
1751 } |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1752 |
286 | 1753 /* Prepare a mouse-event in *RESULT for placement in the input queue. |
1754 | |
1755 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
|
1756 the mouse. */ |
286 | 1757 |
1758 static Lisp_Object | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1759 construct_mouse_click (result, event, f) |
286 | 1760 struct input_event *result; |
1761 XButtonEvent *event; | |
771 | 1762 struct frame *f; |
286 | 1763 { |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1764 /* Make the event type no_event; we'll change that when we decide |
286 | 1765 otherwise. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1766 result->kind = mouse_click; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1767 result->code = event->button - Button1; |
708 | 1768 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
|
1769 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
|
1770 event->state) |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1771 | (event->type == ButtonRelease |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1772 ? up_modifier |
1324
44215417cf6e
* xterm.c (x_find_modifier_meanings): If there are no
Jim Blandy <jimb@redhat.com>
parents:
1279
diff
changeset
|
1773 : down_modifier)); |
286 | 1774 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1775 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1776 int row, column; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
1777 |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
1778 #if 0 |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1779 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
|
1780 XSETFASTINT (result->x, column); |
97cfba406b7b
(construct_mouse_click): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9338
diff
changeset
|
1781 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
|
1782 #endif |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
1783 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
|
1784 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
|
1785 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
|
1786 } |
286 | 1787 } |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1788 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1789 /* 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
|
1790 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1791 static Lisp_Object |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1792 construct_menu_click (result, event, f) |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1793 struct input_event *result; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1794 XButtonEvent *event; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1795 struct frame *f; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1796 { |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1797 /* 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
|
1798 otherwise. */ |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1799 result->kind = mouse_click; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
1800 XSETINT (result->code, event->button - Button1); |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1801 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
|
1802 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
|
1803 event->state) |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1804 | (event->type == ButtonRelease |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1805 ? up_modifier |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1806 : down_modifier)); |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1807 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
1808 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
|
1809 XSETINT (result->y, -1); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
1810 XSETFRAME (result->frame_or_window, f); |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
1811 } |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
1812 |
429 | 1813 /* Function to report a mouse movement to the mainstream Emacs code. |
1814 The input handler calls this. | |
1815 | |
1816 We have received a mouse movement event, which is given in *event. | |
1817 If the mouse is over a different glyph than it was last time, tell | |
1818 the mainstream emacs code by setting mouse_moved. If not, ask for | |
1819 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
|
1820 |
429 | 1821 static void |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1822 note_mouse_movement (frame, event) |
771 | 1823 FRAME_PTR frame; |
429 | 1824 XMotionEvent *event; |
1825 { | |
732 | 1826 last_mouse_movement_time = event->time; |
1827 | |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1828 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
|
1829 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
1830 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
|
1831 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
|
1832 |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1833 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
|
1834 |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1835 /* Ask for another mouse motion event. */ |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1836 { |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1837 int dummy; |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1838 Window dummy_window; |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1839 |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1840 XQueryPointer (event->display, FRAME_X_WINDOW (frame), |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1841 &dummy_window, &dummy_window, |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1842 &dummy, &dummy, &dummy, &dummy, |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1843 (unsigned int *) &dummy); |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1844 } |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1845 } |
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1846 |
429 | 1847 /* 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
|
1848 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
|
1849 || 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
|
1850 || 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
|
1851 || 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
|
1852 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
1853 frame->mouse_moved = 1; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
1854 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
|
1855 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1856 note_mouse_highlight (frame, event->x, event->y); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1857 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1858 /* Ask for another mouse motion event. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1859 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1860 int dummy; |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1861 Window dummy_window; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1862 |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1863 XQueryPointer (event->display, FRAME_X_WINDOW (frame), |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1864 &dummy_window, &dummy_window, |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1865 &dummy, &dummy, &dummy, &dummy, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1866 (unsigned int *) &dummy); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1867 } |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
1868 } |
429 | 1869 else |
1870 { | |
1871 /* It's on the same glyph. Call XQueryPointer so we'll get an | |
1872 event the next time the mouse moves and we can see if it's | |
1873 *still* on the same glyph. */ | |
1874 int dummy; | |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1875 Window dummy_window; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
1876 |
7680
8212755ff793
(note_mouse_movement): Use frame's window in XQueryPointer.
Richard M. Stallman <rms@gnu.org>
parents:
7651
diff
changeset
|
1877 XQueryPointer (event->display, FRAME_X_WINDOW (frame), |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
1878 &dummy_window, &dummy_window, |
429 | 1879 &dummy, &dummy, &dummy, &dummy, |
1880 (unsigned int *) &dummy); | |
1881 } | |
1882 } | |
1883 | |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
1884 /* 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
|
1885 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
|
1886 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1887 /* 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
|
1888 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
|
1889 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
|
1890 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
|
1891 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1892 static void |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1893 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
|
1894 FRAME_PTR f; |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
1895 int x, y; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1896 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1897 int row, column, portion; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1898 XRectangle new_glyph; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1899 Lisp_Object window; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1900 struct window *w; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1901 |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
1902 if (disable_mouse_highlight) |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
1903 return; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
1904 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1905 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
|
1906 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
|
1907 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
|
1908 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1909 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
|
1910 return; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1911 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
1912 if (gc_in_progress) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
1913 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
1914 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
|
1915 return; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
1916 } |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
1917 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1918 /* 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
|
1919 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
|
1920 &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
|
1921 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1922 /* Which window is that in? */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1923 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
|
1924 w = XWINDOW (window); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1925 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1926 /* 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
|
1927 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
|
1928 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
|
1929 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1930 /* 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
|
1931 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
|
1932 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
|
1933 && 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
|
1934 && EQ (w->window_end_valid, w->buffer) |
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
1935 && w->last_modified == BUF_MODIFF (XBUFFER (w->buffer))) |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1936 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1937 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
|
1938 int i, pos; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1939 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1940 /* 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
|
1941 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
|
1942 if (ptr[i] > 0) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1943 break; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1944 pos = ptr[i]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1945 /* 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
|
1946 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
|
1947 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
|
1948 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
|
1949 && 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
|
1950 && 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
|
1951 && (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
|
1952 || 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
|
1953 && (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
|
1954 || 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
|
1955 || 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
|
1956 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1957 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
|
1958 Lisp_Object *overlay_vec; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1959 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
|
1960 struct buffer *obuf; |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1961 int obegv, ozv; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1962 |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1963 /* 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
|
1964 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
|
1965 return; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1966 |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
1967 /* 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
|
1968 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
|
1969 obuf = current_buffer; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
1970 current_buffer = XBUFFER (w->buffer); |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1971 obegv = BEGV; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1972 ozv = ZV; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1973 BEGV = BEG; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
1974 ZV = Z; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
1975 |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1976 /* 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
|
1977 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
|
1978 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1979 /* 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
|
1980 XSETINT (position, pos); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1981 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1982 len = 10; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1983 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
|
1984 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1985 /* 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
|
1986 Store the length in len. */ |
8964
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
1987 noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
1988 NULL, NULL); |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
1989 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
|
1990 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1991 /* 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
|
1992 overlay = Qnil; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1993 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
|
1994 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1995 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
|
1996 if (!NILP (mouse_face)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1997 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1998 overlay = overlay_vec[i]; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
1999 break; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2000 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2001 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2002 free (overlay_vec); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2003 /* 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
|
2004 if (NILP (overlay)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2005 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
|
2006 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2007 /* Handle the overlay case. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2008 if (! NILP (overlay)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2009 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2010 /* 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
|
2011 should be active. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2012 Lisp_Object before, after; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2013 int ignore; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2014 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2015 before = Foverlay_start (overlay); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2016 after = Foverlay_end (overlay); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2017 /* Record this as the current active region. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2018 fast_find_position (window, before, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2019 &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
|
2020 &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
|
2021 FRAME_X_DISPLAY_INFO (f)->mouse_face_past_end |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2022 = !fast_find_position (window, after, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2023 &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
|
2024 &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
|
2025 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
|
2026 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
|
2027 = 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
|
2028 &ignore, pos + 1, 1); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2029 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2030 /* 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
|
2031 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
|
2032 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2033 /* Handle the text property case. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2034 else if (! NILP (mouse_face)) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2035 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2036 /* 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
|
2037 should be active. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2038 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
|
2039 int ignore; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2040 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2041 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
|
2042 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
|
2043 - 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
|
2044 before |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2045 = 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
|
2046 Qmouse_face, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2047 w->buffer, beginning); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2048 after |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2049 = 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
|
2050 w->buffer, end); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2051 /* Record this as the current active region. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2052 fast_find_position (window, before, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2053 &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
|
2054 &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
|
2055 FRAME_X_DISPLAY_INFO (f)->mouse_face_past_end |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2056 = !fast_find_position (window, after, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2057 &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
|
2058 &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
|
2059 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
|
2060 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
|
2061 = 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
|
2062 &ignore, pos + 1, 1); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2063 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2064 /* 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
|
2065 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
|
2066 } |
6683
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2067 BEGV = obegv; |
af1629dfdb4c
(note_mouse_highlight): Temporarily widen the buffer.
Richard M. Stallman <rms@gnu.org>
parents:
6660
diff
changeset
|
2068 ZV = ozv; |
6626
59c44532d2a0
(construct_menu_click, construct_mouse_click):
Richard M. Stallman <rms@gnu.org>
parents:
6616
diff
changeset
|
2069 current_buffer = obuf; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2070 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2071 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2072 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2073 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2074 /* 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
|
2075 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
|
2076 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
|
2077 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
|
2078 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
|
2079 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
|
2080 |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2081 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
|
2082 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2083 static int |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2084 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
|
2085 Lisp_Object window; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2086 int pos; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2087 int *columnp, *rowp; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2088 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2089 struct window *w = XWINDOW (window); |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2090 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
|
2091 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
|
2092 int row = 0; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2093 int left = w->left; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2094 int top = w->top; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2095 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
|
2096 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
|
2097 int *charstarts; |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2098 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
|
2099 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
|
2100 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2101 /* Find the right row. */ |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2102 for (i = 0; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2103 i < height; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2104 i++) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2105 { |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2106 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
|
2107 if (linestart > pos) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2108 break; |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2109 /* 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
|
2110 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
|
2111 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
|
2112 { |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2113 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
|
2114 break; |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2115 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2116 if (linestart > 0) |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2117 row = i; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2118 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2119 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2120 /* 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
|
2121 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
|
2122 lastcol = left; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2123 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
|
2124 { |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2125 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
|
2126 { |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2127 *rowp = row + top; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2128 *columnp = i + left; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2129 return 1; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2130 } |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2131 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
|
2132 break; |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
2133 else if (charstarts[left + i] > 0) |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2134 lastcol = left + i; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2135 } |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2136 |
9762
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2137 /* 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
|
2138 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
|
2139 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
|
2140 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
|
2141 { |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2142 row++; |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2143 i = 0; |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2144 } |
567e3670acc3
(fast_find_position): Special case if POS is end of buffer.
Richard M. Stallman <rms@gnu.org>
parents:
9741
diff
changeset
|
2145 |
6644
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2146 *rowp = row + top; |
8e2379ce4fcb
(fast_find_position): Always return coords within the window.
Richard M. Stallman <rms@gnu.org>
parents:
6631
diff
changeset
|
2147 *columnp = lastcol; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2148 return 0; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2149 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2150 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2151 /* 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
|
2152 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
|
2153 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2154 static void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2155 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
|
2156 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
|
2157 int hl; |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2158 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2159 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
|
2160 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
|
2161 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
|
2162 int i; |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2163 int cursor_off = 0; |
8164
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2164 int old_curs_x = curs_x; |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2165 int old_curs_y = curs_y; |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2166 |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2167 /* Set these variables temporarily |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2168 so that if we have to turn the cursor off and on again |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2169 we will put it back at the same place. */ |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2170 curs_x = f->phys_cursor_x; |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2171 curs_y = f->phys_cursor_y; |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2172 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2173 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
|
2174 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
|
2175 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2176 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
|
2177 ? 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
|
2178 : w->left); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2179 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
|
2180 ? 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
|
2181 : w->left + width); |
7992
7bb45acbcaa6
(show_mouse_face): Set endcolumn ok in side-by-side windows.
Richard M. Stallman <rms@gnu.org>
parents:
7959
diff
changeset
|
2182 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
|
2183 |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2184 /* 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
|
2185 turn the cursor off. */ |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2186 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
|
2187 && 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
|
2188 && curs_x <= endcolumn) |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2189 { |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2190 x_display_cursor (f, 0); |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2191 cursor_off = 1; |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2192 } |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2193 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2194 dumpglyphs (f, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2195 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
|
2196 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
|
2197 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
|
2198 endcolumn - column, |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2199 /* Highlight with mouse face if hl > 0. */ |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
2200 hl > 0 ? 3 : 0, 0); |
6616
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2201 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2202 |
6660
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2203 /* 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
|
2204 if (cursor_off) |
cb14d76e993c
(note_mouse_highlight): Do nothing if gc_in_progress.
Richard M. Stallman <rms@gnu.org>
parents:
6649
diff
changeset
|
2205 x_display_cursor (f, 1); |
6757
770fe370479b
(show_mouse_face): Change the mouse cursor accordingly.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6683
diff
changeset
|
2206 |
8164
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2207 curs_x = old_curs_x; |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2208 curs_y = old_curs_y; |
3b90e6a741f1
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
8098
diff
changeset
|
2209 |
6757
770fe370479b
(show_mouse_face): Change the mouse cursor accordingly.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6683
diff
changeset
|
2210 /* 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
|
2211 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
|
2212 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
|
2213 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
|
2214 else |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2215 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
|
2216 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
|
2217 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2218 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2219 /* 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
|
2220 Redraw it unhighlighted first. */ |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2221 |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2222 static void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2223 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
|
2224 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
|
2225 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2226 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
|
2227 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
|
2228 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2229 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
|
2230 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
|
2231 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
|
2232 } |
951c8941b931
[INCLUDED_FCNTL]: Don't include fcntl.h again.
Richard M. Stallman <rms@gnu.org>
parents:
6560
diff
changeset
|
2233 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2234 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
|
2235 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
|
2236 |
429 | 2237 /* 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
|
2238 *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
|
2239 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2240 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
|
2241 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
|
2242 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
|
2243 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
|
2244 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2245 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
|
2246 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
|
2247 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
|
2248 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2249 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
|
2250 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
|
2251 |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2252 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
|
2253 |
429 | 2254 This clears the mouse_moved flag, so we can wait for the next mouse |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2255 movement. This also calls XQueryPointer, which will cause the |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2256 server to give us another MotionNotify when the mouse moves |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2257 again. */ |
429 | 2258 |
2259 static void | |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2260 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
|
2261 FRAME_PTR *fp; |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2262 int insist; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2263 Lisp_Object *bar_window; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2264 enum scroll_bar_part *part; |
429 | 2265 Lisp_Object *x, *y; |
732 | 2266 unsigned long *time; |
429 | 2267 { |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2268 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
|
2269 |
429 | 2270 BLOCK_INPUT; |
2271 | |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2272 if (! NILP (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
|
2273 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); |
429 | 2274 else |
2275 { | |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2276 Window root; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2277 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
|
2278 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2279 Window dummy_window; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2280 int dummy; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2281 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2282 Lisp_Object frame, tail; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2283 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2284 /* 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
|
2285 FOR_EACH_FRAME (tail, frame) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2286 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
|
2287 XFRAME (frame)->mouse_moved = 0; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2288 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2289 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
|
2290 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2291 /* 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
|
2292 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
|
2293 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
|
2294 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2295 /* 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
|
2296 &root, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2297 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2298 /* 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
|
2299 a different screen. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2300 &dummy_window, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2301 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2302 /* The position on that root window. */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2303 &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
|
2304 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2305 /* 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
|
2306 &dummy, &dummy, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2307 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2308 /* 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
|
2309 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
|
2310 (unsigned int *) &dummy); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2311 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2312 /* 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
|
2313 containing the pointer. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2314 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2315 Window win, child; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2316 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
|
2317 int parent_x, parent_y; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2318 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2319 win = root; |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2320 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2321 /* 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
|
2322 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
|
2323 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
|
2324 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2325 x_catch_errors (FRAME_X_DISPLAY (*fp)); |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2326 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2327 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
|
2328 && 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
|
2329 { |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2330 /* 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
|
2331 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
|
2332 XTranslateCoordinates (FRAME_X_DISPLAY (*fp), |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2333 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2334 /* From-window, to-window. */ |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2335 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
|
2336 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2337 /* 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
|
2338 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
|
2339 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2340 /* Child of win. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2341 &child); |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2342 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
|
2343 } |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2344 else |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2345 { |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2346 while (1) |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2347 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2348 XTranslateCoordinates (FRAME_X_DISPLAY (*fp), |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2349 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2350 /* From-window, to-window. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2351 root, win, |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2352 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2353 /* From-position, to-position. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2354 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
|
2355 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2356 /* Child of win. */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2357 &child); |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2358 |
13627
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
2359 if (child == None || child == win) |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2360 break; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2361 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2362 win = child; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2363 parent_x = win_x; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2364 parent_y = win_y; |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2365 } |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2366 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2367 /* Now we know that: |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2368 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
|
2369 (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
|
2370 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
|
2371 (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
|
2372 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
|
2373 (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
|
2374 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
|
2375 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
|
2376 never use them in that case.) */ |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2377 |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
2378 /* 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
|
2379 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
|
2380 } |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2381 |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2382 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
|
2383 f1 = 0; |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2384 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2385 x_uncatch_errors (FRAME_X_DISPLAY (*fp)); |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
2386 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2387 /* 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
|
2388 if (! f1) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2389 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2390 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
|
2391 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2392 if (bar) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2393 { |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2394 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
|
2395 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
|
2396 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
|
2397 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2398 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2399 |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2400 if (f1 == 0 && insist) |
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2401 f1 = selected_frame; |
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2402 |
3669
fd4187a96445
(XTmouse_position): Don't set *f at all unless we win.
Richard M. Stallman <rms@gnu.org>
parents:
3639
diff
changeset
|
2403 if (f1) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2404 { |
6055
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2405 int ignore1, ignore2; |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2406 |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2407 /* 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
|
2408 |
a9f61727a90c
(construct_mouse_click): Don't convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6023
diff
changeset
|
2409 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
|
2410 &last_mouse_glyph, |
11122
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2411 FRAME_X_DISPLAY_INFO (f1)->grabbed |
ce63fb361ae9
(XTmouse_position): New arg `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11015
diff
changeset
|
2412 || insist); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2413 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2414 *bar_window = Qnil; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2415 *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
|
2416 *fp = f1; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2417 XSETINT (*x, win_x); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2418 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
|
2419 *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
|
2420 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2421 } |
429 | 2422 } |
2423 | |
2424 UNBLOCK_INPUT; | |
2425 } | |
2426 | |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2427 /* Scroll bar support. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2428 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2429 /* 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
|
2430 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
|
2431 bits. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2432 static struct scroll_bar * |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2433 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
|
2434 Window window_id; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2435 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2436 Lisp_Object tail, frame; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2437 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2438 for (tail = Vframe_list; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2439 XGCTYPE (tail) == Lisp_Cons; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2440 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
|
2441 { |
6521
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
2442 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
|
2443 |
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
2444 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
|
2445 /* 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
|
2446 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
|
2447 abort (); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2448 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2449 /* 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
|
2450 right window ID. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2451 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
|
2452 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
|
2453 /* 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
|
2454 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
|
2455 ! GC_NILP (bar) || (bar = condemned, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2456 condemned = Qnil, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2457 ! 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
|
2458 bar = XSCROLL_BAR (bar)->next) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2459 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
|
2460 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
|
2461 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2462 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2463 return 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2464 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2465 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2466 /* 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
|
2467 scroll bar vector for it. */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2468 static struct scroll_bar * |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2469 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
|
2470 struct window *window; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2471 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
|
2472 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2473 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
|
2474 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
|
2475 = 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
|
2476 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2477 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2478 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2479 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2480 XSetWindowAttributes a; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2481 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
|
2482 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
|
2483 a.event_mask = (ButtonPressMask | ButtonReleaseMask |
1793
cf4c3f01ddb9
* xterm.c (x_scrollbar_create): Include PointerMotionHintMask in
Jim Blandy <jimb@redhat.com>
parents:
1787
diff
changeset
|
2484 | ButtonMotionMask | PointerMotionHintMask |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2485 | ExposureMask); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
2486 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
|
2487 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
2488 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
|
2489 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2490 #if 0 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2491 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2492 ac = 0; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
2493 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
|
2494 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
|
2495 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
|
2496 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
|
2497 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
|
2498 sb_widget = XtCreateManagedWidget ("box", |
5916
4e827db2523a
(x_scroll_bar_create): Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents:
5898
diff
changeset
|
2499 boxWidgetClass, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
2500 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
|
2501 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
|
2502 (bar, sb_widget->core.window); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2503 #endif |
5916
4e827db2523a
(x_scroll_bar_create): Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents:
5898
diff
changeset
|
2504 SET_SCROLL_BAR_X_WINDOW |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2505 (bar, |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2506 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
|
2507 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2508 /* Position and size of scroll bar. */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2509 left, top, width, height, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2510 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2511 /* 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
|
2512 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
|
2513 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2514 /* Attributes. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2515 mask, &a)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2516 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2517 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2518 XSETWINDOW (bar->window, window); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2519 XSETINT (bar->top, top); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2520 XSETINT (bar->left, left); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2521 XSETINT (bar->width, width); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2522 XSETINT (bar->height, height); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2523 XSETINT (bar->start, 0); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2524 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
|
2525 bar->dragging = Qnil; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2526 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2527 /* 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
|
2528 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
|
2529 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
|
2530 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
|
2531 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
|
2532 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
|
2533 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
2534 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
|
2535 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2536 UNBLOCK_INPUT; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2537 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2538 return bar; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2539 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2540 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2541 /* 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
|
2542 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
|
2543 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
|
2544 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
|
2545 events.) |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2546 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2547 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
|
2548 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
|
2549 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
|
2550 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
|
2551 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
|
2552 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2553 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
|
2554 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
|
2555 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
|
2556 int rebuild; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2557 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2558 int dragging = ! NILP (bar->dragging); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2559 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
|
2560 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
|
2561 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
|
2562 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2563 /* 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
|
2564 if (! rebuild |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2565 && 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
|
2566 && 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
|
2567 return; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2568 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2569 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2570 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2571 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2572 int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (XINT (bar->width)); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2573 int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2574 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2575 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2576 /* 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
|
2577 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
|
2578 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2579 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
|
2580 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2581 if (start < 0) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2582 start = 0; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2583 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
|
2584 start = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2585 end = start + length; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2586 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2587 if (end < start) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2588 end = start; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2589 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
|
2590 end = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2591 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2592 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2593 /* 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
|
2594 XSETINT (bar->start, start); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2595 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
|
2596 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2597 /* 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
|
2598 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
|
2599 end = top_range; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2600 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2601 /* 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
|
2602 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
|
2603 that many pixels tall. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2604 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
|
2605 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2606 /* 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
|
2607 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
|
2608 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
|
2609 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
|
2610 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2611 /* 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
|
2612 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2613 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
|
2614 inside_width, start, |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2615 False); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2616 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2617 /* 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
|
2618 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
|
2619 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2620 /* x, y, width, height */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2621 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2622 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
|
2623 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
|
2624 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2625 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2626 /* 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
|
2627 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
|
2628 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
|
2629 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
|
2630 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2631 /* 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
|
2632 VERTICAL_SCROLL_BAR_LEFT_BORDER, |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2633 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
|
2634 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
|
2635 False); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2636 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2637 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2638 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2639 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2640 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2641 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3585
diff
changeset
|
2642 /* 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
|
2643 window configurations. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2644 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2645 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
|
2646 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
|
2647 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
|
2648 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
2649 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
|
2650 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
|
2651 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2652 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2653 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2654 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2655 XWindowChanges wc; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2656 unsigned int mask = 0; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2657 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2658 wc.x = left; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2659 wc.y = top; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2660 wc.width = width; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2661 wc.height = height; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2662 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2663 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
|
2664 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
|
2665 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
|
2666 if (height != XINT (bar->height)) mask |= CWHeight; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2667 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2668 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
|
2669 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
|
2670 mask, &wc); |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2671 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2672 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2673 XSETINT (bar->left, left); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2674 XSETINT (bar->top, top); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2675 XSETINT (bar->width, width); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2676 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
|
2677 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2678 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2679 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2680 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2681 /* 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
|
2682 to nil. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2683 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2684 x_scroll_bar_remove (bar) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2685 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
|
2686 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2687 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
|
2688 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2689 BLOCK_INPUT; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2690 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2691 /* 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
|
2692 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
|
2693 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2694 /* 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
|
2695 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
|
2696 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2697 UNBLOCK_INPUT; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2698 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2699 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2700 /* 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
|
2701 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
|
2702 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
|
2703 create one. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2704 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2705 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
|
2706 struct window *window; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2707 int portion, whole, position; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2708 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2709 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
|
2710 int top = XINT (window->top); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2711 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
|
2712 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
|
2713 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2714 /* 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
|
2715 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
|
2716 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
|
2717 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
|
2718 = (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
|
2719 ? 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
|
2720 : (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
|
2721 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
|
2722 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2723 struct scroll_bar *bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2724 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2725 /* Does the scroll bar exist yet? */ |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2726 if (NILP (window->vertical_scroll_bar)) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2727 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
|
2728 pixel_top, pixel_left, |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2729 pixel_width, pixel_height); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2730 else |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2731 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2732 /* 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
|
2733 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
|
2734 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
|
2735 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2736 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2737 /* 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
|
2738 dragged. */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2739 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
|
2740 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2741 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (pixel_height); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2742 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2743 if (whole == 0) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2744 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
|
2745 else |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2746 { |
3686
910ea1d66bfd
* xterm.c (XTset_vertical_scroll_bar): Use double type for
Jim Blandy <jimb@redhat.com>
parents:
3683
diff
changeset
|
2747 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
|
2748 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
|
2749 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2750 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
|
2751 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2752 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2753 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2754 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
|
2755 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2756 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2757 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2758 /* 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
|
2759 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
|
2760 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
|
2761 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
|
2762 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
|
2763 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
|
2764 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
|
2765 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2766 /* 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
|
2767 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
|
2768 `*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
|
2769 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2770 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
|
2771 FRAME_PTR frame; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2772 { |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2773 /* 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
|
2774 while (! NILP (FRAME_SCROLL_BARS (frame))) |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2775 { |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2776 Lisp_Object bar; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2777 bar = FRAME_SCROLL_BARS (frame); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2778 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
|
2779 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
|
2780 XSCROLL_BAR (bar)->prev = Qnil; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2781 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame))) |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2782 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
|
2783 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
2784 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2785 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2786 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2787 /* 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
|
2788 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
|
2789 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2790 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
|
2791 struct window *window; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2792 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2793 struct scroll_bar *bar; |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2794 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2795 /* 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
|
2796 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
|
2797 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2798 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2799 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
|
2800 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2801 /* 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
|
2802 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2803 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
|
2804 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2805 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
|
2806 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2807 /* 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
|
2808 the lists. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2809 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
|
2810 /* 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
|
2811 return; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2812 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
|
2813 window->vertical_scroll_bar)) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2814 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
|
2815 else |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2816 /* 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
|
2817 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
|
2818 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2819 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2820 else |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2821 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
|
2822 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2823 if (! NILP (bar->next)) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2824 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
|
2825 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2826 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
|
2827 bar->prev = Qnil; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2828 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
|
2829 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
|
2830 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
|
2831 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2832 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2833 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2834 /* 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
|
2835 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
|
2836 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2837 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
|
2838 FRAME_PTR f; |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2839 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2840 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
|
2841 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2842 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
|
2843 |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
2844 /* 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
|
2845 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
|
2846 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
|
2847 |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
2848 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
|
2849 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2850 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
|
2851 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2852 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
|
2853 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2854 next = b->next; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2855 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
|
2856 } |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2857 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2858 /* 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
|
2859 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
|
2860 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2861 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2862 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2863 /* 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
|
2864 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2865 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
|
2866 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2867 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2868 x_scroll_bar_expose (bar, event) |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2869 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
|
2870 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2871 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2872 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
|
2873 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
|
2874 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
|
2875 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2876 BLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2877 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2878 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
|
2879 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2880 /* 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
|
2881 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
|
2882 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2883 /* x, y, width, height */ |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2884 0, 0, XINT (bar->width) - 1, XINT (bar->height) - 1); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2885 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2886 UNBLOCK_INPUT; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2887 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2888 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2889 /* 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
|
2890 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
|
2891 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2892 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
|
2893 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2894 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2895 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
|
2896 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
|
2897 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2898 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
|
2899 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2900 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
|
2901 abort (); |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2902 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2903 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
|
2904 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
|
2905 emacs_event->modifiers |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2906 = (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
|
2907 (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
|
2908 event->xbutton.state) |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2909 | (event->type == ButtonRelease |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2910 ? up_modifier |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2911 : down_modifier)); |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2912 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
|
2913 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
|
2914 { |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2915 int internal_height |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2916 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2917 int top_range |
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
2918 = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2919 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
|
2920 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2921 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
|
2922 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
|
2923 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2924 if (y < XINT (bar->start)) |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2925 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
|
2926 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
|
2927 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
|
2928 else |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2929 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
|
2930 |
5440f00480e6
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2923
diff
changeset
|
2931 /* 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
|
2932 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
|
2933 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
|
2934 #if 0 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2935 /* 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
|
2936 holding it. */ |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2937 if (event->type == ButtonPress |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2938 && 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
|
2939 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
|
2940 #endif |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2941 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2942 /* 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
|
2943 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
|
2944 && ! NILP (bar->dragging)) |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2945 { |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2946 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
|
2947 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
|
2948 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2949 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
|
2950 bar->dragging = Qnil; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2951 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2952 |
2958
3124e6244d1a
* xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar;
Jim Blandy <jimb@redhat.com>
parents:
2953
diff
changeset
|
2953 /* 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
|
2954 #if 0 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
2955 /* 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
|
2956 the handle. */ |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2957 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
|
2958 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
|
2959 else |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2960 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
|
2961 #else |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2962 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
|
2963 #endif |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2964 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
2965 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
|
2966 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2967 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2968 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2969 /* 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
|
2970 |
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2971 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
|
2972 mark bits. */ |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2973 static void |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2974 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
|
2975 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
|
2976 XEvent *event; |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2977 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2978 FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2979 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2980 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
|
2981 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
2982 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
|
2983 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
|
2984 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2985 /* 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
|
2986 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
|
2987 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2988 /* 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
|
2989 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
|
2990 |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2991 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
|
2992 { |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
2993 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
|
2994 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
2995 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
|
2996 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2997 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2998 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
2999 /* Call XQueryPointer so we'll get an event the next time the mouse |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3000 moves and we can see *still* on the same position. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3001 { |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3002 int dummy; |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
3003 Window dummy_window; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3004 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3005 XQueryPointer (event->xmotion.display, event->xmotion.window, |
8279
4cde734c20e8
(note_mouse_movement): Use proper data type for window
Richard M. Stallman <rms@gnu.org>
parents:
8164
diff
changeset
|
3006 &dummy_window, &dummy_window, |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3007 &dummy, &dummy, &dummy, &dummy, |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3008 (unsigned int *) &dummy); |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3009 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3010 } |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3011 |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3012 /* 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
|
3013 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
|
3014 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
|
3015 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
|
3016 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
|
3017 Lisp_Object *bar_window; |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3018 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
|
3019 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
|
3020 unsigned long *time; |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3021 { |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3022 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
|
3023 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
|
3024 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
|
3025 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
|
3026 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
|
3027 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
|
3028 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
|
3029 |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3030 BLOCK_INPUT; |
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3031 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3032 /* 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
|
3033 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
|
3034 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
|
3035 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3036 /* 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
|
3037 &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
|
3038 &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
|
3039 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3040 /* 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
|
3041 &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
|
3042 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3043 /* 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
|
3044 &dummy_mask)) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3045 ; |
2982
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3046 else |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3047 { |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3048 int inside_height |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3049 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3050 int top_range |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3051 = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3052 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3053 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
|
3054 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3055 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
|
3056 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
|
3057 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3058 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
|
3059 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
|
3060 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
|
3061 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
|
3062 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3063 *fp = f; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3064 *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
|
3065 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3066 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
|
3067 *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
|
3068 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
|
3069 *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
|
3070 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
|
3071 *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
|
3072 else |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3073 *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
|
3074 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3075 XSETINT (*x, win_y); |
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3076 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
|
3077 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
3078 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
|
3079 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
|
3080 } |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3081 |
44ed08628516
* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not
Jim Blandy <jimb@redhat.com>
parents:
2977
diff
changeset
|
3082 *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
|
3083 |
1803
5752a95053f2
* xterm.c (x_window_to_scrollbar): Search frames'
Jim Blandy <jimb@redhat.com>
parents:
1793
diff
changeset
|
3084 UNBLOCK_INPUT; |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3085 } |
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
3086 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3087 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3088 /* 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
|
3089 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
|
3090 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
|
3091 redraw them. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3092 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3093 x_scroll_bar_clear (f) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3094 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3095 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3096 Lisp_Object bar; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3097 |
9101
1cd322ea379a
(x_scroll_bar_clear): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents:
9011
diff
changeset
|
3098 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
3099 bar = XSCROLL_BAR (bar)->next) |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3100 XClearArea (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3101 0, 0, 0, 0, True); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3102 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
3103 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3104 /* 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
|
3105 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
|
3106 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
|
3107 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3108 void |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3109 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
|
3110 XEvent event; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3111 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3112 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
|
3113 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
|
3114 |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3115 BLOCK_INPUT; |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3116 |
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
|
3117 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
|
3118 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
|
3119 if (f) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3120 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3121 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
|
3122 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3123 f->async_visible = 1; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3124 f->async_iconified = 0; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3125 SET_FRAME_GARBAGED (f); |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3126 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3127 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3128 { |
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
|
3129 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
|
3130 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
|
3131 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
|
3132 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3133 } |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3134 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3135 { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3136 struct scroll_bar *bar |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3137 = x_window_to_scroll_bar (event.xexpose.window); |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3138 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3139 if (bar) |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3140 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
|
3141 } |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3142 |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
3143 UNBLOCK_INPUT; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3144 } |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3145 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3146 /* 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
|
3147 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3148 struct selection_event_queue |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3149 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3150 XEvent event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3151 struct selection_event_queue *next; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3152 }; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3153 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3154 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
|
3155 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3156 /* 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
|
3157 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
|
3158 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3159 /* 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
|
3160 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3161 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
|
3162 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
|
3163 FRAME_PTR f; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3164 XEvent *event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3165 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3166 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
|
3167 = (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
|
3168 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3169 if (queue_tmp != NULL) |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3170 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3171 queue_tmp->event = *event; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3172 queue_tmp->next = queue; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3173 queue = queue_tmp; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3174 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3175 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3176 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3177 /* 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
|
3178 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
|
3179 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3180 static void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3181 x_unqueue_events (display) |
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3182 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3183 { |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
3184 while (queue != NULL) |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3185 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3186 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
|
3187 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
|
3188 queue = queue_tmp->next; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3189 free ((char *)queue_tmp); |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3190 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3191 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3192 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3193 /* Start queuing SelectionRequest events. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3194 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3195 void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3196 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
|
3197 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3198 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3199 x_queue_selection_requests++; |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3200 } |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3201 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3202 /* Stop queuing SelectionRequest events. */ |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3203 |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3204 void |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3205 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
|
3206 Display *display; |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3207 { |
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3208 x_queue_selection_requests--; |
10634
de7beeb9f02c
(x_unqueue_events): Arg is now a Display *.
Richard M. Stallman <rms@gnu.org>
parents:
10609
diff
changeset
|
3209 x_unqueue_events (display); |
8353
525e990ca9d2
(x_queue_event, x_unqueue_events): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
8291
diff
changeset
|
3210 } |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3211 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3212 /* The main X event-reading loop - XTread_socket. */ |
286 | 3213 |
3214 /* Timestamp of enter window event. This is only used by XTread_socket, | |
3215 but we have to put it out here, since static variables within functions | |
3216 sometimes don't work. */ | |
3217 static Time enter_timestamp; | |
3218 | |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3219 /* 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
|
3220 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
|
3221 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
|
3222 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
|
3223 |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3224 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
|
3225 given for enter_timestamp, above. */ |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3226 static XComposeStatus compose_status; |
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
3227 |
2064 | 3228 /* Record the last 100 characters stored |
3229 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
|
3230 static int temp_index; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3231 static short temp_buffer[100]; |
2064 | 3232 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3233 /* 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
|
3234 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
|
3235 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
|
3236 |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3237 /* 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
|
3238 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
|
3239 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
|
3240 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
|
3241 static struct x_display_info *next_noop_dpyinfo; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3242 |
286 | 3243 /* Read events coming from the X server. |
3244 This routine is called by the SIGIO handler. | |
3245 We return as soon as there are no more events to be read. | |
3246 | |
3247 Events representing keys are stored in buffer BUFP, | |
3248 which can hold up to NUMCHARS characters. | |
3249 We return the number of characters stored into the buffer, | |
3250 thus pretending to be `read'. | |
3251 | |
3252 WAITP is nonzero if we should block until input arrives. | |
3253 EXPECTED is nonzero if the caller knows input is available. */ | |
3254 | |
1530
a7f8a1fe258e
* xterm.c (x_convert_modifiers): Declare this to return an
Jim Blandy <jimb@redhat.com>
parents:
1436
diff
changeset
|
3255 int |
286 | 3256 XTread_socket (sd, bufp, numchars, waitp, expected) |
3257 register int sd; | |
3258 register struct input_event *bufp; | |
3259 register int numchars; | |
3260 int waitp; | |
3261 int expected; | |
3262 { | |
3263 int count = 0; | |
3264 int nbytes = 0; | |
3265 int mask; | |
3266 int items_pending; /* How many items are in the X queue. */ | |
3267 XEvent event; | |
771 | 3268 struct frame *f; |
3938
83d870a52936
* xterm.c (XTread_socket): Initialize event_found to zero, and
Jim Blandy <jimb@redhat.com>
parents:
3924
diff
changeset
|
3269 int event_found = 0; |
286 | 3270 int prefix; |
3271 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
|
3272 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
|
3273 #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
|
3274 Status status_return; |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3275 #endif |
286 | 3276 |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3277 if (interrupt_input_blocked) |
286 | 3278 { |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3279 interrupt_input_pending = 1; |
286 | 3280 return -1; |
3281 } | |
3282 | |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
3283 interrupt_input_pending = 0; |
286 | 3284 BLOCK_INPUT; |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3285 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3286 /* 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
|
3287 input_signal_count++; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
3288 |
286 | 3289 if (numchars <= 0) |
3290 abort (); /* Don't think this happens. */ | |
3291 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3292 /* 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
|
3293 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
|
3294 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
|
3295 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3296 #if 0 /* This ought to be unnecessary; let's verify it. */ |
286 | 3297 #ifdef FIOSNBIO |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3298 /* 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
|
3299 non-blocking, and then looks for EWOULDBLOCK. If O_NDELAY is set, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3300 FIOSNBIO is ignored, and instead of signalling EWOULDBLOCK, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3301 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
|
3302 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
|
3303 #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
|
3304 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3305 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3306 #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
|
3307 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
|
3308 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
|
3309 for X connections. */ |
286 | 3310 #ifndef SIGIO |
3311 #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
|
3312 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
|
3313 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3314 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
|
3315 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
|
3316 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
|
3317 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
|
3318 } |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
3319 #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
|
3320 #endif /* SIGIO */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3321 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3322 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3323 /* 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
|
3324 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
|
3325 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3326 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
|
3327 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
|
3328 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3329 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3330 while (XPending (dpyinfo->display) != 0) |
286 | 3331 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3332 XNextEvent (dpyinfo->display, &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3333 event_found = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3334 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3335 switch (event.type) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3336 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3337 case ClientMessage: |
642 | 3338 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3339 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
|
3340 == 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
|
3341 && event.xclient.format == 32) |
642 | 3342 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3343 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
|
3344 == 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
|
3345 { |
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
|
3346 f = 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
|
3347 /* Since we set WM_TAKE_FOCUS, we must call |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3348 XSetInputFocus explicitly. But not if f is null, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3349 since that might be an event for a deleted frame. */ |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3350 #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
|
3351 /* Not quite sure this is needed -pd */ |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3352 if (f) |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3353 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
|
3354 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3355 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3356 XSetInputFocus (event.xclient.display, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3357 event.xclient.window, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3358 RevertToPointerRoot, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3359 event.xclient.data.l[1]); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3360 /* 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
|
3361 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3362 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
|
3363 == dpyinfo->Xatom_wm_save_yourself) |
642 | 3364 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3365 /* 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
|
3366 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
|
3367 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
|
3368 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
|
3369 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
|
3370 if (numchars > 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3371 { |
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
|
3372 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
|
3373 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
|
3374 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3375 /* 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
|
3376 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
|
3377 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
|
3378 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
|
3379 event.xclient.window, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3380 initial_argv, initial_argc); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3381 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3382 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
|
3383 event.xclient.window, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3384 0, 0); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3385 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3386 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3387 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
|
3388 == 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
|
3389 { |
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
|
3390 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
|
3391 = 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
|
3392 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
|
3393 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3394 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3395 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3396 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3397 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3398 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3399 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
|
3400 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
|
3401 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3402 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3403 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3404 numchars -= 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3405 } |
642 | 3406 } |
3407 } | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3408 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
|
3409 == dpyinfo->Xatom_wm_configure_denied) |
642 | 3410 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3411 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3412 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
|
3413 == 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
|
3414 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3415 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
|
3416 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
|
3417 = 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
|
3418 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3419 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
|
3420 new_y = event.xclient.data.s[1]; |
771 | 3421 |
3422 if (f) | |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3423 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3424 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
|
3425 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
|
3426 } |
642 | 3427 } |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
3428 #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
|
3429 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
|
3430 == dpyinfo->Xatom_editres) |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3431 { |
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
|
3432 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
|
3433 = 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
|
3434 _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
|
3435 &event, NULL); |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
3436 } |
13507
9a9f459075af
(HACK_EDITRES): Define here as in xfns.c.
Richard M. Stallman <rms@gnu.org>
parents:
13363
diff
changeset
|
3437 #endif /* HACK_EDITRES */ |
642 | 3438 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3439 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3440 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3441 case SelectionNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3442 #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
|
3443 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
|
3444 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3445 #endif /* not USE_X_TOOLKIT */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3446 x_handle_selection_notify (&event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3447 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3448 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3449 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
|
3450 #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
|
3451 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
|
3452 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3453 #endif /* USE_X_TOOLKIT */ |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
3454 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3455 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
|
3456 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3457 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3458 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3459 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3460 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
|
3461 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
|
3462 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
|
3463 SELECTION_EVENT_TIME (bufp) = eventp->time; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3464 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3465 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3466 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3467 numchars -= 1; |
6941
a914781ef58a
(Xatom_editres_name): Variable defined.
Richard M. Stallman <rms@gnu.org>
parents:
6934
diff
changeset
|
3468 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3469 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3470 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3471 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
|
3472 #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
|
3473 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
|
3474 goto OTHER; |
6984
8e9465c13702
(XTread_socket): Delete the non-NEW_SELECTIONS code
Richard M. Stallman <rms@gnu.org>
parents:
6983
diff
changeset
|
3475 #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
|
3476 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
|
3477 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
|
3478 &event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3479 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3480 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3481 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
|
3482 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3483 if (numchars == 0) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3484 abort (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3485 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3486 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
|
3487 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
|
3488 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
|
3489 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
|
3490 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
|
3491 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
|
3492 SELECTION_EVENT_TIME (bufp) = eventp->time; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3493 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3494 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3495 count += 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3496 numchars -= 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3497 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3498 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3499 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3500 case PropertyNotify: |
6984
8e9465c13702
(XTread_socket): Delete the non-NEW_SELECTIONS code
Richard M. Stallman <rms@gnu.org>
parents:
6983
diff
changeset
|
3501 #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
|
3502 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
|
3503 goto OTHER; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3504 #endif /* not 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
|
3505 x_handle_property_notify (&event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3506 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3507 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3508 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
|
3509 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
|
3510 if (f) |
286 | 3511 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3512 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
|
3513 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
|
3514 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
|
3515 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
|
3516 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
|
3517 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3518 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3519 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3520 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
|
3521 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
|
3522 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3523 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3524 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
|
3525 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3526 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
|
3527 f->async_iconified = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3528 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
|
3529 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3530 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
|
3531 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
|
3532 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
|
3533 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
|
3534 event.xexpose.width, event.xexpose.height); |
286 | 3535 } |
3536 else | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3537 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3538 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
|
3539 = 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
|
3540 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3541 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3542 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
|
3543 #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
|
3544 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3545 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3546 #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
|
3547 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3548 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3549 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3550 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
|
3551 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
|
3552 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
|
3553 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
|
3554 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3555 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3556 dumprectangle (f, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3557 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
|
3558 event.xgraphicsexpose.width, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3559 event.xgraphicsexpose.height); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3560 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3561 #ifdef USE_X_TOOLKIT |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3562 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3563 goto OTHER; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3564 #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
|
3565 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3566 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3567 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
|
3568 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
|
3569 available */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3570 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3571 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3572 case UnmapNotify: |
12750
7e5276da6270
(XTread_socket): For UnmapNotify, use x_top_window_to_frame.
Richard M. Stallman <rms@gnu.org>
parents:
12667
diff
changeset
|
3573 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
|
3574 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
|
3575 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
|
3576 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3577 /* 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
|
3578 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
|
3579 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
|
3580 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
|
3581 /* 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
|
3582 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
|
3583 was previously visible, than now it is iconified. |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3584 We depend on x_make_frame_invisible to mark it iconified. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3585 if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3586 f->async_iconified = 1; |
9823
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3587 |
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3588 bufp->kind = iconify_event; |
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3589 XSETFRAME (bufp->frame_or_window, f); |
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3590 bufp++; |
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3591 count++; |
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3592 numchars--; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3593 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3594 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3595 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3596 case MapNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3597 /* 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
|
3598 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
|
3599 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
|
3600 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3601 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3602 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
|
3603 f->async_iconified = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3604 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3605 /* 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
|
3606 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
|
3607 SET_FRAME_GARBAGED (f); |
9823
e6dbda62fd61
(XTread_socket): Generate iconify and deiconify events.
Karl Heuer <kwzh@gnu.org>
parents:
9763
diff
changeset
|
3608 |
11348
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3609 if (f->iconified) |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3610 { |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3611 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
|
3612 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
|
3613 bufp++; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3614 count++; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3615 numchars--; |
e366abc2c753
(XTread_socket): Make deiconify event only if frame was iconified.
Richard M. Stallman <rms@gnu.org>
parents:
11259
diff
changeset
|
3616 } |
11921
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
3617 else |
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
3618 /* 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
|
3619 to update the frame titles |
6ecaa3fac4e4
(XTread_socket): For MapNotify, call record_asynch_buffer_change.
Karl Heuer <kwzh@gnu.org>
parents:
11915
diff
changeset
|
3620 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
|
3621 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
|
3622 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3623 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3624 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3625 /* 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
|
3626 case VisibilityNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3627 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3628 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3629 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
|
3630 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
|
3631 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3632 if (f != 0) |
286 | 3633 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3634 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
|
3635 /* 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
|
3636 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
|
3637 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
|
3638 int modifiers; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3639 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3640 event.xkey.state |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3641 |= 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
|
3642 extra_keyboard_modifiers); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3643 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
|
3644 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3645 /* 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
|
3646 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3647 /* 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
|
3648 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
|
3649 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
|
3650 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
|
3651 | 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
|
3652 | 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
|
3653 | 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
|
3654 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3655 #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
|
3656 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
|
3657 { |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3658 /* The necessity of the following line took me |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3659 a full work-day to decipher from the docs!! */ |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3660 if (XFilterEvent (&event, None)) |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3661 break; |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3662 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
|
3663 &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
|
3664 80, &keysym, |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3665 &status_return); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3666 } |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3667 else |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3668 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
|
3669 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
|
3670 #else |
10287
2e96f9f98276
(x_scroll_bar_handle_click): Use GC_WINDOWP.
Richard M. Stallman <rms@gnu.org>
parents:
10274
diff
changeset
|
3671 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
|
3672 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
|
3673 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3674 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3675 orig_keysym = keysym; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3676 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3677 if (numchars > 1) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3678 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3679 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
|
3680 || keysym == XK_Delete |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3681 || 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
|
3682 || IsMiscFunctionKey (keysym) /* 0xff60 <= x < VARIES */ |
3218
0069a30d083f
(XTread_socket, case KeyPress) [HPUX]:
Richard M. Stallman <rms@gnu.org>
parents:
3135
diff
changeset
|
3683 #ifdef HPUX |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3684 /* 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
|
3685 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
|
3686 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
|
3687 incorrectly. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3688 || ((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
|
3689 && (unsigned)(keysym) < XK_KP_Space) |
3218
0069a30d083f
(XTread_socket, case KeyPress) [HPUX]:
Richard M. Stallman <rms@gnu.org>
parents:
3135
diff
changeset
|
3690 #endif |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3691 #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
|
3692 || orig_keysym == XK_dead_circumflex |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3693 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3694 #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
|
3695 || orig_keysym == XK_dead_grave |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3696 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3697 #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
|
3698 || orig_keysym == XK_dead_tilde |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3699 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3700 #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
|
3701 || orig_keysym == XK_dead_diaeresis |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3702 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3703 #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
|
3704 || orig_keysym == XK_dead_macron |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3705 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3706 #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
|
3707 || orig_keysym == XK_dead_degree |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3708 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3709 #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
|
3710 || orig_keysym == XK_dead_acute |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3711 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3712 #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
|
3713 || orig_keysym == XK_dead_cedilla |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3714 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3715 #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
|
3716 || orig_keysym == XK_dead_breve |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3717 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3718 #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
|
3719 || orig_keysym == XK_dead_ogonek |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3720 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3721 #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
|
3722 || orig_keysym == XK_dead_caron |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3723 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3724 #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
|
3725 || orig_keysym == XK_dead_doubleacute |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3726 #endif |
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3727 #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
|
3728 || orig_keysym == XK_dead_abovedot |
5228
c094c1df2e87
(XTread_socket): Don't offset keysym here.
Richard M. Stallman <rms@gnu.org>
parents:
5156
diff
changeset
|
3729 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3730 || 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
|
3731 || 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
|
3732 /* 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
|
3733 || (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
|
3734 && ! (IsModifierKey (orig_keysym) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3735 #ifndef HAVE_X11R5 |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3736 #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
|
3737 || ((unsigned)(orig_keysym) == XK_Mode_switch) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3738 #endif |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3739 #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
|
3740 || ((unsigned)(orig_keysym) == XK_Num_Lock) |
4244
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3741 #endif |
bc70363458c3
(XTread_socket) [! HAVE_X11R5]:
Richard M. Stallman <rms@gnu.org>
parents:
4147
diff
changeset
|
3742 #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
|
3743 )) |
286 | 3744 { |
2064 | 3745 if (temp_index == sizeof temp_buffer / sizeof (short)) |
3746 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
|
3747 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
|
3748 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
|
3749 bufp->code = keysym; |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
3750 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
|
3751 bufp->modifiers |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
3752 = 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
|
3753 modifiers); |
708 | 3754 bufp->timestamp = event.xkey.time; |
286 | 3755 bufp++; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3756 count++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3757 numchars--; |
286 | 3758 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3759 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
|
3760 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3761 register int i; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3762 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3763 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
|
3764 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3765 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
|
3766 temp_index = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3767 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
|
3768 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
|
3769 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
|
3770 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
|
3771 bufp->modifiers |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3772 = 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
|
3773 modifiers); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3774 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
|
3775 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3776 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3777 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3778 count += nbytes; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3779 numchars -= nbytes; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3780 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3781 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3782 abort (); |
286 | 3783 } |
2064 | 3784 else |
3785 abort (); | |
286 | 3786 } |
13898
dceb33c07f9e
(XTread_socket): Pass KeyPress events to the toolkit.
Richard M. Stallman <rms@gnu.org>
parents:
13884
diff
changeset
|
3787 goto OTHER; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3788 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3789 /* 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
|
3790 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
|
3791 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
|
3792 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
|
3793 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
|
3794 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3795 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
|
3796 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
|
3797 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3798 if (event.xcrossing.focus) /* Entered Window */ |
286 | 3799 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3800 /* 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
|
3801 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
|
3802 || !(f->auto_lower) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3803 || (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
|
3804 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
3805 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
|
3806 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
|
3807 } |
286 | 3808 } |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
3809 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
|
3810 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
|
3811 /* 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
|
3812 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
|
3813 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3814 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
|
3815 goto OTHER; |
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 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
|
3818 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
|
3819 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
|
3820 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
|
3821 if (f) |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
3822 x_new_focus_frame (dpyinfo, f); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3823 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3824 #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
|
3825 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
|
3826 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
|
3827 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3828 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3829 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3830 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3831 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
|
3832 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
|
3833 if (f) |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
3834 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3835 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
|
3836 /* 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
|
3837 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
|
3838 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
|
3839 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3840 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
|
3841 x_mouse_leave (dpyinfo); |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
3842 else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3843 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
3844 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
|
3845 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
|
3846 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
|
3847 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
|
3848 } |
7169
c21fcad6f1f5
(XTread_socket): Only top window cares about LeaveNotify.
Karl Heuer <kwzh@gnu.org>
parents:
7167
diff
changeset
|
3849 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3850 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3851 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3852 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
|
3853 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
|
3854 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
|
3855 && 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
|
3856 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
|
3857 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
|
3858 x_new_focus_frame (dpyinfo, 0); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
3859 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3860 #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
|
3861 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
|
3862 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
|
3863 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
3864 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3865 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3866 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3867 case MotionNotify: |
286 | 3868 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3869 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
|
3870 && 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
|
3871 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
|
3872 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
|
3873 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
|
3874 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3875 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
|
3876 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3877 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3878 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
|
3879 = 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
|
3880 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3881 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3882 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
|
3883 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3884 /* 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
|
3885 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
|
3886 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
|
3887 } |
286 | 3888 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3889 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3890 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3891 case ConfigureNotify: |
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
|
3892 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window); |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3893 if (f |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
3894 #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
|
3895 && (event.xconfigure.window == XtWindow (f->output_data.x->widget)) |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
3896 #endif |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3897 ) |
3030
2c5ea1c98256
(XTread_socket): For ConfigureNotify event,
Richard M. Stallman <rms@gnu.org>
parents:
3016
diff
changeset
|
3898 { |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3899 #ifndef USE_X_TOOLKIT |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3900 /* 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
|
3901 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
|
3902 of the EmacsFrame widget. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3903 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3904 int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3905 int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3906 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3907 /* 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
|
3908 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
|
3909 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
|
3910 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
|
3911 || 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
|
3912 || 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
|
3913 || 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
|
3914 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3915 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
|
3916 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
|
3917 } |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3918 #endif |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3919 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3920 /* Formerly, in the USE_X_TOOLKIT version, |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3921 we did not test send_event here. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3922 if (1 |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3923 #ifndef USE_X_TOOLKIT |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3924 && ! event.xconfigure.send_event |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3925 #endif |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3926 ) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3927 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3928 Window win, child; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3929 int win_x, win_y; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3930 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3931 /* Find the position of the outside upper-left corner of |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3932 the window, in the root coordinate system. Don't |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3933 refer to the parent window here; we may be processing |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3934 this event after the window manager has changed our |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3935 parent, but before we have reached the ReparentNotify. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3936 XTranslateCoordinates (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
|
3937 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3938 /* From-window, to-window. */ |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3939 event.xconfigure.window, |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3940 FRAME_X_DISPLAY_INFO (f)->root_window, |
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 /* From-position, to-position. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3943 -event.xconfigure.border_width, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3944 -event.xconfigure.border_width, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3945 &win_x, &win_y, |
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 /* Child of win. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3948 &child); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3949 event.xconfigure.x = win_x; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3950 event.xconfigure.y = win_y; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3951 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3952 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3953 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
|
3954 f->output_data.x->pixel_height = event.xconfigure.height; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3955 f->output_data.x->left_pos = event.xconfigure.x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
3956 f->output_data.x->top_pos = event.xconfigure.y; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3957 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3958 /* 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
|
3959 Convert that to the position of the window manager window. */ |
7738
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
3960 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3961 int x, y; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3962 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
|
3963 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
|
3964 f->output_data.x->top_pos = y; |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3965 /* Formerly we did not do this in the USE_X_TOOLKIT |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3966 version. Let's try making them the same. */ |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3967 /* #ifndef 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
|
3968 if (y != event.xconfigure.y) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3969 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3970 /* Since the WM decorations come below top_pos now, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3971 we must put them below top_pos in the future. */ |
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->win_gravity = NorthWestGravity; |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
3973 x_wm_set_size_hint (f, (long) 0, 0); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3974 } |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3975 /* #endif */ |
7738
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
3976 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3977 } |
11436
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
3978 goto OTHER; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3979 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3980 case ButtonPress: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3981 case ButtonRelease: |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
3982 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3983 /* 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
|
3984 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
|
3985 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
|
3986 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
|
3987 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3988 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
|
3989 |
10274
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
3990 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
|
3991 && 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
|
3992 f = last_mouse_frame; |
83aaf59dabbe
(XTupdate_begin): Fix backward test in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
10223
diff
changeset
|
3993 else |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
3994 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
|
3995 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3996 if (f) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
3997 { |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
3998 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
|
3999 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
|
4000 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4001 else |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
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 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
|
4004 = 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
|
4005 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4006 if (bar) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4007 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
|
4008 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4009 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4010 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
|
4011 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4012 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
|
4013 last_mouse_frame = f; |
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 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4016 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4017 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
|
4018 } |
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 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
|
4021 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4022 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
|
4023 bufp++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4024 count++; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4025 numchars--; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4026 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4027 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4028 #ifdef USE_X_TOOLKIT |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4029 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
|
4030 /* For a down-event in the menu bar, |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4031 don't pass it to Xt right now. |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4032 Instead, save it away |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4033 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
|
4034 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
|
4035 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
|
4036 /* 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
|
4037 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
|
4038 && event.xbutton.x >= 0 |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4039 && 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
|
4040 && event.xbutton.y >= 0 |
21b6b8f50143
(XTread_socket): Verify a ButtonPress was actually in the
Richard M. Stallman <rms@gnu.org>
parents:
13507
diff
changeset
|
4041 && 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
|
4042 && event.xbutton.same_screen) |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4043 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4044 if (f->output_data.x->saved_button_event == 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4045 f->output_data.x->saved_button_event |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4046 = (XButtonEvent *) xmalloc (sizeof (XButtonEvent)); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4047 bcopy (&event, f->output_data.x->saved_button_event, |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4048 sizeof (XButtonEvent)); |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4049 if (numchars >= 1) |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4050 { |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4051 bufp->kind = menu_bar_activate_event; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4052 XSETFRAME (bufp->frame_or_window, f); |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4053 bufp++; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4054 count++; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4055 numchars--; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4056 } |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4057 } |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4058 else |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4059 goto OTHER; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
4060 #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
|
4061 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4062 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4063 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4064 case CirculateNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4065 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4066 case CirculateRequest: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4067 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4068 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4069 case MappingNotify: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4070 /* 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
|
4071 local cache. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4072 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
|
4073 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4074 case MappingModifier: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4075 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
|
4076 /* 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
|
4077 case MappingKeyboard: |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4078 XRefreshKeyboardMapping (&event.xmapping); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4079 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4080 goto OTHER; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4081 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4082 default: |
13898
dceb33c07f9e
(XTread_socket): Pass KeyPress events to the toolkit.
Richard M. Stallman <rms@gnu.org>
parents:
13884
diff
changeset
|
4083 OTHER: |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4084 #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
|
4085 BLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4086 XtDispatchEvent (&event); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4087 UNBLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4088 #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
|
4089 break; |
1436
e7c5faab6571
* xterm.c (compose_status): New variable.
Jim Blandy <jimb@redhat.com>
parents:
1389
diff
changeset
|
4090 } |
286 | 4091 } |
4092 } | |
4093 | |
8485
6e4b40c80021
(XTread_socket): Don't test X_IO_BUG; make that code unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
8437
diff
changeset
|
4094 /* 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
|
4095 when the window is destroyed. Detect that. (1994.) */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4096 if (! event_found) |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4097 { |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4098 /* 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
|
4099 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
|
4100 B. Bretthauer, 1994 */ |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4101 x_noop_count++; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4102 if (x_noop_count >= 100) |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4103 { |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4104 x_noop_count=0; |
12657
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4105 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4106 if (next_noop_dpyinfo == 0) |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4107 next_noop_dpyinfo = x_display_list; |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4108 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4109 XNoOp (next_noop_dpyinfo->display); |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4110 |
05b7a5d25df6
(next_noop_dpyinfo): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12530
diff
changeset
|
4111 /* 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
|
4112 next_noop_dpyinfo = next_noop_dpyinfo->next; |
7916
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4113 } |
50e9e0c8806a
(x_noop_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7905
diff
changeset
|
4114 } |
5753
eb44ecad5557
(XTread_socket): Add X_IO_BUG conditional.
Richard M. Stallman <rms@gnu.org>
parents:
5740
diff
changeset
|
4115 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4116 /* 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
|
4117 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
|
4118 /* ??? 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
|
4119 if (pending_autoraise_frame) |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4120 { |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4121 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
|
4122 pending_autoraise_frame = 0; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4123 } |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
4124 |
286 | 4125 UNBLOCK_INPUT; |
4126 return count; | |
4127 } | |
4128 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4129 /* Drawing the cursor. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4130 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4131 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4132 /* 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
|
4133 Don't change the inside of the box. */ |
286 | 4134 |
4135 static void | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4136 x_draw_box (f, x, y) |
771 | 4137 struct frame *f; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4138 int x, y; |
286 | 4139 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4140 int left = CHAR_TO_PIXEL_COL (f, x); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4141 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
|
4142 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
|
4143 int height = f->output_data.x->line_height; |
286 | 4144 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4145 XDrawRectangle (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
|
4146 f->output_data.x->cursor_gc, |
286 | 4147 left, top, width - 1, height - 1); |
4148 } | |
4149 | |
771 | 4150 /* Clear the cursor of frame F to background color, |
286 | 4151 and mark the cursor as not shown. |
4152 This is used when the text where the cursor is | |
4153 is about to be rewritten. */ | |
4154 | |
4155 static void | |
771 | 4156 clear_cursor (f) |
4157 struct frame *f; | |
286 | 4158 { |
4159 int mask; | |
4160 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4161 if (! FRAME_VISIBLE_P (f) |
771 | 4162 || f->phys_cursor_x < 0) |
286 | 4163 return; |
4164 | |
771 | 4165 x_display_cursor (f, 0); |
4166 f->phys_cursor_x = -1; | |
286 | 4167 } |
4168 | |
771 | 4169 /* Redraw the glyph at ROW, COLUMN on frame F, in the style |
429 | 4170 HIGHLIGHT. HIGHLIGHT is as defined for dumpglyphs. Return the |
4171 glyph drawn. */ | |
286 | 4172 |
4173 static void | |
771 | 4174 x_draw_single_glyph (f, row, column, glyph, highlight) |
4175 struct frame *f; | |
286 | 4176 int row, column; |
429 | 4177 GLYPH glyph; |
286 | 4178 int highlight; |
4179 { | |
771 | 4180 dumpglyphs (f, |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
4181 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
|
4182 CHAR_TO_PIXEL_ROW (f, row), |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4183 &glyph, 1, highlight, 0); |
286 | 4184 } |
4185 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4186 static void |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4187 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
|
4188 struct frame *f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4189 int on; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4190 int x, y; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4191 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4192 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
|
4193 |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4194 /* 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
|
4195 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
|
4196 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
|
4197 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
|
4198 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4199 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4200 if (! on && f->phys_cursor_x < 0) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4201 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4202 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4203 /* If there is anything wrong with the current cursor state, remove it. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4204 if (f->phys_cursor_x >= 0 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4205 && (!on |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4206 || f->phys_cursor_x != x |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4207 || 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
|
4208 || 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
|
4209 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4210 /* 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
|
4211 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
|
4212 f->phys_cursor_glyph, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4213 current_glyphs->highlight[f->phys_cursor_y]); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4214 f->phys_cursor_x = -1; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4215 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4216 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4217 /* 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
|
4218 if (on |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4219 && (f->phys_cursor_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
|
4220 || (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
|
4221 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4222 f->phys_cursor_glyph |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4223 = ((current_glyphs->enable[y] |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4224 && x < current_glyphs->used[y]) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4225 ? current_glyphs->glyphs[y][x] |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4226 : SPACEGLYPH); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4227 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
|
4228 f->output_data.x->cursor_gc, |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4229 CHAR_TO_PIXEL_COL (f, x), |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4230 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
|
4231 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
|
4232 f->output_data.x->line_height); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4233 |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4234 f->phys_cursor_x = x; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4235 f->phys_cursor_y = y; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4236 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4237 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
|
4238 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4239 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4240 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
|
4241 XFlush (FRAME_X_DISPLAY (f)); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4242 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4243 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4244 |
771 | 4245 /* 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
|
4246 If ON is nonzero, where to put the cursor is specified by X and Y. */ |
286 | 4247 |
4248 static void | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4249 x_display_box_cursor (f, on, x, y) |
771 | 4250 struct frame *f; |
286 | 4251 int on; |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4252 int x, y; |
286 | 4253 { |
771 | 4254 struct frame_glyphs *current_glyphs = FRAME_CURRENT_GLYPHS (f); |
4255 | |
2235
80e0d36bbb77
* xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't
Jim Blandy <jimb@redhat.com>
parents:
2195
diff
changeset
|
4256 /* 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
|
4257 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
|
4258 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
|
4259 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
|
4260 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4261 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4262 /* If cursor is off and we want it off, return quickly. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4263 if (!on && f->phys_cursor_x < 0) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4264 return; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4265 |
286 | 4266 /* If cursor is currently being shown and we don't want it to be |
4267 or it is in the wrong place, | |
4268 or we want a hollow box and it's not so, (pout!) | |
4269 erase it. */ | |
771 | 4270 if (f->phys_cursor_x >= 0 |
286 | 4271 && (!on |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4272 || f->phys_cursor_x != x |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4273 || 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
|
4274 || (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
|
4275 && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) |
286 | 4276 { |
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
|
4277 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
|
4278 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
|
4279 |
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
|
4280 /* 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
|
4281 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
|
4282 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
|
4283 && |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4284 (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
|
4285 || (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
|
4286 && 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
|
4287 && |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4288 (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
|
4289 || (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
|
4290 && 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
|
4291 /* 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
|
4292 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
|
4293 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
|
4294 && 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
|
4295 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
|
4296 |
6791
7036e4fd549f
(dumpglyphs): Clear any extra pixel rows below the text.
Richard M. Stallman <rms@gnu.org>
parents:
6767
diff
changeset
|
4297 /* 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
|
4298 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
|
4299 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
|
4300 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
|
4301 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
|
4302 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
|
4303 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
|
4304 f->output_data.x->line_height, False); |
286 | 4305 /* Erase the cursor by redrawing the character underneath it. */ |
771 | 4306 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, |
4307 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
|
4308 (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
|
4309 ? 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
|
4310 : current_glyphs->highlight[f->phys_cursor_y])); |
771 | 4311 f->phys_cursor_x = -1; |
286 | 4312 } |
4313 | |
4314 /* If we want to show a cursor, | |
4315 or we want a box cursor and it's not so, | |
4316 write it in the right place. */ | |
4317 if (on | |
771 | 4318 && (f->phys_cursor_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
|
4319 || (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
|
4320 && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) |
286 | 4321 { |
771 | 4322 f->phys_cursor_glyph |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4323 = ((current_glyphs->enable[y] |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4324 && x < current_glyphs->used[y]) |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4325 ? current_glyphs->glyphs[y][x] |
429 | 4326 : SPACEGLYPH); |
11536
c4d3218acd7e
(x_focus_frame, x_focus_event_frame, x_highlight_frame):
Karl Heuer <kwzh@gnu.org>
parents:
11436
diff
changeset
|
4327 if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) |
286 | 4328 { |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4329 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
|
4330 f->output_data.x->current_cursor = hollow_box_cursor; |
286 | 4331 } |
4332 else | |
4333 { | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4334 x_draw_single_glyph (f, y, x, |
771 | 4335 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
|
4336 f->output_data.x->current_cursor = filled_box_cursor; |
286 | 4337 } |
4338 | |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4339 f->phys_cursor_x = x; |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4340 f->phys_cursor_y = y; |
286 | 4341 } |
4342 | |
771 | 4343 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
|
4344 XFlush (FRAME_X_DISPLAY (f)); |
286 | 4345 } |
4346 | |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4347 /* 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
|
4348 Use the position specified by curs_x and curs_y |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4349 if we are doing an update of frame F now. |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4350 Otherwise use the position in the FRAME_CURSOR_X and FRAME_CURSOR_Y fields |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4351 of F. */ |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4352 |
771 | 4353 x_display_cursor (f, on) |
4354 struct frame *f; | |
286 | 4355 int on; |
4356 { | |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4357 BLOCK_INPUT; |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4358 |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4359 /* If we're not updating, then don't change the physical cursor |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4360 position. Just change (if appropriate) the style of display. */ |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4361 if (f != updating_frame) |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4362 { |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4363 curs_x = FRAME_CURSOR_X (f); |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4364 curs_y = FRAME_CURSOR_Y (f); |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4365 } |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4366 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4367 if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4368 x_display_box_cursor (f, on, curs_x, curs_y); |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4369 else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4370 x_display_bar_cursor (f, on, curs_x, curs_y); |
12431
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4371 else |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4372 /* 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
|
4373 abort (); |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4374 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4375 UNBLOCK_INPUT; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4376 } |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4377 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4378 /* 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
|
4379 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
|
4380 |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4381 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
|
4382 struct frame *f; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4383 int on; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4384 { |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4385 BLOCK_INPUT; |
80a5aedfb4c7
(XTread_socket): Turn off meta, super, hyper and alt bits
Richard M. Stallman <rms@gnu.org>
parents:
12192
diff
changeset
|
4386 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4387 if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4388 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
|
4389 else if (FRAME_DESIRED_CURSOR (f) == bar_cursor) |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
4390 x_display_bar_cursor (f, on, f->phys_cursor_x, f->phys_cursor_y); |
286 | 4391 else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4392 /* Those are the only two we have implemented! */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4393 abort (); |
5872
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4394 |
6389c826f847
(x_display_cursor, process_expose_from_menu): Block input.
Karl Heuer <kwzh@gnu.org>
parents:
5825
diff
changeset
|
4395 UNBLOCK_INPUT; |
286 | 4396 } |
4397 | |
4398 /* Icons. */ | |
4399 | |
771 | 4400 /* Refresh bitmap kitchen sink icon for frame F |
286 | 4401 when we get an expose event for it. */ |
4402 | |
771 | 4403 refreshicon (f) |
4404 struct frame *f; | |
286 | 4405 { |
4406 /* Normally, the window manager handles this function. */ | |
4407 } | |
4408 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
4409 /* Make the x-window of frame F use the gnu icon bitmap. */ |
286 | 4410 |
4411 int | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4412 x_bitmap_icon (f, file) |
771 | 4413 struct frame *f; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4414 Lisp_Object file; |
286 | 4415 { |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
4416 int mask, bitmap_id; |
286 | 4417 Window icon_window; |
4418 | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4419 if (FRAME_X_WINDOW (f) == 0) |
286 | 4420 return 1; |
4421 | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4422 /* 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
|
4423 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
|
4424 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
|
4425 f->output_data.x->icon_bitmap = 0; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4426 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4427 if (STRINGP (file)) |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
4428 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
|
4429 else |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
4430 { |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4431 /* 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
|
4432 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
|
4433 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
|
4434 = 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
|
4435 gnu_width, gnu_height); |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4436 |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4437 /* The first time we create the GNU bitmap, |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4438 this increments the refcount one extra time. |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
4439 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
|
4440 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
|
4441 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
|
4442 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4443 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
|
4444 } |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
4445 |
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
4446 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
|
4447 f->output_data.x->icon_bitmap = bitmap_id; |
286 | 4448 |
4449 return 0; | |
4450 } | |
4451 | |
4452 | |
12074
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4453 /* 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
|
4454 Use ICON_NAME as the text. */ |
286 | 4455 |
4456 int | |
771 | 4457 x_text_icon (f, icon_name) |
4458 struct frame *f; | |
286 | 4459 char *icon_name; |
4460 { | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4461 if (FRAME_X_WINDOW (f) == 0) |
286 | 4462 return 1; |
4463 | |
12074
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4464 #ifdef HAVE_X11R4 |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4465 { |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4466 XTextProperty text; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4467 text.value = (unsigned char *) icon_name; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4468 text.encoding = XA_STRING; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4469 text.format = 8; |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4470 text.nitems = strlen (icon_name); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4471 #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
|
4472 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
|
4473 &text); |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4474 #else /* not USE_X_TOOLKIT */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4475 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
|
4476 #endif /* not USE_X_TOOLKIT */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4477 } |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4478 #else /* not HAVE_X11R4 */ |
111aadc2521a
(x_text_icon): Do call XSetIconName or XSetWMIconName.
Karl Heuer <kwzh@gnu.org>
parents:
12000
diff
changeset
|
4479 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
|
4480 #endif /* not HAVE_X11R4 */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4481 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4482 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
|
4483 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
|
4484 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
|
4485 x_wm_set_icon_pixmap (f, 0); |
286 | 4486 |
4487 return 0; | |
4488 } | |
4489 | |
621 | 4490 /* Handling X errors. */ |
4491 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4492 /* 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
|
4493 |
621 | 4494 static SIGTYPE |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4495 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
|
4496 Display *display; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4497 char *error_message; |
621 | 4498 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4499 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
|
4500 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
|
4501 |
11904
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4502 /* Whatever we were in the middle of, we are going to throw out of it, |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4503 so reassure various things that have error checks about being |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4504 called with input blocked. */ |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4505 TOTALLY_UNBLOCK_INPUT; |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4506 |
621 | 4507 if (_Xdebug) |
4508 abort (); | |
1787
5e245540d06f
Make scrollbar structures into lisp objects, so that they can be
Jim Blandy <jimb@redhat.com>
parents:
1739
diff
changeset
|
4509 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4510 /* 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
|
4511 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
|
4512 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
|
4513 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4514 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
|
4515 minibuf_frame |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4516 = 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
|
4517 if (FRAME_X_P (XFRAME (frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
4518 && FRAME_X_P (XFRAME (minibuf_frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
4519 && ! EQ (frame, minibuf_frame) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
4520 && 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
|
4521 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
|
4522 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4523 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4524 /* 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
|
4525 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
|
4526 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
|
4527 FOR_EACH_FRAME (tail, frame) |
10921
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
4528 if (FRAME_X_P (XFRAME (frame)) |
bf33c9179a6b
(x_connection_closed): Ignore non-X frames.
Richard M. Stallman <rms@gnu.org>
parents:
10755
diff
changeset
|
4529 && 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
|
4530 { |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4531 /* 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
|
4532 trying to find a replacement. */ |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4533 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
|
4534 Fdelete_frame (frame, Qt); |
0d37c1e81c0d
(x_connection_closed): Unblock input, first thing.
Karl Heuer <kwzh@gnu.org>
parents:
11901
diff
changeset
|
4535 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4536 |
13727
9eb09adbcb38
(x_connection_closed): Don't delete dpyinfo if it's null.
Karl Heuer <kwzh@gnu.org>
parents:
13633
diff
changeset
|
4537 if (dpyinfo) |
9eb09adbcb38
(x_connection_closed): Don't delete dpyinfo if it's null.
Karl Heuer <kwzh@gnu.org>
parents:
13633
diff
changeset
|
4538 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
|
4539 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4540 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
|
4541 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4542 fprintf (stderr, "%s", error_message); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4543 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
|
4544 exit (70); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4545 } |
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 /* 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
|
4548 #ifdef SIGIO |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4549 sigunblock (sigmask (SIGIO)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4550 #endif |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4551 sigunblock (sigmask (SIGALRM)); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4552 TOTALLY_UNBLOCK_INPUT; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4553 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4554 error ("%s", error_message); |
621 | 4555 } |
4556 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4557 /* 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
|
4558 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
|
4559 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
|
4560 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4561 static int |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4562 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
|
4563 Display *display; |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4564 XErrorEvent *error; |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4565 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4566 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
|
4567 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4568 /* 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
|
4569 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
|
4570 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4571 XGetErrorText (display, error->error_code, buf, sizeof (buf)); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4572 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
|
4573 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
|
4574 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
|
4575 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4576 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4577 /* 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
|
4578 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
|
4579 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
|
4580 |
1875
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
4581 static int |
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
4582 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
|
4583 Display *display; |
f569bc4e9b8f
* xterm.c (x_set_window_size): Call change_frame_size instead of
Jim Blandy <jimb@redhat.com>
parents:
1841
diff
changeset
|
4584 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4585 char buf[256]; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4586 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4587 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
|
4588 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
|
4589 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4590 |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4591 /* Handle SIGPIPE, which can happen when the connection to a server |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4592 simply goes away. SIGPIPE is handled by x_connection_signal. |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4593 It works by sending a no-op command to each X server connection. |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4594 When we try a connection that has closed, we get SIGPIPE again. |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4595 But this time, it is handled by x_connection_signal_1. |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4596 That function knows which connection we were testing, |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4597 so it closes that one. |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4598 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4599 x_connection_closed never returns, |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4600 so if more than one connection was lost at once, |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4601 we only find one. But XTread_socket keeps trying them all, |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4602 so it will notice the other closed one sooner or later. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4603 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4604 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4605 static struct x_display_info *x_connection_signal_dpyinfo; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4606 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4607 static SIGTYPE x_connection_signal (); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4608 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4609 static SIGTYPE |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4610 x_connection_signal_1 (signalnum) /* If we don't have an argument, */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4611 int signalnum; /* some compilers complain in signal calls. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4612 { |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4613 signal (SIGPIPE, x_connection_signal); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4614 x_connection_closed (x_connection_signal_dpyinfo, |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4615 "connection was lost"); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4616 } |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4617 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4618 static SIGTYPE |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4619 x_connection_signal (signalnum) /* If we don't have an argument, */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4620 int signalnum; /* some compilers complain in signal calls. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4621 { |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4622 x_connection_signal_dpyinfo = x_display_list; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4623 |
13782
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4624 stop_polling (); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4625 sigunblock (SIGPIPE); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4626 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4627 while (x_connection_signal_dpyinfo) |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4628 { |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4629 signal (SIGPIPE, x_connection_signal_1); |
13782
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4630 signal (SIGALRM, x_connection_signal_1); |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4631 |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4632 /* According to Jim Campbell <jec@murzim.ca.boeing.com>, |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4633 On Solaris 2.4, XNoOp can hang when the connection |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4634 has already died. Since XNoOp should not wait, |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4635 let's assume that if it hangs for 3 seconds |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4636 that means the connection is dead. |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4637 This is a kludge, but I don't see any other way that works. */ |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4638 alarm (3); |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4639 XNoOp (x_connection_signal_dpyinfo->display); |
13782
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4640 alarm (0); |
52f469edf216
(x_connection_signal): Set an alarm around XNoOp call.
Karl Heuer <kwzh@gnu.org>
parents:
13727
diff
changeset
|
4641 |
13205
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4642 XSync (x_connection_signal_dpyinfo->display, False); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4643 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4644 /* Each time we get here, cycle through the displays now open. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4645 x_connection_signal_dpyinfo = x_connection_signal_dpyinfo->next; |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4646 } |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4647 |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4648 /* We should have found some closed connection. */ |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4649 abort (); |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4650 } |
8eac10febc8e
(x_connection_signal_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12966
diff
changeset
|
4651 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4652 /* A buffer for storing X error messages. */ |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4653 static char *x_caught_error_message; |
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4654 #define X_CAUGHT_ERROR_MESSAGE_SIZE 200 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4655 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4656 /* An X error handler which stores the error message in |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4657 x_caught_error_message. This is what's installed when |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4658 x_catch_errors is in effect. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4659 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4660 static int |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4661 x_error_catcher (display, error) |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4662 Display *display; |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4663 XErrorEvent *error; |
286 | 4664 { |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4665 XGetErrorText (display, error->error_code, |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4666 x_caught_error_message, X_CAUGHT_ERROR_MESSAGE_SIZE); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4667 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4668 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4669 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4670 /* Begin trapping X errors for display DPY. Actually we trap X errors |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4671 for all displays, but DPY should be the display you are actually |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4672 operating on. |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4673 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4674 After calling this function, X protocol errors no longer cause |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4675 Emacs to exit; instead, they are recorded in x_cfc_error_message. |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4676 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4677 Calling x_check_errors signals an Emacs error if an X error has |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4678 occurred since the last call to x_catch_errors or x_check_errors. |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4679 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4680 Calling x_uncatch_errors resumes the normal error handling. */ |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4681 |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
4682 void x_catch_errors (), x_check_errors (), x_uncatch_errors (); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4683 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4684 void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4685 x_catch_errors (dpy) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4686 Display *dpy; |
286 | 4687 { |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4688 /* Make sure any errors from previous requests have been dealt with. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4689 XSync (dpy, False); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4690 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4691 /* Set up the error buffer. */ |
3465
d23de4338f96
(x_catch_errors): Fill in missing array size in cast.
Richard M. Stallman <rms@gnu.org>
parents:
3444
diff
changeset
|
4692 x_caught_error_message |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4693 = (char*) xmalloc (X_CAUGHT_ERROR_MESSAGE_SIZE); |
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4694 x_caught_error_message[0] = '\0'; |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4695 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4696 /* Install our little 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
|
4697 XSetErrorHandler (x_error_catcher); |
286 | 4698 } |
4699 | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4700 /* If any X protocol errors have arrived since the last call to |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4701 x_catch_errors or x_check_errors, signal an Emacs error using |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4702 sprintf (a buffer, FORMAT, the x error message text) as the text. */ |
5986 | 4703 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4704 void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4705 x_check_errors (dpy, format) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4706 Display *dpy; |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4707 char *format; |
286 | 4708 { |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4709 /* Make sure to catch any errors incurred so far. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4710 XSync (dpy, False); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4711 |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4712 if (x_caught_error_message[0]) |
286 | 4713 { |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4714 char buf[X_CAUGHT_ERROR_MESSAGE_SIZE + 56]; |
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4715 |
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4716 sprintf (buf, format, x_caught_error_message); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4717 x_uncatch_errors (dpy); |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4718 error (buf); |
286 | 4719 } |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4720 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4721 |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4722 /* Nonzero if we had any X protocol errors since we did x_catch_errors. */ |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4723 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4724 int |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4725 x_had_errors_p (dpy) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4726 Display *dpy; |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4727 { |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4728 /* Make sure to catch any errors incurred so far. */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4729 XSync (dpy, False); |
6022
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4730 |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4731 return x_caught_error_message[0] != 0; |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4732 } |
713d4d840a11
(x_had_errors_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6010
diff
changeset
|
4733 |
5986 | 4734 /* Stop catching X protocol errors and let them make Emacs die. */ |
4735 | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4736 void |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4737 x_uncatch_errors (dpy) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4738 Display *dpy; |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4739 { |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2353
diff
changeset
|
4740 xfree (x_caught_error_message); |
3558
f7f187debe2d
(x_caught_error_message): Change type to char* from char*[].
Richard M. Stallman <rms@gnu.org>
parents:
3511
diff
changeset
|
4741 x_caught_error_message = 0; |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4742 XSetErrorHandler (x_error_quitter); |
286 | 4743 } |
4744 | |
4745 #if 0 | |
4746 static unsigned int x_wire_count; | |
4747 x_trace_wire () | |
4748 { | |
4749 fprintf (stderr, "Lib call: %d\n", ++x_wire_count); | |
4750 } | |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
4751 #endif /* ! 0 */ |
286 | 4752 |
4753 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
4754 /* 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
|
4755 |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4756 /* 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
|
4757 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
|
4758 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
|
4759 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
|
4760 |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4761 Lisp_Object |
771 | 4762 x_new_font (f, fontname) |
4763 struct frame *f; | |
286 | 4764 register char *fontname; |
4765 { | |
4766 int already_loaded; | |
4767 int n_matching_fonts; | |
4768 XFontStruct *font_info; | |
4769 char **font_names; | |
4770 | |
4771 /* Get a list of all the fonts that match this name. Once we | |
4772 have a list of matching fonts, we compare them against the fonts | |
4773 we already have by comparing font ids. */ | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4774 font_names = (char **) XListFonts (FRAME_X_DISPLAY (f), fontname, |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4775 1024, &n_matching_fonts); |
3639
70a688f0cdae
* xterm.c (x_new_font): If font_names is zero, that's all the
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
4776 /* Apparently it doesn't set n_matching_fonts to zero when it can't |
70a688f0cdae
* xterm.c (x_new_font): If font_names is zero, that's all the
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
4777 find any matches; font_names == 0 is the only clue. */ |
70a688f0cdae
* xterm.c (x_new_font): If font_names is zero, that's all the
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
4778 if (! font_names) |
70a688f0cdae
* xterm.c (x_new_font): If font_names is zero, that's all the
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
4779 n_matching_fonts = 0; |
70a688f0cdae
* xterm.c (x_new_font): If font_names is zero, that's all the
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
4780 |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4781 /* Don't just give up if n_matching_fonts is 0. |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4782 Apparently there's a bug on Suns: XListFontsWithInfo can |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4783 fail to find a font, but XLoadQueryFont may still find it. */ |
286 | 4784 |
429 | 4785 /* See if we've already loaded a matching font. */ |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4786 already_loaded = -1; |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4787 if (n_matching_fonts != 0) |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4788 { |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4789 int i, j; |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4790 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4791 for (i = 0; i < FRAME_X_DISPLAY_INFO (f)->n_fonts; i++) |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4792 for (j = 0; j < n_matching_fonts; j++) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4793 if (!strcmp (FRAME_X_DISPLAY_INFO (f)->font_table[i].name, font_names[j]) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4794 || !strcmp (FRAME_X_DISPLAY_INFO (f)->font_table[i].full_name, font_names[j])) |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4795 { |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4796 already_loaded = i; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4797 fontname = FRAME_X_DISPLAY_INFO (f)->font_table[i].full_name; |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4798 goto found_font; |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4799 } |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4800 } |
286 | 4801 found_font: |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4802 |
286 | 4803 /* If we have, just return it from the table. */ |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4804 if (already_loaded >= 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4805 f->output_data.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[already_loaded].font; |
286 | 4806 /* Otherwise, load the font and add it to the table. */ |
4807 else | |
4808 { | |
3016
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4809 int i; |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4810 char *full_name; |
286 | 4811 XFontStruct *font; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4812 int n_fonts; |
286 | 4813 |
3016
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4814 /* Try to find a character-cell font in the list. */ |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4815 #if 0 |
3066
039cbddadc51
* xfaces.c (merge_faces): You can't tell if a font is a
Jim Blandy <jimb@redhat.com>
parents:
3045
diff
changeset
|
4816 /* A laudable goal, but this isn't how to do it. */ |
3016
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4817 for (i = 0; i < n_matching_fonts; i++) |
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4818 if (! font_info[i].per_char) |
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4819 break; |
3066
039cbddadc51
* xfaces.c (merge_faces): You can't tell if a font is a
Jim Blandy <jimb@redhat.com>
parents:
3045
diff
changeset
|
4820 #else |
039cbddadc51
* xfaces.c (merge_faces): You can't tell if a font is a
Jim Blandy <jimb@redhat.com>
parents:
3045
diff
changeset
|
4821 i = 0; |
039cbddadc51
* xfaces.c (merge_faces): You can't tell if a font is a
Jim Blandy <jimb@redhat.com>
parents:
3045
diff
changeset
|
4822 #endif |
3016
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4823 |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4824 /* See comment above. */ |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4825 if (n_matching_fonts != 0) |
3016
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4826 fontname = font_names[i]; |
ce9ea90b5848
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2982
diff
changeset
|
4827 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4828 font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); |
286 | 4829 if (! font) |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4830 { |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4831 /* Free the information from XListFonts. */ |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4832 if (n_matching_fonts) |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4833 XFreeFontNames (font_names); |
3511
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4834 return Qnil; |
21fae09a3ad2
(x_new_font): Don't give up right away if XListFontsWithInfo
Richard M. Stallman <rms@gnu.org>
parents:
3465
diff
changeset
|
4835 } |
286 | 4836 |
4837 /* Do we need to create the table? */ | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4838 if (FRAME_X_DISPLAY_INFO (f)->font_table_size == 0) |
286 | 4839 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4840 FRAME_X_DISPLAY_INFO (f)->font_table_size = 16; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4841 FRAME_X_DISPLAY_INFO (f)->font_table |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4842 = (struct font_info *) xmalloc (FRAME_X_DISPLAY_INFO (f)->font_table_size |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4843 * sizeof (struct font_info)); |
286 | 4844 } |
4845 /* Do we need to grow the table? */ | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4846 else if (FRAME_X_DISPLAY_INFO (f)->n_fonts |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4847 >= FRAME_X_DISPLAY_INFO (f)->font_table_size) |
286 | 4848 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4849 FRAME_X_DISPLAY_INFO (f)->font_table_size *= 2; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4850 FRAME_X_DISPLAY_INFO (f)->font_table |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4851 = (struct font_info *) xrealloc (FRAME_X_DISPLAY_INFO (f)->font_table, |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4852 (FRAME_X_DISPLAY_INFO (f)->font_table_size |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4853 * sizeof (struct font_info))); |
286 | 4854 } |
4855 | |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4856 /* Try to get the full name of FONT. Put it in full_name. */ |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4857 full_name = 0; |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4858 for (i = 0; i < font->n_properties; i++) |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4859 { |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4860 char *atom |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4861 = XGetAtomName (FRAME_X_DISPLAY (f), font->properties[i].name); |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4862 if (!strcmp (atom, "FONT")) |
8964
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4863 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
4864 char *name = XGetAtomName (FRAME_X_DISPLAY (f), |
8964
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4865 (Atom) (font->properties[i].card32)); |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4866 char *p = name; |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4867 int dashes = 0; |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4868 |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4869 /* Count the number of dashes in the "full name". |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4870 If it is too few, this isn't really the font's full name, |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4871 so don't use it. |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4872 In X11R4, the fonts did not come with their canonical names |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4873 stored in them. */ |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4874 while (*p) |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4875 { |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4876 if (*p == '-') |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4877 dashes++; |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4878 p++; |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4879 } |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4880 |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4881 if (dashes >= 13) |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4882 full_name = name; |
9526
c84536ef5fa9
(x_new_font): Don't keep looping after the FONT property.
Richard M. Stallman <rms@gnu.org>
parents:
9446
diff
changeset
|
4883 |
c84536ef5fa9
(x_new_font): Don't keep looping after the FONT property.
Richard M. Stallman <rms@gnu.org>
parents:
9446
diff
changeset
|
4884 break; |
8964
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4885 } |
5882c2fedd98
(note_mouse_highlight): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8941
diff
changeset
|
4886 |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4887 XFree (atom); |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4888 } |
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4889 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4890 n_fonts = FRAME_X_DISPLAY_INFO (f)->n_fonts; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4891 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name = (char *) xmalloc (strlen (fontname) + 1); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4892 bcopy (fontname, FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name, strlen (fontname) + 1); |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4893 if (full_name != 0) |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4894 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = full_name; |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4895 else |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4896 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4897 f->output_data.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].font = font; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
4898 FRAME_X_DISPLAY_INFO (f)->n_fonts++; |
8291
9c6ddd14996b
(struct font_info): New field full_name.
Richard M. Stallman <rms@gnu.org>
parents:
8279
diff
changeset
|
4899 |
8528
e52f4cbff616
(x_new_font): Don't set filename = full_name if that's null.
Richard M. Stallman <rms@gnu.org>
parents:
8485
diff
changeset
|
4900 if (full_name) |
e52f4cbff616
(x_new_font): Don't set filename = full_name if that's null.
Richard M. Stallman <rms@gnu.org>
parents:
8485
diff
changeset
|
4901 fontname = full_name; |
286 | 4902 } |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4903 |
9167
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
4904 /* 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
|
4905 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
|
4906 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4907 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
|
4908 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
|
4909 } |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
4910 else |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
4911 f->scroll_bar_cols = 2; |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
4912 |
771 | 4913 /* 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
|
4914 if (FRAME_X_WINDOW (f) != 0) |
286 | 4915 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4916 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
|
4917 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
|
4918 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
|
4919 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
|
4920 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
|
4921 f->output_data.x->font->fid); |
771 | 4922 |
6767
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
4923 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
|
4924 x_set_window_size (f, 0, f->width, f->height); |
286 | 4925 } |
6767
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
4926 else |
8fbcee1c2059
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
Richard M. Stallman <rms@gnu.org>
parents:
6757
diff
changeset
|
4927 /* 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
|
4928 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
|
4929 f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font); |
286 | 4930 |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4931 { |
6521
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
4932 Lisp_Object lispy_name; |
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
4933 |
a975c5944916
(x_window_to_scroll_bar, x_new_font): Use assignment, not initialization.
Karl Heuer <kwzh@gnu.org>
parents:
6413
diff
changeset
|
4934 lispy_name = build_string (fontname); |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4935 |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4936 /* Free the information from XListFonts. The data |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4937 we actually retain comes from XLoadQueryFont. */ |
4493
d0143beb12f0
(struct font_info): New structure.
Richard M. Stallman <rms@gnu.org>
parents:
4476
diff
changeset
|
4938 XFreeFontNames (font_names); |
3076
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4939 |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4940 return lispy_name; |
e3b3c67cf203
Arrange for font names to get fully resolved - no wildcards.
Jim Blandy <jimb@redhat.com>
parents:
3066
diff
changeset
|
4941 } |
286 | 4942 } |
4943 | |
7264
a701bffa0f9d
(x_calc_absolute_position): Use size_hint_flags.
Richard M. Stallman <rms@gnu.org>
parents:
7262
diff
changeset
|
4944 x_calc_absolute_position (f) |
771 | 4945 struct frame *f; |
286 | 4946 { |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4947 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
|
4948 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
|
4949 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
|
4950 int this_window; |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4951 |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4952 #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
|
4953 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
|
4954 #else |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4955 this_window = FRAME_X_WINDOW (f); |
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4956 #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
|
4957 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4958 /* Find the position of the outside upper-left corner of |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4959 the inner window, with respect to the outer window. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4960 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
|
4961 { |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4962 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
|
4963 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
4964 |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4965 /* From-window, to-window. */ |
11896
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4966 this_window, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4967 f->output_data.x->parent_desc, |
4630
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4968 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4969 /* From-position, to-position. */ |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4970 0, 0, &win_x, &win_y, |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4971 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4972 /* Child of win. */ |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4973 &child); |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4974 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
|
4975 } |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4976 |
70247ce8b381
(x_wm_set_size_hint): New args spec_x and spec_y.
Richard M. Stallman <rms@gnu.org>
parents:
4493
diff
changeset
|
4977 /* 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
|
4978 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
|
4979 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
|
4980 f->output_data.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4981 - 2 * f->output_data.x->border_width - win_x |
3890
ab295012a818
* xterm.c (XTread_socket): Remove #if 0''s around code which tests
Jim Blandy <jimb@redhat.com>
parents:
3883
diff
changeset
|
4982 - 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
|
4983 + f->output_data.x->left_pos); |
771 | 4984 |
7262
68fc80bf10df
(x_wm_set_size_hint): Don't try to handle negative positions.
Richard M. Stallman <rms@gnu.org>
parents:
7210
diff
changeset
|
4985 if (flags & YNegative) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4986 f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4987 - 2 * f->output_data.x->border_width - win_y |
3890
ab295012a818
* xterm.c (XTread_socket): Remove #if 0''s around code which tests
Jim Blandy <jimb@redhat.com>
parents:
3883
diff
changeset
|
4988 - PIXEL_HEIGHT (f) |
11896
507a45c7e911
(x_calc_absolute_position): Use menubar_height field.
Karl Heuer <kwzh@gnu.org>
parents:
11807
diff
changeset
|
4989 - (FRAME_EXTERNAL_MENU_BAR (f) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4990 ? f->output_data.x->menubar_height : 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
4991 + f->output_data.x->top_pos); |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
4992 /* 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
|
4993 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
|
4994 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
|
4995 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
286 | 4996 } |
4997 | |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
4998 /* 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
|
4999 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
|
5000 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
|
5001 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
|
5002 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
|
5003 |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
5004 x_set_offset (f, xoff, yoff, change_gravity) |
771 | 5005 struct frame *f; |
286 | 5006 register int xoff, yoff; |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
5007 int change_gravity; |
286 | 5008 { |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5009 int modified_top, modified_left; |
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5010 |
11988
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5011 if (change_gravity > 0) |
7409
fe56a02838ba
(x_set_offset): Set gravity and size hint
Richard M. Stallman <rms@gnu.org>
parents:
7346
diff
changeset
|
5012 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5013 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
|
5014 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
|
5015 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
|
5016 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
|
5017 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
|
5018 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
|
5019 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
|
5020 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
|
5021 } |
7264
a701bffa0f9d
(x_calc_absolute_position): Use size_hint_flags.
Richard M. Stallman <rms@gnu.org>
parents:
7262
diff
changeset
|
5022 x_calc_absolute_position (f); |
286 | 5023 |
5024 BLOCK_INPUT; | |
11915
e2ab839155e1
(XTflash): Use pointers as args to select.
Karl Heuer <kwzh@gnu.org>
parents:
11904
diff
changeset
|
5025 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
|
5026 |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5027 /* 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
|
5028 when the frame is already visible, but experiment says we do. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5029 modified_left = f->output_data.x->left_pos; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5030 modified_top = f->output_data.x->top_pos; |
11988
a1ce6f699967
(x_set_offset): Distinguish CHANGE_GRAVITY < 0 case.
Karl Heuer <kwzh@gnu.org>
parents:
11953
diff
changeset
|
5031 if (change_gravity != 0) |
11901
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5032 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5033 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
|
5034 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
|
5035 } |
8ecc60a02138
(x_set_offset): Add border_width when calling XMoveWindow.
Karl Heuer <kwzh@gnu.org>
parents:
11896
diff
changeset
|
5036 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5037 #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
|
5038 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
|
5039 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
|
5040 #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
|
5041 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
|
5042 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
|
5043 #endif /* not USE_X_TOOLKIT */ |
286 | 5044 UNBLOCK_INPUT; |
5045 } | |
5046 | |
5825
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5047 /* 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
|
5048 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
|
5049 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
|
5050 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
|
5051 |
b1f35db748d8
(x_make_frame_invisible): Add USE_X_TOOLKIT conditional.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5753
diff
changeset
|
5052 x_set_window_size (f, change_gravity, cols, rows) |
771 | 5053 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
|
5054 int change_gravity; |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5055 int cols, rows; |
286 | 5056 { |
5057 int pixelwidth, pixelheight; | |
5058 int mask; | |
5059 | |
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
|
5060 #ifdef 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
|
5061 BLOCK_INPUT; |
7415
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5062 { |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5063 /* 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
|
5064 call to XtSetValues within EmacsFrameSetCharSize. |
fbea5637a4b4
(x_set_window_size) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
7409
diff
changeset
|
5065 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
|
5066 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
|
5067 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
|
5068 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
|
5069 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
|
5070 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
|
5071 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
|
5072 } |
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
|
5073 UNBLOCK_INPUT; |
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
|
5074 |
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
|
5075 #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
|
5076 |
286 | 5077 BLOCK_INPUT; |
5078 | |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5079 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
|
5080 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
|
5081 = (!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
|
5082 ? 0 |
8ad448b29c1c
(x_new_font): New rule for computing column width. Factored out common code.
Karl Heuer <kwzh@gnu.org>
parents:
9101
diff
changeset
|
5083 : 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
|
5084 ? 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
|
5085 : (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
|
5086 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
|
5087 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
286 | 5088 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5089 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
|
5090 x_wm_set_size_hint (f, (long) 0, 0); |
8781
98741404d3e0
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8724
diff
changeset
|
5091 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5092 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
|
5093 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
|
5094 pixelwidth, pixelheight); |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5095 |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5096 /* 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
|
5097 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
|
5098 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
|
5099 ConfigureNotify event gets here. |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5100 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5101 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
|
5102 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
|
5103 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
|
5104 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
|
5105 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
|
5106 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
|
5107 PIXEL_WIDTH (f) = pixelwidth; |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5108 PIXEL_HEIGHT (f) = pixelheight; |
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5109 |
7651
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5110 /* 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
|
5111 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
|
5112 || 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
|
5113 { |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5114 f->phys_cursor_x = -1; |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5115 f->phys_cursor_y = -1; |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5116 } |
1569a13efdcd
(x_set_window_size): If cursor outside new size, mark it off.
Richard M. Stallman <rms@gnu.org>
parents:
7602
diff
changeset
|
5117 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5118 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5119 receive in the ConfigureNotify event; if we get what we asked |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5120 for, then the event won't cause the screen to become garbaged, so |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5121 we have to make sure to do it here. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5122 SET_FRAME_GARBAGED (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5123 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5124 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5125 UNBLOCK_INPUT; |
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
|
5126 #endif /* not USE_X_TOOLKIT */ |
286 | 5127 } |
5128 | |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5129 /* Mouse warping. */ |
286 | 5130 |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5131 void |
771 | 5132 x_set_mouse_position (f, x, y) |
5133 struct frame *f; | |
286 | 5134 int x, y; |
5135 { | |
5136 int pix_x, pix_y; | |
5137 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5138 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
|
5139 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
|
5140 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5141 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
|
5142 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
|
5143 |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5144 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
|
5145 if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f); |
286 | 5146 |
5147 BLOCK_INPUT; | |
5148 | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5149 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
|
5150 0, 0, 0, 0, pix_x, pix_y); |
286 | 5151 UNBLOCK_INPUT; |
5152 } | |
5153 | |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5154 /* 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
|
5155 |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5156 void |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5157 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
|
5158 struct frame *f; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5159 int pix_x, pix_y; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5160 { |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5161 BLOCK_INPUT; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5162 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5163 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
|
5164 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
|
5165 UNBLOCK_INPUT; |
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5166 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5167 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5168 /* focus shifting, raising and lowering. */ |
7026
55f9a506180d
(x_set_mouse_pixel_position): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7001
diff
changeset
|
5169 |
771 | 5170 x_focus_on_frame (f) |
5171 struct frame *f; | |
286 | 5172 { |
5156
fd78458b8c43
(XTread_socket): Really handle Xatom_wm_window_moved events.
Richard M. Stallman <rms@gnu.org>
parents:
5018
diff
changeset
|
5173 #if 0 /* This proves to be unpleasant. */ |
771 | 5174 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
|
5175 #endif |
369 | 5176 #if 0 |
5177 /* I don't think that the ICCCM allows programs to do things like this | |
5178 without the interaction of the window manager. Whatever you end up | |
771 | 5179 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
|
5180 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
286 | 5181 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
|
5182 #endif /* ! 0 */ |
286 | 5183 } |
5184 | |
771 | 5185 x_unfocus_frame (f) |
5186 struct frame *f; | |
286 | 5187 { |
369 | 5188 #if 0 |
771 | 5189 /* 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
|
5190 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
|
5191 XSetInputFocus (FRAME_X_DISPLAY (f), PointerRoot, |
286 | 5192 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
|
5193 #endif /* ! 0 */ |
286 | 5194 } |
5195 | |
771 | 5196 /* Raise frame F. */ |
5197 | |
5198 x_raise_frame (f) | |
5199 struct frame *f; | |
286 | 5200 { |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5201 if (f->async_visible) |
286 | 5202 { |
5203 BLOCK_INPUT; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5204 #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
|
5205 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
|
5206 #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
|
5207 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
|
5208 #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
|
5209 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5210 UNBLOCK_INPUT; |
5211 } | |
5212 } | |
5213 | |
771 | 5214 /* Lower frame F. */ |
5215 | |
5216 x_lower_frame (f) | |
5217 struct frame *f; | |
286 | 5218 { |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5219 if (f->async_visible) |
286 | 5220 { |
5221 BLOCK_INPUT; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5222 #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
|
5223 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
|
5224 #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
|
5225 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
|
5226 #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
|
5227 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5228 UNBLOCK_INPUT; |
5229 } | |
5230 } | |
5231 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5232 static void |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5233 XTframe_raise_lower (f, raise) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5234 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5235 int raise; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5236 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5237 if (raise) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5238 x_raise_frame (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5239 else |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5240 x_lower_frame (f); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5241 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5242 |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5243 /* Change of visibility. */ |
286 | 5244 |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5245 /* 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
|
5246 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
|
5247 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
|
5248 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
|
5249 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
|
5250 finishes with it. */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5251 |
771 | 5252 x_make_frame_visible (f) |
5253 struct frame *f; | |
286 | 5254 { |
5255 int mask; | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5256 Lisp_Object type; |
286 | 5257 |
429 | 5258 BLOCK_INPUT; |
5259 | |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5260 type = x_icon_type (f); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5261 if (!NILP (type)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5262 x_bitmap_icon (f, type); |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5263 |
771 | 5264 if (! FRAME_VISIBLE_P (f)) |
286 | 5265 { |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5266 /* We test FRAME_GARBAGED_P here to make sure we don't |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5267 call x_set_offset a second time |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5268 if we get to x_make_frame_visible a second time |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5269 before the window gets really visible. */ |
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5270 if (! 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
|
5271 && ! f->output_data.x->asked_for_visible) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5272 x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5273 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5274 f->output_data.x->asked_for_visible = 1; |
12192
1b571a7992b0
(x_make_frame_visible): Test and set asked_for_visible.
Karl Heuer <kwzh@gnu.org>
parents:
12189
diff
changeset
|
5275 |
429 | 5276 if (! EQ (Vx_no_window_manager, Qt)) |
771 | 5277 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
|
5278 #ifdef USE_X_TOOLKIT |
7167
2fa74c48e4e5
(x_make_frame_visible): Use XtMapWidget, not XtPopup.
Richard M. Stallman <rms@gnu.org>
parents:
7128
diff
changeset
|
5279 /* 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
|
5280 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
|
5281 #else /* not USE_X_TOOLKIT */ |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5282 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
|
5283 #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
|
5284 #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
|
5285 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
|
5286 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
|
5287 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
|
5288 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
|
5289 #endif |
429 | 5290 } |
286 | 5291 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5292 XFlush (FRAME_X_DISPLAY (f)); |
429 | 5293 |
7959
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5294 /* 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
|
5295 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
|
5296 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
|
5297 { |
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5298 Lisp_Object frame; |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5299 int count = input_signal_count; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5300 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5301 /* This must come after we set COUNT. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5302 UNBLOCK_INPUT; |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5303 |
9338
873508897cc2
(x_new_focus_frame, construct_mouse_click, construct_menu_click,
Karl Heuer <kwzh@gnu.org>
parents:
9337
diff
changeset
|
5304 XSETFRAME (frame, f); |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5305 |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5306 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
|
5307 { |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5308 x_sync (f); |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5309 /* Once we have handled input events, |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5310 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
|
5311 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
|
5312 Some window managers make their own decisions |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5313 about visibility. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5314 if (input_signal_count != count) |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5315 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
|
5316 /* 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
|
5317 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
|
5318 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
|
5319 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
|
5320 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
|
5321 if (input_polling_used ()) |
8652 | 5322 { |
5323 /* It could be confusing if a real alarm arrives while processing | |
5324 the fake one. Turn it off and let the handler reset it. */ | |
5325 alarm (0); | |
5326 input_poll_signal (); | |
5327 } | |
9337
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5328 /* Once we have handled input events, |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5329 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
|
5330 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
|
5331 Some window managers make their own decisions |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5332 about visibility. */ |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5333 if (input_signal_count != count) |
7b933936a676
(input_signal_count): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9232
diff
changeset
|
5334 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
|
5335 } |
7959
224440646fa7
(make_frame_visible): At end, wait till Emacs sees frame is visible.
Richard M. Stallman <rms@gnu.org>
parents:
7935
diff
changeset
|
5336 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
|
5337 } |
286 | 5338 } |
5339 | |
5340 /* Change from mapped state to withdrawn state. */ | |
5341 | |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5342 /* Make the frame visible (mapped and not iconified). */ |
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5343 |
771 | 5344 x_make_frame_invisible (f) |
5345 struct frame *f; | |
286 | 5346 { |
5347 int mask; | |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5348 Window window; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5349 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5350 #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
|
5351 /* 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
|
5352 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
|
5353 #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
|
5354 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
|
5355 #endif /* not USE_X_TOOLKIT */ |
286 | 5356 |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
5357 /* 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
|
5358 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
|
5359 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
|
5360 |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5361 #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
|
5362 if (! f->async_visible && ! f->async_iconified) |
286 | 5363 return; |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5364 #endif |
286 | 5365 |
5366 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
|
5367 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5368 /* 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
|
5369 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
|
5370 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
|
5371 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
|
5372 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
|
5373 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
|
5374 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5375 #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
|
5376 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5377 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
|
5378 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
|
5379 { |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5380 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
|
5381 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
|
5382 } |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5383 #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
|
5384 |
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5385 /* Tell the window manager what we're going to do. */ |
286 | 5386 if (! EQ (Vx_no_window_manager, Qt)) |
5387 { | |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5388 XEvent unmap; |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5389 |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5390 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
|
5391 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
|
5392 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
|
5393 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
|
5394 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
|
5395 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
|
5396 False, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5397 SubstructureRedirectMask|SubstructureNotifyMask, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5398 &unmap)) |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5399 { |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5400 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
|
5401 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
|
5402 } |
286 | 5403 } |
5404 | |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5405 /* 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
|
5406 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
|
5407 #endif /* ! defined (HAVE_X11R4) */ |
286 | 5408 |
6983
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5409 /* 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
|
5410 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
|
5411 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
|
5412 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
|
5413 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
|
5414 f->visible = 0; |
b18e5c09d7c3
(XTread_socket, case ClientMessage): Use x_window_to_frame unconditionally.
Richard M. Stallman <rms@gnu.org>
parents:
6941
diff
changeset
|
5415 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
|
5416 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
|
5417 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
|
5418 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5419 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
|
5420 |
286 | 5421 UNBLOCK_INPUT; |
5422 } | |
5423 | |
5424 /* Change window state from mapped to iconified. */ | |
5425 | |
771 | 5426 x_iconify_frame (f) |
5427 struct frame *f; | |
286 | 5428 { |
5429 int mask; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5430 int result; |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5431 Lisp_Object type; |
286 | 5432 |
3284
a47979ffad1e
(XTread_socket): For UnmapNotify, if frame was visible,
Richard M. Stallman <rms@gnu.org>
parents:
3282
diff
changeset
|
5433 /* 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
|
5434 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
|
5435 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
|
5436 |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5437 if (f->async_iconified) |
286 | 5438 return; |
5439 | |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5440 BLOCK_INPUT; |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5441 |
13627
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
5442 FRAME_SAMPLE_VISIBILITY (f); |
8873aa3451dd
(XTmouse_position): Exit the loop if child == win.
Richard M. Stallman <rms@gnu.org>
parents:
13598
diff
changeset
|
5443 |
9565
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5444 type = x_icon_type (f); |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5445 if (!NILP (type)) |
255d98c7cd67
(dumpglyphs): Explicitly draw background stipple.
Richard M. Stallman <rms@gnu.org>
parents:
9542
diff
changeset
|
5446 x_bitmap_icon (f, type); |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5447 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5448 #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
|
5449 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5450 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
|
5451 { |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5452 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
|
5453 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
|
5454 /* 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
|
5455 XtMapWidget (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
|
5456 UNBLOCK_INPUT; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5457 return; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5458 } |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5459 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5460 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
|
5461 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
|
5462 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
|
5463 UNBLOCK_INPUT; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5464 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5465 if (!result) |
7602
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5466 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
|
5467 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5468 f->async_iconified = 1; |
5740
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
5469 |
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
5470 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
|
5471 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
|
5472 UNBLOCK_INPUT; |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5473 #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
|
5474 |
7738
a810335742bb
(x_iconify_frame): Call x_set_offset,
Richard M. Stallman <rms@gnu.org>
parents:
7706
diff
changeset
|
5475 /* 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
|
5476 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
|
5477 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
|
5478 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
|
5479 |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5480 /* 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
|
5481 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
|
5482 |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5483 /* 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
|
5484 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
|
5485 { |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5486 XEvent message; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5487 |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5488 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
|
5489 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
|
5490 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
|
5491 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
|
5492 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
|
5493 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5494 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
|
5495 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
|
5496 False, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5497 SubstructureRedirectMask | SubstructureNotifyMask, |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5498 &message)) |
286 | 5499 { |
5500 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
|
5501 error ("Can't notify window manager of iconification"); |
286 | 5502 } |
1020
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5503 } |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5504 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5505 /* 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
|
5506 IconicState. */ |
7c2565dd644c
* xterm.c (x_wm_hints): Variable deleted. This has to be
Jim Blandy <jimb@redhat.com>
parents:
976
diff
changeset
|
5507 x_wm_set_window_state (f, IconicState); |
286 | 5508 |
4304
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
5509 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
|
5510 { |
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
5511 /* 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
|
5512 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
|
5513 } |
b5014da888a8
(x_iconify_frame): Handle case where frame was invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4277
diff
changeset
|
5514 |
1658
452ba03935d7
* xterm.c (XTread_socket): When we get MapNotify, UnmapNotify,
Jim Blandy <jimb@redhat.com>
parents:
1530
diff
changeset
|
5515 f->async_iconified = 1; |
286 | 5516 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5517 XFlush (FRAME_X_DISPLAY (f)); |
286 | 5518 UNBLOCK_INPUT; |
5740
48da4ed089e9
(x_iconify_frame): Fix misbalanced BLOCK_INPUT/UNBLOCK_INPUT.
Karl Heuer <kwzh@gnu.org>
parents:
5737
diff
changeset
|
5519 #endif /* not USE_X_TOOLKIT */ |
286 | 5520 } |
12172
58ce63f11008
(x_get_keysym_name): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12079
diff
changeset
|
5521 |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
5522 /* 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
|
5523 |
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
5524 x_destroy_window (f) |
771 | 5525 struct frame *f; |
286 | 5526 { |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5527 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
|
5528 |
286 | 5529 BLOCK_INPUT; |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
5530 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5531 if (f->output_data.x->icon_desc != 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5532 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5533 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
|
5534 #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
|
5535 XtDestroyWidget (f->output_data.x->widget); |
5898
105c99071e9b
(x_destroy_window) [USE_X_TOOLKIT]: Call free_frame_menubar.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5872
diff
changeset
|
5536 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
|
5537 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5538 |
2732
8b55aa587d3c
* xdisp.c (display_text_line): Apply faces to characters
Jim Blandy <jimb@redhat.com>
parents:
2661
diff
changeset
|
5539 free_frame_faces (f); |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5540 XFlush (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
|
5541 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5542 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
|
5543 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
|
5544 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
|
5545 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
|
5546 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
|
5547 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
|
5548 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
|
5549 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
|
5550 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5551 dpyinfo->reference_count--; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5552 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5553 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
|
5554 { |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5555 dpyinfo->mouse_face_beg_row |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5556 = dpyinfo->mouse_face_beg_col = -1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5557 dpyinfo->mouse_face_end_row |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5558 = dpyinfo->mouse_face_end_col = -1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5559 dpyinfo->mouse_face_window = Qnil; |
6934
e0ab4f59004e
(dumpglyphs): When HL=2, check explicitly for using
Richard M. Stallman <rms@gnu.org>
parents:
6883
diff
changeset
|
5560 } |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5561 |
1810
bf618128d973
* xterm.c (x_scrollbar_create): Set the scrollbars to use
Jim Blandy <jimb@redhat.com>
parents:
1803
diff
changeset
|
5562 UNBLOCK_INPUT; |
286 | 5563 } |
5564 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5565 /* Setting window manager hints. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5566 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5567 /* 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
|
5568 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
|
5569 that the window now has. |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5570 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
|
5571 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
|
5572 |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5573 x_wm_set_size_hint (f, flags, user_position) |
771 | 5574 struct frame *f; |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5575 long flags; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5576 int user_position; |
286 | 5577 { |
5578 XSizeHints size_hints; | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5579 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5580 #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
|
5581 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
|
5582 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
|
5583 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
|
5584 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
|
5585 #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
|
5586 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
|
5587 #endif /* not USE_X_TOOLKIT */ |
286 | 5588 |
7187
ca0102511d80
(x_wm_set_size_hint): Don't set PMaxSize.
Richard M. Stallman <rms@gnu.org>
parents:
7169
diff
changeset
|
5589 /* 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
|
5590 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; |
286 | 5591 |
771 | 5592 flexlines = f->height; |
5593 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5594 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
|
5595 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
|
5596 |
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
|
5597 #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
|
5598 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
|
5599 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
|
5600 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
|
5601 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
|
5602 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
|
5603 #else /* not USE_X_TOOLKIT */ |
771 | 5604 size_hints.height = PIXEL_HEIGHT (f); |
5605 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
|
5606 #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
|
5607 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5608 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
|
5609 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
|
5610 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
|
5611 = 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
|
5612 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
|
5613 = 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
|
5614 |
12189 | 5615 /* Calculate the base and minimum sizes. |
5616 | |
5617 (When we use the X toolkit, we don't do it here. | |
5618 Instead we copy the values that the widgets are using, below.) */ | |
5619 #ifndef USE_X_TOOLKIT | |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5620 { |
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
|
5621 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
|
5622 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
|
5623 |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5624 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
|
5625 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
|
5626 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5627 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
|
5628 |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5629 /* 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
|
5630 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
|
5631 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
|
5632 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
|
5633 zero-row, zero-column frame. |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5634 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5635 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
|
5636 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
|
5637 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
|
5638 |
cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
Jim Blandy <jimb@redhat.com>
parents:
1077
diff
changeset
|
5639 #ifdef HAVE_X11R4 |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5640 size_hints.flags |= PBaseSize; |
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5641 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
|
5642 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
|
5643 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
|
5644 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
|
5645 #else |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5646 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
|
5647 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
|
5648 #endif |
976
cbdfc337ec8f
* xterm.c (x_wm_hints): New variable.
Jim Blandy <jimb@redhat.com>
parents:
786
diff
changeset
|
5649 } |
286 | 5650 |
12189 | 5651 /* 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
|
5652 if (flags) |
286 | 5653 { |
12189 | 5654 size_hints.flags |= flags; |
5655 goto no_read; | |
5656 } | |
5657 #endif /* not USE_X_TOOLKIT */ | |
5658 | |
5659 { | |
5660 XSizeHints hints; /* Sometimes I hate X Windows... */ | |
5661 long supplied_return; | |
5662 int value; | |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5663 |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5664 #ifdef HAVE_X11R4 |
12189 | 5665 value = XGetWMNormalHints (FRAME_X_DISPLAY (f), window, &hints, |
5666 &supplied_return); | |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5667 #else |
12189 | 5668 value = XGetNormalHints (FRAME_X_DISPLAY (f), window, &hints); |
5669 #endif | |
5670 | |
5671 #ifdef USE_X_TOOLKIT | |
5672 size_hints.base_height = hints.base_height; | |
5673 size_hints.base_width = hints.base_width; | |
5674 size_hints.min_height = hints.min_height; | |
5675 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
|
5676 #endif |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
5677 |
12189 | 5678 if (flags) |
5679 size_hints.flags |= flags; | |
5680 else | |
5681 { | |
5682 if (value == 0) | |
5683 hints.flags = 0; | |
5684 if (hints.flags & PSize) | |
5685 size_hints.flags |= PSize; | |
5686 if (hints.flags & PPosition) | |
5687 size_hints.flags |= PPosition; | |
5688 if (hints.flags & USPosition) | |
5689 size_hints.flags |= USPosition; | |
5690 if (hints.flags & USSize) | |
5691 size_hints.flags |= USSize; | |
5692 } | |
5693 } | |
5694 | |
5695 no_read: | |
6883
77ceede38423
(x_make_frame_visible): Don't call XMapSubwindows.
Richard M. Stallman <rms@gnu.org>
parents:
6791
diff
changeset
|
5696 |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5697 #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
|
5698 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
|
5699 size_hints.flags |= PWinGravity; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5700 |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5701 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
|
5702 { |
7210
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5703 size_hints.flags &= ~ PPosition; |
682ff6213c36
(x_wm_set_size_hint): Always set PWinGravity.
Richard M. Stallman <rms@gnu.org>
parents:
7187
diff
changeset
|
5704 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
|
5705 } |
4777
21ed9c9bb210
(w_wn_set_size_hint): Make recent window gravity addition
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
5706 #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
|
5707 |
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
|
5708 #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
|
5709 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
|
5710 #else |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5711 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
|
5712 #endif |
286 | 5713 } |
5714 | |
5715 /* Used for IconicState or NormalState */ | |
771 | 5716 x_wm_set_window_state (f, state) |
5717 struct frame *f; | |
286 | 5718 int state; |
5719 { | |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5720 #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
|
5721 Arg al[1]; |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5722 |
136819b017fc
(x_wm_set_window_state) [USE_X_TOOLKIT]: Use XtSetValues.
Richard M. Stallman <rms@gnu.org>
parents:
7508
diff
changeset
|
5723 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
|
5724 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
|
5725 #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
|
5726 Window window = FRAME_X_WINDOW (f); |
286 | 5727 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5728 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
|
5729 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
|
5730 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5731 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
|
5732 #endif /* not USE_X_TOOLKIT */ |
286 | 5733 } |
5734 | |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5735 x_wm_set_icon_pixmap (f, pixmap_id) |
771 | 5736 struct frame *f; |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5737 int pixmap_id; |
286 | 5738 { |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
5739 #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
|
5740 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
|
5741 #else |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5742 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
|
5743 #endif |
286 | 5744 |
9542
f8b7a65a94bc
(x_bitmap_icon): Allow bitmap to come from file.
Richard M. Stallman <rms@gnu.org>
parents:
9537
diff
changeset
|
5745 if (pixmap_id > 0) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5746 { |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5747 Pixmap 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
|
5748 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
|
5749 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
5750 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
|
5751 { |
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
|
5752 /* 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
|
5753 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
|
5754 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
|
5755 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
|
5756 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
|
5757 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
|
5758 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
|
5759 #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
|
5760 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
|
5761 #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
|
5762 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
|
5763 #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
|
5764 } |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5765 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5766 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
|
5767 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
286 | 5768 } |
5769 | |
771 | 5770 x_wm_set_icon_position (f, icon_x, icon_y) |
5771 struct frame *f; | |
286 | 5772 int icon_x, icon_y; |
5773 { | |
7806
ef7a60d59543
(x_wm_set_icon_position, x_wm_set_icon_pixmap):
Richard M. Stallman <rms@gnu.org>
parents:
7801
diff
changeset
|
5774 #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
|
5775 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
|
5776 #else |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
5777 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
|
5778 #endif |
286 | 5779 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5780 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
|
5781 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
|
5782 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
|
5783 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12657
diff
changeset
|
5784 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
286 | 5785 } |
5786 | |
5787 | |
1720
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5788 /* Initialization. */ |
4f5e3ac5d822
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1658
diff
changeset
|
5789 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5790 #ifdef USE_X_TOOLKIT |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5791 static XrmOptionDescRec emacs_options[] = { |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5792 {"-geometry", ".geometry", XrmoptionSepArg, NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5793 {"-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
|
5794 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5795 {"-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
|
5796 XrmoptionSepArg, NULL}, |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5797 {"-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
|
5798 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5799 {"-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
|
5800 {"-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
|
5801 {"-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
|
5802 {"-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
|
5803 {"-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
|
5804 {"-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
|
5805 {"-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
|
5806 }; |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5807 #endif /* USE_X_TOOLKIT */ |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5808 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5809 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
|
5810 |
11015 | 5811 #ifdef MULTI_KBOARD |
5812 /* Test whether two display-name strings agree up to the dot that separates | |
5813 the screen number from the server number. */ | |
5814 static int | |
5815 same_x_server (name1, name2) | |
5816 char *name1, *name2; | |
5817 { | |
5818 int seen_colon = 0; | |
5819 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) | |
5820 { | |
5821 if (*name1 == ':') | |
5822 seen_colon++; | |
5823 if (seen_colon && *name1 == '.') | |
5824 return 1; | |
5825 } | |
5826 return (seen_colon | |
5827 && (*name1 == '.' || *name1 == '\0') | |
5828 && (*name2 == '.' || *name2 == '\0')); | |
5829 } | |
5830 #endif | |
5831 | |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5832 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
|
5833 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
|
5834 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
|
5835 char *xrm_option; |
10e818a0248a
(x_term_init): New args xrm_option and resource_string.
Richard M. Stallman <rms@gnu.org>
parents:
7738
diff
changeset
|
5836 char *resource_name; |
286 | 5837 { |
771 | 5838 Lisp_Object frame; |
286 | 5839 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
|
5840 int connection; |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5841 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
|
5842 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
|
5843 XrmDatabase xrdb; |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5844 |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5845 BLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5846 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5847 if (!x_initialized) |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5848 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5849 x_initialize (); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5850 x_initialized = 1; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5851 } |
286 | 5852 |
13232
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
5853 #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
|
5854 setlocale (LC_ALL, NULL); |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
5855 #endif |
e31057e55df7
(x_term_init, XTread_socket): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13205
diff
changeset
|
5856 |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5857 #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
|
5858 /* 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
|
5859 errors with X11R5: |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
5860 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
|
5861 on protocol request 18skiloaf. |
9829d3c035f2
(x_term_init): Call XtSetLanguageProc only if HAVE_X11XTR6.
Richard M. Stallman <rms@gnu.org>
parents:
11375
diff
changeset
|
5862 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
|
5863 #ifdef HAVE_X11XTR6 |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5864 XtSetLanguageProc (NULL, NULL, NULL); |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5865 #endif |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5866 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5867 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5868 int argc = 0; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5869 char *argv[3]; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5870 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5871 argv[0] = ""; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5872 argc = 1; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5873 if (xrm_option) |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5874 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5875 argv[argc++] = "-xrm"; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5876 argv[argc++] = xrm_option; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5877 } |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5878 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
|
5879 resource_name, EMACS_CLASS, |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5880 emacs_options, XtNumber (emacs_options), |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5881 &argc, argv); |
12530
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
5882 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
5883 #ifdef HAVE_X11XTR6 |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
5884 setlocale (LC_NUMERIC, "C"); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
5885 setlocale (LC_TIME, "C"); |
c2b2449231c2
[HAVE_X11XTR6]: Include locale.h
Karl Heuer <kwzh@gnu.org>
parents:
12494
diff
changeset
|
5886 #endif |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
5887 } |
5672
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5888 |
cbc4229c1f90
(x_wm_set_size_hint): Swap southeast and northwest.
Richard M. Stallman <rms@gnu.org>
parents:
5362
diff
changeset
|
5889 #else /* not USE_X_TOOLKIT */ |
9446
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5890 #ifdef HAVE_X11R5 |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5891 XSetLocaleModifiers (""); |
be58ba7c209d
(x_term_init): Call XtSetLanguageProc or XSetLocaleModifiers.
Richard M. Stallman <rms@gnu.org>
parents:
9340
diff
changeset
|
5892 #endif |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5893 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
|
5894 #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
|
5895 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5896 /* Detect failure. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5897 if (dpy == 0) |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5898 { |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5899 UNBLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5900 return 0; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
5901 } |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5902 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5903 /* 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
|
5904 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5905 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
|
5906 |
11015 | 5907 #ifdef MULTI_KBOARD |
5908 { | |
5909 struct x_display_info *share; | |
5910 Lisp_Object tail; | |
5911 | |
5912 for (share = x_display_list, tail = x_display_name_list; share; | |
5913 share = share->next, tail = XCONS (tail)->cdr) | |
5914 if (same_x_server (XSTRING (XCONS (XCONS (tail)->car)->car)->data, | |
5915 XSTRING (display_name)->data)) | |
5916 break; | |
5917 if (share) | |
5918 dpyinfo->kboard = share->kboard; | |
5919 else | |
5920 { | |
5921 dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | |
5922 init_kboard (dpyinfo->kboard); | |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5923 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5924 { |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5925 char *vendor = ServerVendor (dpy); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5926 dpyinfo->kboard->Vsystem_key_alist |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5927 = call1 (Qvendor_specific_keysyms, |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5928 build_string (vendor ? vendor : "")); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5929 } |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
5930 |
11015 | 5931 dpyinfo->kboard->next_kboard = all_kboards; |
5932 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
|
5933 /* 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
|
5934 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
|
5935 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
|
5936 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
|
5937 current_kboard = dpyinfo->kboard; |
11015 | 5938 } |
5939 dpyinfo->kboard->reference_count++; | |
5940 } | |
10652
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
5941 #endif |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
5942 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5943 /* 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
|
5944 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
|
5945 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
|
5946 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5947 /* 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
|
5948 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
|
5949 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
|
5950 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
|
5951 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5952 dpyinfo->display = dpy; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5953 |
286 | 5954 #if 0 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5955 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
|
5956 #endif /* ! 0 */ |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5957 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5958 dpyinfo->x_id_name |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5959 = (char *) xmalloc (XSTRING (Vinvocation_name)->size |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5960 + XSTRING (Vsystem_name)->size |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5961 + 2); |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5962 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
|
5963 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
|
5964 |
74ae34a80f94
* xterm.c (x_meta_mod_mask): New variable, indicating which X
Jim Blandy <jimb@redhat.com>
parents:
1127
diff
changeset
|
5965 /* 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
|
5966 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
|
5967 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
5968 /* 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
|
5969 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
|
5970 = 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
|
5971 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5972 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
|
5973 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
|
5974 #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
|
5975 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
|
5976 #else |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5977 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
|
5978 #endif |
11162
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
5979 /* 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
|
5980 all versions. */ |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5981 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
|
5982 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
5983 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
|
5984 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
|
5985 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
|
5986 &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
|
5987 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
|
5988 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
|
5989 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
|
5990 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
|
5991 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
|
5992 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
|
5993 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
|
5994 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
|
5995 dpyinfo->bitmaps = 0; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
5996 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
|
5997 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
|
5998 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
|
5999 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
|
6000 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
|
6001 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
|
6002 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
|
6003 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
|
6004 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
|
6005 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
|
6006 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
|
6007 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
|
6008 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
|
6009 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
|
6010 |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6011 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
|
6012 = 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
|
6013 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
|
6014 = 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
|
6015 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
|
6016 = 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
|
6017 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
|
6018 = 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
|
6019 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
|
6020 = 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
|
6021 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
|
6022 = 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
|
6023 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
|
6024 = 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
|
6025 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
|
6026 = 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
|
6027 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
|
6028 = 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
|
6029 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
|
6030 = 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
|
6031 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
|
6032 = XInternAtom (dpyinfo->display, "TEXT", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6033 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
|
6034 = 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
|
6035 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
|
6036 = 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
|
6037 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
|
6038 = 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
|
6039 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
|
6040 = 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
|
6041 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
|
6042 = 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
|
6043 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
|
6044 = 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
|
6045 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
|
6046 = XInternAtom (dpyinfo->display, "ATOM_PAIR", False); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6047 |
11162
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
6048 dpyinfo->cut_buffers_initialized = 0; |
95b70c82ec51
(x_term_init): Initialize cut_buffers_initialized.
Karl Heuer <kwzh@gnu.org>
parents:
11122
diff
changeset
|
6049 |
9654
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6050 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
|
6051 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
|
6052 |
9572 | 6053 #ifdef subprocesses |
6054 /* 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
|
6055 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
|
6056 add_keyboard_wait_descriptor (connection); |
9572 | 6057 #endif |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6058 |
4147
c6657758fb6f
* xterm.c (x_term_init): Adjust message printed when we can't
Jim Blandy <jimb@redhat.com>
parents:
3951
diff
changeset
|
6059 #ifndef F_SETOWN_BUG |
286 | 6060 #ifdef F_SETOWN |
6061 #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
|
6062 /* 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
|
6063 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
|
6064 #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
|
6065 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
|
6066 #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
|
6067 #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
|
6068 #endif /* F_SETOWN_BUG */ |
286 | 6069 |
6070 #ifdef SIGIO | |
11994
b4dd8ca308dd
(x_term_init): Call init_sigio only if interrupt_input.
Karl Heuer <kwzh@gnu.org>
parents:
11988
diff
changeset
|
6071 if (interrupt_input) |
b4dd8ca308dd
(x_term_init): Call init_sigio only if interrupt_input.
Karl Heuer <kwzh@gnu.org>
parents:
11988
diff
changeset
|
6072 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
|
6073 #endif /* ! defined (SIGIO) */ |
286 | 6074 |
11997
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
6075 UNBLOCK_INPUT; |
50c7c05fc301
(x_term_init): Block input during this function.
Karl Heuer <kwzh@gnu.org>
parents:
11994
diff
changeset
|
6076 |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6077 return dpyinfo; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6078 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6079 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6080 /* 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
|
6081 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
|
6082 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6083 void |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6084 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
|
6085 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
|
6086 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6087 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
|
6088 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6089 /* 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
|
6090 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
|
6091 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
|
6092 && 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
|
6093 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
|
6094 else |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6095 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6096 Lisp_Object tail; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6097 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6098 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
|
6099 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
|
6100 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6101 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
|
6102 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
|
6103 { |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6104 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
|
6105 break; |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6106 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6107 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
|
6108 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6109 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6110 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6111 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
|
6112 x_display_list = dpyinfo->next; |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6113 else |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6114 { |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6115 struct x_display_info *tail; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6116 |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6117 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
|
6118 if (tail->next == dpyinfo) |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6119 tail->next = tail->next->next; |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6120 } |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6121 |
12771
6f07c79d9a05
(x_delete_display) [AIX]: Don't call XRmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
12750
diff
changeset
|
6122 #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
|
6123 #ifndef AIX /* On AIX, XCloseDisplay calls this. */ |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6124 XrmDestroyDatabase (dpyinfo->xrdb); |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6125 #endif |
12771
6f07c79d9a05
(x_delete_display) [AIX]: Don't call XRmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
12750
diff
changeset
|
6126 #endif |
11015 | 6127 #ifdef MULTI_KBOARD |
6128 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
|
6129 delete_kboard (dpyinfo->kboard); |
10652
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
6130 #endif |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
6131 xfree (dpyinfo->font_table); |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
6132 xfree (dpyinfo->x_id_name); |
f6a41cb94a75
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
Karl Heuer <kwzh@gnu.org>
parents:
10634
diff
changeset
|
6133 xfree (dpyinfo); |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6134 } |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6135 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6136 /* 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
|
6137 |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6138 x_initialize () |
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6139 { |
771 | 6140 clear_frame_hook = XTclear_frame; |
286 | 6141 clear_end_of_line_hook = XTclear_end_of_line; |
6142 ins_del_lines_hook = XTins_del_lines; | |
6143 change_line_highlight_hook = XTchange_line_highlight; | |
6144 insert_glyphs_hook = XTinsert_glyphs; | |
6145 write_glyphs_hook = XTwrite_glyphs; | |
6146 delete_glyphs_hook = XTdelete_glyphs; | |
6147 ring_bell_hook = XTring_bell; | |
6148 reset_terminal_modes_hook = XTreset_terminal_modes; | |
6149 set_terminal_modes_hook = XTset_terminal_modes; | |
6150 update_begin_hook = XTupdate_begin; | |
6151 update_end_hook = XTupdate_end; | |
6152 set_terminal_window_hook = XTset_terminal_window; | |
6153 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
|
6154 frame_up_to_date_hook = XTframe_up_to_date; |
286 | 6155 cursor_to_hook = XTcursor_to; |
6156 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
|
6157 mouse_position_hook = XTmouse_position; |
771 | 6158 frame_rehighlight_hook = XTframe_rehighlight; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1810
diff
changeset
|
6159 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
|
6160 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
|
6161 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
|
6162 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
|
6163 judge_scroll_bars_hook = XTjudge_scroll_bars; |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6164 |
771 | 6165 scroll_region_ok = 1; /* we'll scroll partial frames */ |
286 | 6166 char_ins_del_ok = 0; /* just as fast to write the line */ |
6167 line_ins_del_ok = 1; /* we'll just blt 'em */ | |
6168 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
|
6169 memory_below_frame = 0; /* we don't remember what scrolls |
286 | 6170 off the bottom */ |
6171 baud_rate = 19200; | |
6172 | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6173 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
|
6174 |
4476
e7de1b007447
(x_term_init): Set the hooks before we call Fset_input_mode.
Richard M. Stallman <rms@gnu.org>
parents:
4304
diff
changeset
|
6175 /* 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
|
6176 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
|
6177 |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6178 #ifdef USE_X_TOOLKIT |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6179 XtToolkitInitialize (); |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6180 Xt_app_con = XtCreateApplicationContext (); |
12494
bfbe2490dbf0
(x_initialize) [USE_X_TOOLKIT]: Set fallback resources.
Richard M. Stallman <rms@gnu.org>
parents:
12431
diff
changeset
|
6181 XtAppSetFallbackResources (Xt_app_con, Xt_default_resources); |
9741
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6182 #endif |
bd9d06e542c6
(x_delete_display): Call XrmDestroyDatabase.
Richard M. Stallman <rms@gnu.org>
parents:
9704
diff
changeset
|
6183 |
9537
f025140f7ff7
(stuffline, scraplines): Functions deleted.
Karl Heuer <kwzh@gnu.org>
parents:
9526
diff
changeset
|
6184 /* 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
|
6185 original 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
|
6186 XSetErrorHandler (x_error_quitter); |
41681efe1086
Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY.
Richard M. Stallman <rms@gnu.org>
parents:
9577
diff
changeset
|
6187 XSetIOErrorHandler (x_io_error_quitter); |
286 | 6188 |
6189 /* Disable Window Change signals; they are handled by X events. */ | |
6190 #ifdef SIGWINCH | |
6191 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
|
6192 #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
|
6193 |
10743
6977bff3ff38
(x_display_bar_cursor): Use frame's cursor_width.
Richard M. Stallman <rms@gnu.org>
parents:
10652
diff
changeset
|
6194 signal (SIGPIPE, x_connection_signal); |
286 | 6195 } |
395 | 6196 |
6197 void | |
6198 syms_of_xterm () | |
6199 { | |
9704
39b34bbe59c9
(x_catch_errors, x_check_errors, x_had_errors_p)
Richard M. Stallman <rms@gnu.org>
parents:
9654
diff
changeset
|
6200 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
|
6201 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
|
6202 |
1993
645d96bd3daf
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1935
diff
changeset
|
6203 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
|
6204 last_mouse_scroll_bar = Qnil; |
11807
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
6205 |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
6206 staticpro (&Qvendor_specific_keysyms); |
73fb6570f718
(Qvendor_specific_keysyms): New var.
Karl Heuer <kwzh@gnu.org>
parents:
11610
diff
changeset
|
6207 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); |
395 | 6208 } |
1052
b8defcaf1b61
* xterm.c (x_make_frame_invisible): Don't forget to check the
Jim Blandy <jimb@redhat.com>
parents:
1020
diff
changeset
|
6209 #endif /* ! defined (HAVE_X_WINDOWS) */ |