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 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
25 * (c) Copyright 1993, 1994 International Business Machines Corp. *
26 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
27 * (c) Copyright 1993, 1994 Novell, Inc. *
29 /************************************<+>*************************************
30 ****************************************************************************
34 ** RCS: $XConsortium: WmRequest.c /main/4 1995/10/26 15:13:08 rswiston $
35 ** Project: HP DT Workspace Manager
37 ** Description: Send a function request to the window manager
39 ** (c) Copyright 1992, 1993 by Hewlett-Packard Company
41 ****************************************************************************
42 ************************************<+>*************************************/
45 #include <X11/Xutil.h>
46 #include <X11/Xatom.h>
50 #include <Xm/AtomMgr.h>
54 /*************************************<->*************************************
56 * _DtWmRequestMultiple (display, root, char *pchRequest, int len)
61 * Send one or more function requests to the window manager.
67 * root - root window of screen
68 * pchRequest - string request (possibly multiple)
69 * (usu. of form "f.<func> [<arg>]")
70 * len - length of request, counting terminating NULL
74 * Success if request sent
76 *************************************<->***********************************/
78 _DtWmRequestMultiple (
84 Status rval = BadAtom;
88 * Get the workspace manager window
90 if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
94 * Make the request by appending the request
95 * to the _DT_WM_REQUEST property
98 rval = XChangeProperty (display, wmWindow,
99 XmInternAtom(display, _XA_DT_WM_REQUEST, False),
100 XA_STRING, 8, PropModeAppend,
101 (unsigned char *)pchRequest,
108 } /* END OF FUNCTION _DtWmRequestMultiple */
112 /*************************************<->*************************************
114 * DtWmRequest (display, root, char *pchRequest)
119 * Send a function request to the window manager.
125 * root - root window of screen
126 * pchRequest - NULL terminated string request
127 * (usu. of form "f.<func> [<arg>]")
131 * Success if request sent
133 *************************************<->***********************************/
135 DtWmRequest (Display *display, Window root, char *pchRequest)
137 return (_DtWmRequestMultiple (display, root,
138 pchRequest, 1+strlen(pchRequest)));
140 } /* END OF FUNCTION DtWmRequest */