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 #ifdef VERBOSE_REV_INFO
25 static char rcs_id[] = "$XConsortium: TermPrimWMProtocols.c /main/1 1996/04/21 19:20:04 drk $";
26 #endif /* VERBOSE_REV_INFO */
29 * (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
30 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
31 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
32 * (c) Copyright 1993, 1994, 1996 Novell, Inc. *
33 * (c) Copyright 1996 Digital Equipment Corporation. *
34 * (c) Copyright 1996 FUJITSU LIMITED. *
35 * (c) Copyright 1996 Hitachi. *
38 #include "TermHeader.h"
39 #include "TermPrimDebug.h"
41 #include <Xm/Protocols.h>
43 static Atom xa_WM_DELETE_WINDOW;
44 static Atom xa_WM_SAVE_YOURSELF;
45 static Boolean initialized = False;
48 protocolsInitialize(Widget topLevel)
51 xa_WM_DELETE_WINDOW = XInternAtom(XtDisplay(topLevel),
52 "WM_DELETE_WINDOW", False);
53 xa_WM_SAVE_YOURSELF = XInternAtom(XtDisplay(topLevel),
54 "WM_SAVE_YOURSELF", False);
60 _DtTermPrimAddDeleteWindowCallback(Widget topLevel, XtCallbackProc callback,
61 XtPointer client_data)
63 /* initialize things... */
66 (void) protocolsInitialize(topLevel);
67 _DtTermProcessUnlock();
68 (void) XmAddWMProtocols(topLevel, &xa_WM_DELETE_WINDOW, 1);
69 (void) XmAddWMProtocolCallback(topLevel, xa_WM_DELETE_WINDOW, callback,
74 _DtTermPrimAddSaveYourselfCallback(Widget topLevel, XtCallbackProc callback,
75 XtPointer client_data)
77 /* initialize things... */
80 (void) protocolsInitialize(topLevel);
81 _DtTermProcessUnlock();
82 (void) XmAddWMProtocols(topLevel, &xa_WM_SAVE_YOURSELF, 1);
83 (void) XmAddWMProtocolCallback(topLevel, xa_WM_SAVE_YOURSELF, callback,