Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,144 @@
/* $XConsortium: WmRestart.c /main/5 1996/05/20 16:08:04 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1991,1993,1994,1996 Hewlett-Packard Company.
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
* (c) Copyright 1993,1994,1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/************************************<+>*************************************
****************************************************************************
**
** File: WmRestart.c
**
** Project: HP DT Workspace Manager
**
** Description: Request restart of the HP DT workspace manager
**
****************************************************************************
************************************<+>*************************************/
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <Dt/Wsm.h>
#include <Dt/WsmP.h>
#include <Xm/Xm.h>
#include <Xm/AtomMgr.h>
/*************************************<->*************************************
*
* _DtWmRestart (display, root)
*
*
* Description:
* -----------
* Request the window manager to restart
*
*
* Inputs:
* ------
* display - display
* root - root window of screen
*
* Returns:
* --------
* Success if request sent
*
*************************************<->***********************************/
int
_DtWmRestart (Display *display, Window root)
{
int rval = BadAtom;
Window wmWindow;
/*
* Get the workspace manager window
*/
if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
{
/*
* Make the request by appending the restart request
* name to the _DT_WM_REQUEST property
*/
rval = XChangeProperty (display, wmWindow,
XmInternAtom(display, _XA_DT_WM_REQUEST, False),
XA_STRING, 8, PropModeAppend,
(unsigned char *)DTWM_REQ_RESTART,
1+strlen(DTWM_REQ_RESTART));
XFlush (display); /* do it now */
}
return (rval);
} /* END OF FUNCTION _DtWmRestart */
/*************************************<->*************************************
*
* int _DtWmRestartNoConfirm (display, root)
*
*
* Description:
* -----------
* Request the window manager to restart with no confirmation dialog
*
*
* Inputs:
* ------
* display - display
* root - root window of screen
*
* Returns:
* --------
* Success if request sent
*
*************************************<->***********************************/
int
_DtWmRestartNoConfirm (Display *display, Window root)
{
int rval;
Window wmWindow;
char buffer[80];
/*
* Make the request by appending the restart request
* name to the _DT_WM_REQUEST property
*/
strcpy (&buffer[0], DTWM_REQ_RESTART);
strcat (&buffer[0], " ");
strcat (&buffer[0], DTWM_REQP_NO_CONFIRM);
/*
* Get the workspace manager window
*/
if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
{
/*
* Make the request by appending the restart request
* name to the _DT_WM_REQUEST property
*/
rval = XChangeProperty (display, wmWindow,
XmInternAtom(display, _XA_DT_WM_REQUEST, False),
XA_STRING, 8, PropModeAppend,
(unsigned char *)buffer,
1+strlen(buffer));
XFlush (display); /* do it now */
}
return (rval);
} /* END OF FUNCTION _DtWmRestartNoConfirm */