1 /* Common code between client and shell widgets; not Xt-specific.
2 Copyright (C) 1993, 1994 Sun Microsystems, Inc.
4 This file is part of SXEmacs
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 SXEmacs 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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* Synched up with: Not in FSF. */
22 /* Written by Ben Wing, September 1993. */
28 #ifndef EXTERNAL_WIDGET
29 ERROR ! This ought not be getting compiled if EXTERNAL_WIDGET
34 #include "ui/X11/extw-Xlib.h"
37 static int atoms_initialized;
38 Atom a_EXTW_QUERY_GEOMETRY, a_EXTW_GEOMETRY_MANAGER, a_EXTW_WIDGET_GEOMETRY,
41 void extw_initialize_atoms(Display * display)
43 if (!atoms_initialized) {
44 a_EXTW_QUERY_GEOMETRY =
45 XInternAtom(display, "EXTW_QUERY_GEOMETRY", False);
46 a_EXTW_GEOMETRY_MANAGER =
47 XInternAtom(display, "EXTW_GEOMETRY_MANAGER", False);
48 a_EXTW_WIDGET_GEOMETRY =
49 XInternAtom(display, "EXTW_WIDGET_GEOMETRY", False);
50 a_EXTW_NOTIFY = XInternAtom(display, "EXTW_NOTIFY", False);
51 atoms_initialized = 1;
56 /* send a notification to the other-side widget. */
59 extw_send_notify_3(Display * display, Window win, en_extw_notify type,
60 long data0, long data1, long data2)
62 XClientMessageEvent xev;
64 xev.type = ClientMessage;
65 xev.message_type = a_EXTW_NOTIFY;
67 xev.display = display;
69 xev.data.l[0] = extw_which_side;
71 xev.data.l[2] = data0;
72 xev.data.l[3] = data1;
73 xev.data.l[4] = data2;
75 /* UGGGHHHH! All I want to do is ensure that the ClientMessage gets
76 received. Unfortunately X doesn't provide any simple way to do
77 that but instead has this event_mask bogosity in XSendEvent. */
79 XSendEvent(display, win, False,
80 extw_which_side == extw_shell_send ? 0 : StructureNotifyMask,