123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $TOG: WmChBackD.c /main/7 1998/07/30 12:11:23 mgreess $
- *
- * (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: WmChBackD.c
- **
- ** Description: Request backdrop change of the 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>
- #define SYS_FILE_SEARCH_PATH "DTICONSEARCHPATH"
-
- /*************************************<->*************************************
- *
- * DtWsmChangeBackdrop (display, root, path, pixmap)
- *
- *
- * Description:
- * -----------
- * Request the CDE workspace manager to change the backdrop
- *
- *
- * Inputs:
- * ------
- * display - display
- * root - root window of screen
- * path - file path to bitmap file
- * pixmap - pixmap id of backdrop pixmap
- *
- * Returns:
- * --------
- * Success if request sent
- *
- * Comments:
- * ---------
- * public interface to _DtWsmChangeBackdrop()
- *
- *************************************<->***********************************/
- int
- DtWsmChangeBackdrop (
- Display *display,
- Window root,
- char *path,
- Pixmap pixmap)
- {
- return _DtWsmChangeBackdrop(display, root, path, pixmap);
- }
- /*************************************<->*************************************
- *
- * _DtWsmChangeBackdrop (display, root, path, pixmap)
- *
- *
- * Description:
- * -----------
- * Request the CDE workspace manager to change the backdrop
- *
- *
- * Inputs:
- * ------
- * display - display
- * root - root window of screen
- * path - file path to bitmap file
- * pixmap - pixmap id of backdrop pixmap
- *
- * Returns:
- * --------
- * Success if request sent
- *
- * Comments:
- * ---------
- *
- *************************************<->***********************************/
- int
- _DtWsmChangeBackdrop (
- Display *display,
- Window root,
- char *path,
- Pixmap pixmap)
- {
- int rval = BadAtom;
- Window wmWindow;
- if (!path)
- {
- rval = BadValue;
- }
- else
- /*
- * Get the workspace manager window
- */
- if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
- {
- char *pch;
- int len;
-
- /*
- * Build up the NULL-terminated request string
- */
- len = strlen (DTWM_REQ_CHANGE_BACKDROP) + 1;
- len += strlen (path) + 1;
- len += 30; /* fudge for ascii-ized pixmap id */
- pch = (char *) XtMalloc (len * sizeof(char));
- sprintf (pch, "%s %s %lx", DTWM_REQ_CHANGE_BACKDROP, path,
- pixmap);
- /*
- * Make the request by appending the string to
- * the _DT_WM_REQUEST property
- */
- rval = XChangeProperty (display, wmWindow,
- XmInternAtom(display, _XA_DT_WM_REQUEST, False),
- XA_STRING, 8, PropModeAppend,
- (unsigned char *)pch,
- 1+strlen(pch));
- }
- return (rval);
- } /* END OF FUNCTION _DtWsmChangeBackdrop */
|