annotate src/ExternalClient.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 538048ae2ab8
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* External client widget.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This library is free software; you can redistribute it and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 modify it under the terms of the GNU Library General Public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 License as published by the Free Software Foundation; either
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 version 2 of the License, or (at your option) any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 This library is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 Library General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 You should have received a copy of the GNU Library General Public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 License along with this library; if not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Written by Ben Wing, September 1993. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #ifndef EXTERNAL_WIDGET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ERROR! This ought not be getting compiled if EXTERNAL_WIDGET is undefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #endif /* emacs */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include <stdio.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include <string.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include <stdlib.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 # include <Xm/XmP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 # include <Xm/PrimitiveP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 # include <X11/keysym.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 # include "xintrinsicp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 # include <X11/StringDefs.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #include "ExternalClientP.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #include "extw-Xt.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #ifdef TOOLTALK
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 0
diff changeset
49 #include TT_C_H_PATH
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 /* This is the client widget, used to communicate with an ExternalShell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 widget. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 #define NOTIFY(w, type, l0, l1, l2) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 extw_send_notify_3(XtDisplay((Widget)(w)), XtWindow((Widget)(w)),\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 type, l0, l1, l2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 static void externalClientInitialize (Widget req, Widget new, ArgList args,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Cardinal *num_args);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 static void externalClientRealize (Widget widget, XtValueMask *mask,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 XSetWindowAttributes *attrs);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 static void Destroy (Widget w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 static void EventHandler (Widget wid, XtPointer closure, XEvent *event,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 Boolean *continue_to_dispatch);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 static void MaskableEventHandler (Widget wid, XtPointer closure, XEvent *event,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 Boolean *continue_to_dispatch);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 XtWidgetGeometry *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 static void ExternalClientFocusIn (Widget, XEvent *, String *, Cardinal *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 static void ExternalClientFocusOut (Widget, XEvent *, String *, Cardinal *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 static void ExternalClientEnter (Widget, XEvent *, String *, Cardinal *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 static void ExternalClientLeave (Widget, XEvent *, String *, Cardinal *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 static int my_error_handler(Display *display, XErrorEvent *xev);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 static int (*error_old_handler)(Display *, XErrorEvent *);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 static XtResource resources[] = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #define offset(field) XtOffset(ExternalClientWidget, externalClient.field)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 { XtNshellTimeout, XtCShellTimeout, XtRInt, sizeof(int),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 offset(shell_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 { XtNdeadShell, XtCDeadShell, XtRBoolean, sizeof(Boolean),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 offset(dead_shell), XtRImmediate, (XtPointer)False},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 { XmNnavigationType, XmCNavigationType, XmRNavigationType,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 sizeof(XmNavigationType), XtOffset(ExternalClientWidget,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 primitive.navigation_type), XtRImmediate,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (XtPointer)XmTAB_GROUP},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 { XtNemacsProcID, XtCEmacsProcID, XtRString, sizeof(String),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 offset(emacs_procid), XtRImmediate, (XtPointer)NULL},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 { XtNshellReadyCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 offset(shell_ready_callback), XtRImmediate, (XtPointer)NULL},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 { XtNshellName, XtCShellName, XtRString, sizeof(String),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 offset(shell_name), XtRImmediate, (XtPointer)NULL},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 { XtNuseToolTalk, XtCUseToolTalk, XtRBoolean, sizeof(Boolean),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 offset(use_tooltalk), XtRImmediate, (XtPointer)False}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 static XtActionsRec actions[] = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 {"focusIn", ExternalClientFocusIn},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 {"focusOut", ExternalClientFocusOut},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 {"enter", ExternalClientEnter},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 {"leave", ExternalClientLeave},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ExternalClientClassRec externalClientClassRec = {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 { /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 * core_class fields
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 /* superclass */ (WidgetClass) &xmPrimitiveClassRec,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 /* superclass */ (WidgetClass) &coreClassRec,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 /* class_name */ "ExternalClient",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 /* size */ sizeof(ExternalClientRec),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 /* Class Initializer */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 /* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 /* Class init'ed ? */ FALSE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 /* initialize */ externalClientInitialize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 /* initialize_notify */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 /* realize */ externalClientRealize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /* actions */ actions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 /* num_actions */ XtNumber (actions),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 /* resources */ resources,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 /* resource_count */ XtNumber (resources),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 /* xrm_class */ NULLQUARK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 /* compress_motion */ FALSE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 /* compress_exposure */ TRUE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 /* compress_enterleave*/ FALSE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 /* visible_interest */ TRUE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 /* destroy */ Destroy, /* XtInheritDestroy, */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 /* resize */ XtInheritResize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 /* expose */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 /* set_values */ NULL, /* XtInheritSetValues, */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 /* set_values_hook */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 /* set_values_almost */ XtInheritSetValuesAlmost,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 /* get_values_hook */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 /* accept_focus */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 /* intrinsics version */ XtVersion,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 /* callback offsets */ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 /* tm_table */ "", /* MUST NOT BE NULL or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 XtInheritTranslations in Motif!!!!!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 Otherwise keyboard focus translations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 will not work. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 /* query_geometry */ QueryGeometry,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 /* display_accelerator*/ NULL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 /* extension */ NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 XmInheritBorderHighlight,/* Primitive border_highlight */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 XmInheritBorderHighlight,/* Primitive border_unhighlight */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 XtInheritTranslations, /* translations */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 NULL, /* arm_and_activate */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 NULL, /* get resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 0, /* num get_resources */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 NULL, /* extension */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 },
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 WidgetClass externalClientWidgetClass = (WidgetClass) &externalClientClassRec;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 externalClientInitialize (Widget req, Widget new, ArgList args,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 Cardinal *num_args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ExternalClientWidget ecw = (ExternalClientWidget) new;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 static int error_handler_added = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 extw_initialize_atoms (XtDisplay (new));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 extw_which_side = extw_client_send;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 /* yes I know this is horrible. However, the XmPrimitive class adds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 the Tab translation in its initialization routine, so we have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 override it here. This is all the fault of Xt, which doesn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 provide a proper inheritance mechanism for translations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 -- BPW
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 XtOverrideTranslations (new,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 XtParseTranslationTable ("None<Key>Tab:\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 "<FocusIn>:focusIn()\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 "<FocusOut>:focusOut()\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 "<Enter>:enter()\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "<Leave>:leave()\n"));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 XtAddEventHandler (new, 0, TRUE, EventHandler, (XtPointer) NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ecw->externalClient.shell_ready = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ecw->externalClient.has_focus = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 if (!error_handler_added)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 error_handler_added = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 error_old_handler = XSetErrorHandler (my_error_handler);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #ifdef TOOLTALK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 static Tt_callback_action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 tt_callback(Tt_message m, Tt_pattern p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ExternalClientWidget ecw = (ExternalClientWidget)tt_message_user (m, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 switch (tt_message_state(m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 case TT_FAILED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 /* handle errors here */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 case TT_HANDLED:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ecw->externalClient.shell_name = tt_message_arg_val (m, 2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 XtCallCallbackList ((Widget) ecw,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ecw->externalClient.shell_ready_callback, NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 tt_message_destroy (m);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 return TT_CALLBACK_PROCESSED;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 send_tooltalk_handshake (ExternalClientWidget ecw, Window win, char *name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 Tt_message m = tt_message_create ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 tt_message_op_set (m, "emacs-make-client-screen");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 tt_message_scope_set (m, TT_SESSION);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 tt_message_class_set (m, TT_REQUEST);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 tt_message_arg_add (m, TT_IN, "string", name);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 tt_message_iarg_add (m, TT_IN, "int", win);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 tt_message_arg_add (m, TT_OUT, "string", NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 tt_message_user_set (m, 0, (void *)ecw);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 tt_message_callback_add (m, tt_callback);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 if (ecw->externalClient.emacs_procid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 tt_message_address_set (m, TT_HANDLER);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 tt_message_handler_set (m, ecw->externalClient.emacs_procid);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 tt_message_address_set (m, TT_PROCEDURE);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 tt_message_send (m);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 externalClientRealize (Widget w, XtValueMask *vm, XSetWindowAttributes *attrs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ExternalClientWidget ecw = (ExternalClientWidget)w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (*xmPrimitiveWidgetClass->core_class.realize) (w, vm, attrs);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (*coreWidgetClass->core_class.realize) (w, vm, attrs);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 #ifdef TOOLTALK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 /* Make sure that the server actually knows about this window id before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 * telling Emacs about it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 if (ecw->externalClient.use_tooltalk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 XSync (XtDisplay (w), False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 send_tooltalk_handshake (ecw, XtWindow (w), XtName (w));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 /***********************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 /* window-to-widget list. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 struct ww_list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 Window win;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 Widget wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 struct ww_list *next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 struct ww_list ww_list[1];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 add_ww (Window win, Widget wid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 struct ww_list *ww = (struct ww_list *) malloc (sizeof (struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 ww_list));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 if (!ww)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ww->win = win;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 ww->wid = wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 ww->next = ww_list->next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ww_list->next = ww;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 remove_ww (Window win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 struct ww_list *w1, *w2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 Widget wid = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 for (w1=ww_list, w2=w1->next; w2; w1=w2, w2=w2->next)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 if (w2->win == win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 w1->next = w2->next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 wid = w2->wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 free (w2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 return wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 /***********************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 /* stolen outright from Intrinsic.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 static void ComputeWindowAttributes(widget,value_mask,values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 Widget widget;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 XtValueMask *value_mask;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 XSetWindowAttributes *values;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 *value_mask = CWEventMask | CWColormap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (*values).event_mask = XtBuildEventMask(widget);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (*values).colormap = widget->core.colormap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 if (widget->core.background_pixmap != XtUnspecifiedPixmap) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 *value_mask |= CWBackPixmap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (*values).background_pixmap = widget->core.background_pixmap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 } else {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 *value_mask |= CWBackPixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (*values).background_pixel = widget->core.background_pixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 if (widget->core.border_pixmap != XtUnspecifiedPixmap) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 *value_mask |= CWBorderPixmap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (*values).border_pixmap = widget->core.border_pixmap;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 } else {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 *value_mask |= CWBorderPixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (*values).border_pixel = widget->core.border_pixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 if (widget->core.widget_class->core_class.expose == (XtExposeProc) NULL) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 /* Try to avoid redisplay upon resize by making bit_gravity the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 as the default win_gravity */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 *value_mask |= CWBitGravity;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (*values).bit_gravity = NorthWestGravity;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 } /* ComputeWindowAttributes */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 end_connection (ExternalClientWidget w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 XSetWindowAttributes xswa;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 XtValueMask mask;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 Widget wid = (Widget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 w->externalClient.shell_ready = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 XtRemoveEventHandler (wid, w->externalClient.event_mask,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 FALSE, MaskableEventHandler, (XtPointer) NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ComputeWindowAttributes (wid, &mask, &xswa);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 XChangeWindowAttributes (XtDisplay (wid), XtWindow (wid), mask, &xswa);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 XClearArea (XtDisplay (wid), XtWindow (wid), 0, 0, 0, 0, True);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 my_error_handler (Display *display, XErrorEvent *xev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 Widget wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 if (xev->error_code != BadWindow)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 goto call_old;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 wid = remove_ww (xev->resourceid);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 if (wid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 end_connection ((ExternalClientWidget) wid);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 call_old:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 return error_old_handler (display, xev);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 MaskableEventHandler (Widget wid, XtPointer closure, XEvent *event,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 Boolean *continue_to_dispatch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 /* closure and continue_to_dispatch unused */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ExternalClientWidget w = (ExternalClientWidget) wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 if (w->externalClient.shell_ready)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 if (event->type == KeyPress || event->type == KeyRelease ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 event->type == ButtonPress || event->type == ButtonRelease ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 event->type == MotionNotify)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 event->xkey.subwindow = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 /* hackkkkkkkkkkkkkk! Suppress CTRL-TAB, SHIFT-TAB, etc. so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 Emacs doesn't attempt to interpret focus-change keystrokes. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 if (event->type == KeyPress &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 XLookupKeysym ((XKeyEvent *) event, 0) == XK_Tab &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (event->xkey.state & ControlMask ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 event->xkey.state & ShiftMask))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 event->xany.window = w->core.window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 XSendEvent (XtDisplay (wid), w->externalClient.event_window, FALSE, 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 event);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 XSync (XtDisplay (wid), 0); /* make sure that any BadWindow errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (meaning the server died) get handled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 before XSendEvent is called again. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 EventHandler (Widget wid, XtPointer closure, XEvent *event,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 Boolean *continue_to_dispatch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 /* closure and continue_to_dispatch unused */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 ExternalClientWidget w = (ExternalClientWidget) wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 if (w->core.window != event->xany.window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 XtAppErrorMsg (XtWidgetToApplicationContext (wid),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 "invalidWindow","eventHandler",XtCXtToolkitError,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 "Event with wrong window",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (String *)NULL, (Cardinal *)NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 if (event->type == ClientMessage &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 event->xclient.message_type == a_EXTW_NOTIFY &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 event->xclient.data.l[0] == extw_shell_send)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 switch (event->xclient.data.l[1])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 case extw_notify_qg:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 /* shell is alive again. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 w->externalClient.dead_shell = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 case extw_notify_gm:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 XtWidgetGeometry xwg, xwg_return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 XtGeometryResult result;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 extw_get_geometry_value (XtDisplay (wid), XtWindow (wid),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 a_EXTW_GEOMETRY_MANAGER, &xwg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 result = XtMakeGeometryRequest (wid, &xwg, &xwg_return);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 extw_send_geometry_value (XtDisplay (wid), XtWindow (wid),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 a_EXTW_GEOMETRY_MANAGER, extw_notify_gm,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 result == XtGeometryAlmost ? &xwg_return :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 NULL, result);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 case extw_notify_init:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 w->externalClient.shell_ready = True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 w->externalClient.event_window = event->xclient.data.l[2];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 w->externalClient.event_mask = event->xclient.data.l[3];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 add_ww (w->externalClient.event_window, (Widget) w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 XtAddEventHandler (wid, w->externalClient.event_mask,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 FALSE, MaskableEventHandler, (XtPointer) NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 NOTIFY (w, extw_notify_init,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 EXTW_TYPE_MOTIF,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 NOTIFY (w, extw_notify_init,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 EXTW_TYPE_XT,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 case extw_notify_end:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 end_connection (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 remove_ww (w->externalClient.event_window);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 case extw_notify_set_focus:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 XmProcessTraversal (wid, XmTRAVERSE_CURRENT);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 XtSetKeyboardFocus (wid, None);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 static void Destroy(wid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 Widget wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ExternalClientWidget w = (ExternalClientWidget)wid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 NOTIFY(w, extw_notify_end, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 static XtGeometryResult QueryGeometry(gw, request, reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 Widget gw;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 XtWidgetGeometry *request, *reply;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 ExternalClientWidget w = (ExternalClientWidget)gw;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 XEvent event;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 unsigned long request_num;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 Display *display = XtDisplay(gw);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 XtWidgetGeometry req = *request; /* don't modify caller's structure */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 if (!XtIsRealized((Widget)w) || !w->externalClient.shell_ready)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 return XtGeometryYes;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 if (w->externalClient.dead_shell == TRUE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 /* The shell is sick. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 return XtGeometryNo;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 req.sibling = None;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 req.request_mode &= ~CWSibling;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 request_num = NextRequest(display);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 extw_send_geometry_value(XtDisplay(gw), XtWindow(gw), a_EXTW_QUERY_GEOMETRY,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 extw_notify_qg, &req, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 if (extw_wait_for_response(gw, &event, request_num, extw_notify_qg,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 w->externalClient.shell_timeout)) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 XtGeometryResult result = (XtGeometryResult) event.xclient.data.l[0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 if (result == XtGeometryAlmost) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 extw_get_geometry_value(XtDisplay(gw), XtWindow(gw),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 a_EXTW_QUERY_GEOMETRY, reply);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 return result;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 } else {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 w->externalClient.dead_shell = TRUE; /* timed out; must be broken */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 return XtGeometryNo;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 static void ExternalClientFocusIn (Widget w, XEvent *event, String *params,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 Cardinal *num_params)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 ExternalClientWidget ecw = (ExternalClientWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 if (event->xfocus.send_event && !ecw->externalClient.has_focus) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 ecw->externalClient.has_focus = True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 NOTIFY(ecw, extw_notify_focus_in, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 _XmPrimitiveFocusIn (w, event, params, num_params);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 static void ExternalClientFocusOut (Widget w, XEvent *event, String *params,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 Cardinal *num_params)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 ExternalClientWidget ecw = (ExternalClientWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 if (event->xfocus.send_event && ecw->externalClient.has_focus) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 ecw->externalClient.has_focus = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 NOTIFY(ecw, extw_notify_focus_out, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 _XmPrimitiveFocusOut(w, event, params, num_params);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 static void ExternalClientEnter (Widget w, XEvent *event, String *params,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 Cardinal *num_params)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 ExternalClientWidget ecw = (ExternalClientWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 if (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 _XmGetFocusPolicy (w) != XmEXPLICIT &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 !ecw->externalClient.has_focus &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 event->xcrossing.focus && event->xcrossing.detail != NotifyInferior) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 ecw->externalClient.has_focus = True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 NOTIFY(ecw, extw_notify_focus_in, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 _XmPrimitiveEnter (w, event, params, num_params);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 static void ExternalClientLeave (Widget w, XEvent *event, String *params,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 Cardinal *num_params)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 ExternalClientWidget ecw = (ExternalClientWidget) w;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 if (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 _XmGetFocusPolicy (w) != XmEXPLICIT &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 ecw->externalClient.has_focus &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 event->xcrossing.focus && event->xcrossing.detail != NotifyInferior) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 ecw->externalClient.has_focus = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 NOTIFY(ecw, extw_notify_focus_out, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 #ifdef EXTW_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 _XmPrimitiveLeave (w, event, params, num_params);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 }