1 /* $TOG: WmChBackD.c /main/7 1998/07/30 12:11:23 mgreess $
3 * (c) Copyright 1996 Digital Equipment Corporation.
4 * (c) Copyright 1991,1993,1994,1996 Hewlett-Packard Company.
5 * (c) Copyright 1993,1994,1996 International Business Machines Corp.
6 * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
7 * (c) Copyright 1993,1994,1996 Novell, Inc.
8 * (c) Copyright 1996 FUJITSU LIMITED.
9 * (c) Copyright 1996 Hitachi.
12 /************************************<+>*************************************
13 ****************************************************************************
17 ** Description: Request backdrop change of the workspace manager
19 ****************************************************************************
20 ************************************<+>*************************************/
23 #include <X11/Xutil.h>
24 #include <X11/Xatom.h>
28 #include <Xm/AtomMgr.h>
31 #define SYS_FILE_SEARCH_PATH "DTICONSEARCHPATH"
34 /*************************************<->*************************************
36 * DtWsmChangeBackdrop (display, root, path, pixmap)
41 * Request the CDE workspace manager to change the backdrop
47 * root - root window of screen
48 * path - file path to bitmap file
49 * pixmap - pixmap id of backdrop pixmap
53 * Success if request sent
57 * public interface to _DtWsmChangeBackdrop()
59 *************************************<->***********************************/
67 return _DtWsmChangeBackdrop(display, root, path, pixmap);
71 /*************************************<->*************************************
73 * _DtWsmChangeBackdrop (display, root, path, pixmap)
78 * Request the CDE workspace manager to change the backdrop
84 * root - root window of screen
85 * path - file path to bitmap file
86 * pixmap - pixmap id of backdrop pixmap
90 * Success if request sent
95 *************************************<->***********************************/
97 _DtWsmChangeBackdrop (
112 * Get the workspace manager window
114 if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
120 * Build up the NULL-terminated request string
122 len = strlen (DTWM_REQ_CHANGE_BACKDROP) + 1;
123 len += strlen (path) + 1;
124 len += 30; /* fudge for ascii-ized pixmap id */
126 pch = (char *) XtMalloc (len * sizeof(char));
128 sprintf (pch, "%s %s %lx", DTWM_REQ_CHANGE_BACKDROP, path,
132 * Make the request by appending the string to
133 * the _DT_WM_REQUEST property
135 rval = XChangeProperty (display, wmWindow,
136 XmInternAtom(display, _XA_DT_WM_REQUEST, False),
137 XA_STRING, 8, PropModeAppend,
138 (unsigned char *)pch,
145 } /* END OF FUNCTION _DtWsmChangeBackdrop */