2 * $TOG: init.c /main/4 1997/06/18 17:32:40 samborn $
4 * Copyright (c) 1992 HaL Computer Systems, Inc. All rights reserved.
5 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
9 * This software contains confidential information and trade secrets of HaL
10 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
11 * without the prior express written permission of HaL Computer Systems, Inc.
13 * RESTRICTED RIGHTS LEGEND
14 * Use, duplication, or disclosure by the Government is subject to
15 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
16 * Technical Data and Computer Software clause at DFARS 252.227-7013.
17 * HaL Computer Systems, Inc.
18 * 1315 Dell Avenue, Campbell, CA 95008
26 Atom _olias_window_id_atom;
27 Atom _olias_event_atom;
28 Atom _olias_reply_atom;
29 Atom _olias_client_atom;
31 /* **************************************************************
32 * _olias_initialize - initialize olias interface
33 * ************************************************************** */
36 _olias_initialize (Widget toplevel)
38 enum { XA_OLIAS_WINDOW_ID_ATOM, XA_OLIAS_EVENT_ATOM,
39 XA_OLIAS_REPLY_ATOM, NUM_ATOMS };
40 static char* atom_names[] = { OLIAS_WINDOW_ID_ATOM, OLIAS_EVENT_ATOM,
44 Atom atoms[XtNumber(atom_names)];
46 /* -------- Create standard communication properties. -------- */
48 XInternAtoms(XtDisplay (toplevel), atom_names, XtNumber(atom_names),
50 _olias_window_id_atom = atoms[XA_OLIAS_WINDOW_ID_ATOM];
51 _olias_event_atom = atoms[XA_OLIAS_EVENT_ATOM];
52 _olias_reply_atom = atoms[XA_OLIAS_REPLY_ATOM];
54 /* -------- Create a unique selection property for this client. -------- */
56 sprintf (buf, OLIAS_CLIENT_ATOM_FMT, XtWindow (toplevel));
57 _olias_client_atom = XInternAtom (XtDisplay (toplevel), buf, False);
59 /* -------- Set up communication handling routines. -------- */
61 /* Ok to use CurrentTime because contention not possible. */
62 XtOwnSelection (toplevel, _olias_client_atom, CurrentTime,
63 _olias_convert_event, NULL, NULL);
65 XtAddEventHandler (toplevel, None, True, _olias_handle_reply, NULL);