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 libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: SmProtocol.c /main/8 1998/08/05 13:38:17 samborn $ */
24 /*************************************<+>*************************************
25 *****************************************************************************
29 ** Project: HP DT Session Manager (dtsession)
33 ** This file contains all modules that handle the initialization and
34 ** interning of all atoms used by the session manager.
37 *****************************************************************************
38 *************************************<+>*************************************/
40 * (c) Copyright 1996 Digital Equipment Corporation.
41 * (c) Copyright 1990, 1993, 1994, 1996 Hewlett-Packard Company
42 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp.
43 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc.
44 * (c) Copyright 1993, 1994, 1996 Novell, Inc.
45 * (c) Copyright 1996 FUJITSU LIMITED.
46 * (c) Copyright 1996 Hitachi.
50 #include <X11/Intrinsic.h>
51 #include <X11/Xatom.h>
54 #include <Dt/Connect.h>
55 #include <Dt/SessionM.h>
56 #include <Dt/SessionP.h>
58 #include "SmProtocol.h"
62 * Global variable definitions
65 Atom XaWmSaveYourself;
71 Atom XaSmStartAckWindow;
72 Atom XaSmStopAckWindow;
79 Atom XaDtSmStmProtocol;
80 Atom XaDtSmSaveToHome;
81 Atom XaDtSmStateChange;
82 Atom XaDtSmRestoreDefault;
83 Atom XaDtSmLockChange;
86 Atom XaDtSmScreenInfo;
88 Atom XaDtSmKeyboardInfo;
90 Atom XaDtSmPointerInfo;
91 Atom XaSmScreenSaveRet;
92 Atom XaDtSmPreeditInfo;
95 /*************************************<->*************************************
102 * Handles interning of atoms used by the session manager. All should
103 * already exist because the session manager is a toolkit application.
104 * Also handles setting of selection mechanism used by session manager to
105 * distribute unique file names.
119 *************************************<->***********************************/
123 enum { XA_WM_PROTOCOLS, XA_WM_SAVE_YOURSELF,
124 XA_DT_SAVE_MODE, XA_WM_STATE,
125 XA_DT_SM_STM_PROTOCOL, XA_DT_SM_SAVE_TO_HOME,
126 XA_DT_SM_STATE_CHANGE, XA_DT_SM_RESTORE_DEFAULT,
127 XA_DT_SM_LOCK_CHANGE, XA_DT_SM_SCREEN_INFO,
128 XA_DT_SM_STATE_INFO, XA_DT_SM_SAVER_INFO,
129 XA_DT_SM_AUDIO_INFO, XA_DT_SM_KEYBOARD_INFO,
130 XA_DT_SM_FONT_INFO, XA_DT_SM_POINTER_INFO,
131 XA_DT_SM_PREEDIT_INFO, NUM_ATOMS };
132 static char *atom_names[] = { _XA_WM_PROTOCOLS, _XA_WM_SAVE_YOURSELF,
133 _XA_DT_SAVE_MODE, _XA_WM_STATE,
134 _XA_DT_SM_STM_PROTOCOL, _XA_DT_SM_SAVE_TO_HOME,
135 _XA_DT_SM_STATE_CHANGE, _XA_DT_SM_RESTORE_DEFAULT,
136 _XA_DT_SM_LOCK_CHANGE, _XA_DT_SM_SCREEN_INFO,
137 _XA_DT_SM_STATE_INFO, _XA_DT_SM_SAVER_INFO,
138 _XA_DT_SM_AUDIO_INFO, _XA_DT_SM_KEYBOARD_INFO,
139 _XA_DT_SM_FONT_INFO, _XA_DT_SM_POINTER_INFO,
140 _XA_DT_SM_PREEDIT_INFO };
142 Atom atoms[XtNumber(atom_names)];
144 XInternAtoms(smGD.display, atom_names, XtNumber(atom_names), False, atoms);
146 XaWmProtocols = atoms[XA_WM_PROTOCOLS];
147 XaWmSaveYourself = atoms[XA_WM_SAVE_YOURSELF];
148 XaSmSaveMode = atoms[XA_DT_SAVE_MODE];
149 XaWmState = atoms[XA_WM_STATE];
150 XaDtSmStmProtocol = atoms[XA_DT_SM_STM_PROTOCOL];
151 XaDtSmSaveToHome = atoms[XA_DT_SM_SAVE_TO_HOME];
152 XaDtSmStateChange = atoms[XA_DT_SM_STATE_CHANGE];
153 XaDtSmRestoreDefault = atoms[XA_DT_SM_RESTORE_DEFAULT];
154 XaDtSmLockChange = atoms[XA_DT_SM_LOCK_CHANGE];
155 XaDtSmScreenInfo = atoms[XA_DT_SM_SCREEN_INFO];
156 XaDtSmStateInfo = atoms[XA_DT_SM_STATE_INFO];
157 XaDtSmSaverInfo = atoms[XA_DT_SM_SAVER_INFO];
158 XaDtSmAudioInfo = atoms[XA_DT_SM_AUDIO_INFO];
159 XaDtSmKeyboardInfo = atoms[XA_DT_SM_KEYBOARD_INFO];
160 XaDtSmFontInfo = atoms[XA_DT_SM_FONT_INFO];
161 XaDtSmPointerInfo = atoms[XA_DT_SM_POINTER_INFO];
162 XaDtSmPreeditInfo = atoms[XA_DT_SM_PREEDIT_INFO];