|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
/***********************************************************
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
Copyright 1987, 1998 The Open Group
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
Permission to use, copy, modify, distribute, and sell this software and its
|
|
Packit |
5bd3a9 |
documentation for any purpose is hereby granted without fee, provided that
|
|
Packit |
5bd3a9 |
the above copyright notice appear in all copies and that both that
|
|
Packit |
5bd3a9 |
copyright notice and this permission notice appear in supporting
|
|
Packit |
5bd3a9 |
documentation.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
The above copyright notice and this permission notice shall be included in
|
|
Packit |
5bd3a9 |
all copies or substantial portions of the Software.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit |
5bd3a9 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit |
5bd3a9 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
Packit |
5bd3a9 |
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
Packit |
5bd3a9 |
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
Packit |
5bd3a9 |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
Except as contained in this notice, the name of The Open Group shall not be
|
|
Packit |
5bd3a9 |
used in advertising or otherwise to promote the sale, use or other dealings
|
|
Packit |
5bd3a9 |
in this Software without prior written authorization from The Open Group.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
All Rights Reserved
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
Permission to use, copy, modify, and distribute this software and its
|
|
Packit |
5bd3a9 |
documentation for any purpose and without fee is hereby granted,
|
|
Packit |
5bd3a9 |
provided that the above copyright notice appear in all copies and that
|
|
Packit |
5bd3a9 |
both that copyright notice and this permission notice appear in
|
|
Packit |
5bd3a9 |
supporting documentation, and that the name of Digital not be
|
|
Packit |
5bd3a9 |
used in advertising or publicity pertaining to distribution of the
|
|
Packit |
5bd3a9 |
software without specific, written prior permission.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
Packit |
5bd3a9 |
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
Packit |
5bd3a9 |
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
Packit |
5bd3a9 |
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
Packit |
5bd3a9 |
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
Packit |
5bd3a9 |
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
Packit |
5bd3a9 |
SOFTWARE.
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
******************************************************************/
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
#ifdef HAVE_CONFIG_H
|
|
Packit |
5bd3a9 |
#include <config.h>
|
|
Packit |
5bd3a9 |
#endif
|
|
Packit |
5bd3a9 |
#include <X11/Xlibint.h>
|
|
Packit |
5bd3a9 |
#include <X11/Xutil.h>
|
|
Packit |
5bd3a9 |
#include "Xatomtype.h"
|
|
Packit |
5bd3a9 |
#include <X11/Xatom.h>
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
/*
|
|
Packit |
5bd3a9 |
* WARNING
|
|
Packit |
5bd3a9 |
*
|
|
Packit |
5bd3a9 |
* This is a pre-ICCCM routine. It must not reference any of the new fields
|
|
Packit |
5bd3a9 |
* in the XStandardColormap structure.
|
|
Packit |
5bd3a9 |
*/
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
void XSetStandardColormap(
|
|
Packit |
5bd3a9 |
Display *dpy,
|
|
Packit |
5bd3a9 |
Window w,
|
|
Packit |
5bd3a9 |
XStandardColormap *cmap,
|
|
Packit |
5bd3a9 |
Atom property) /* XA_RGB_BEST_MAP, etc. */
|
|
Packit |
5bd3a9 |
{
|
|
Packit |
5bd3a9 |
Screen *sp;
|
|
Packit |
5bd3a9 |
XStandardColormap stdcmap;
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
sp = _XScreenOfWindow (dpy, w);
|
|
Packit |
5bd3a9 |
if (!sp) {
|
|
Packit |
5bd3a9 |
/* already caught the XGetGeometry error in _XScreenOfWindow */
|
|
Packit |
5bd3a9 |
return;
|
|
Packit |
5bd3a9 |
}
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
stdcmap.colormap = cmap->colormap;
|
|
Packit |
5bd3a9 |
stdcmap.red_max = cmap->red_max;
|
|
Packit |
5bd3a9 |
stdcmap.red_mult = cmap->red_mult;
|
|
Packit |
5bd3a9 |
stdcmap.green_max = cmap->green_max;
|
|
Packit |
5bd3a9 |
stdcmap.green_mult = cmap->green_mult;
|
|
Packit |
5bd3a9 |
stdcmap.blue_max = cmap->blue_max;
|
|
Packit |
5bd3a9 |
stdcmap.blue_mult = cmap->blue_mult;
|
|
Packit |
5bd3a9 |
stdcmap.base_pixel = cmap->base_pixel;
|
|
Packit |
5bd3a9 |
stdcmap.visualid = sp->root_visual->visualid;
|
|
Packit |
5bd3a9 |
stdcmap.killid = None; /* don't know how to kill this one */
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
#ifdef XCMS
|
|
Packit |
5bd3a9 |
XSetRGBColormaps (dpy, w, &stdcmap, 1, property);
|
|
Packit |
5bd3a9 |
#endif
|
|
Packit |
5bd3a9 |
|
|
Packit |
5bd3a9 |
return;
|
|
Packit |
5bd3a9 |
}
|