|
|
1.1 root 1: #include "copyright.h"
2:
3: /* $Header: XSetStCmap.c,v 1.2 87/09/11 08:15:53 toddb Exp $ */
4:
5: /***********************************************************
6: Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
7: and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
8:
9: All Rights Reserved
10:
11: Permission to use, copy, modify, and distribute this software and its
12: documentation for any purpose and without fee is hereby granted,
13: provided that the above copyright notice appear in all copies and that
14: both that copyright notice and this permission notice appear in
15: supporting documentation, and that the names of Digital or MIT not be
16: used in advertising or publicity pertaining to distribution of the
17: software without specific, written prior permission.
18:
19: DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
20: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21: DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
25: SOFTWARE.
26:
27: ******************************************************************/
28:
29: #include "Xlibint.h"
30: #include "Xutil.h"
31: #include "Xatomtype.h"
32: #include "Xatom.h"
33:
34: void XSetStandardColormap(dpy, w, cmap, property)
35: Display *dpy;
36: Window w;
37: XStandardColormap *cmap;
38: Atom property; /* XA_RGB_BEST_MAP, etc. */
39: {
40: xPropStandardColormap prop;
41:
42: prop.colormap = cmap->colormap;
43: prop.red_max = cmap->red_max;
44: prop.red_mult = cmap->red_mult;
45: prop.green_max = cmap->green_max;
46: prop.green_mult = cmap->green_mult;
47: prop.blue_max = cmap->blue_max;
48: prop.blue_mult = cmap->blue_mult;
49: prop.base_pixel = cmap->base_pixel;
50: XChangeProperty (dpy, w, property, XA_RGB_COLOR_MAP, 32,
51: PropModeReplace, (unsigned char *) &prop,
52: NumPropStandardColormapElements);
53: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.