2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $TOG: init.c /main/4 1997/06/18 17:32:40 samborn $
26 * Copyright (c) 1992 HaL Computer Systems, Inc. All rights reserved.
27 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
28 * States. Use of a copyright notice is precautionary only and does not
29 * imply publication or disclosure.
31 * This software contains confidential information and trade secrets of HaL
32 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
33 * without the prior express written permission of HaL Computer Systems, Inc.
35 * RESTRICTED RIGHTS LEGEND
36 * Use, duplication, or disclosure by the Government is subject to
37 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
38 * Technical Data and Computer Software clause at DFARS 252.227-7013.
39 * HaL Computer Systems, Inc.
40 * 1315 Dell Avenue, Campbell, CA 95008
48 Atom _olias_window_id_atom;
49 Atom _olias_event_atom;
50 Atom _olias_reply_atom;
51 Atom _olias_client_atom;
53 /* **************************************************************
54 * _olias_initialize - initialize olias interface
55 * ************************************************************** */
58 _olias_initialize (Widget toplevel)
60 enum { XA_OLIAS_WINDOW_ID_ATOM, XA_OLIAS_EVENT_ATOM,
61 XA_OLIAS_REPLY_ATOM, NUM_ATOMS };
62 static char* atom_names[] = { OLIAS_WINDOW_ID_ATOM, OLIAS_EVENT_ATOM,
66 Atom atoms[XtNumber(atom_names)];
68 /* -------- Create standard communication properties. -------- */
70 XInternAtoms(XtDisplay (toplevel), atom_names, XtNumber(atom_names),
72 _olias_window_id_atom = atoms[XA_OLIAS_WINDOW_ID_ATOM];
73 _olias_event_atom = atoms[XA_OLIAS_EVENT_ATOM];
74 _olias_reply_atom = atoms[XA_OLIAS_REPLY_ATOM];
76 /* -------- Create a unique selection property for this client. -------- */
78 sprintf (buf, OLIAS_CLIENT_ATOM_FMT, XtWindow (toplevel));
79 _olias_client_atom = XInternAtom (XtDisplay (toplevel), buf, False);
81 /* -------- Set up communication handling routines. -------- */
83 /* Ok to use CurrentTime because contention not possible. */
84 XtOwnSelection (toplevel, _olias_client_atom, CurrentTime,
85 _olias_convert_event, NULL, NULL);
87 XtAddEventHandler (toplevel, None, True, _olias_handle_reply, NULL);