f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987, 1998 The Open Group
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncthe above copyright notice appear in all copies and that both that
f78b12e570284aa8291f4ca1add24937fd107403vboxsynccopyright notice and this permission notice appear in supporting
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncThe above copyright notice and this permission notice shall be included in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncall copies or substantial portions of the Software.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncin this Software without prior written authorization from The Open Group.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync All Rights Reserved
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, and distribute this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose and without fee is hereby granted,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncprovided that the above copyright notice appear in all copies and that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncboth that copyright notice and this permission notice appear in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsupporting documentation, and that the name of Digital not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or publicity pertaining to distribution of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsoftware without specific, written prior permission.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncSOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef CMAPSTRUCT_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define CMAPSTRUCT_H 1
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <X11/Xarch.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "colormap.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "screenint.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "privates.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* Shared color -- the color is used by AllocColorPlanes */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short color;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync short refcnt;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} SHAREDCOLOR;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * use the first value (called red) in the structure. What channel they
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * are really talking about depends on which map they are in. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short red, green, blue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} LOCO;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * DirectColor maps always use the first value (called red) in the structure.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * What channel they are really talking about depends on which map they
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * are in. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync SHAREDCOLOR *red, *green, *blue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} SHCO;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* color map entry */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _CMEntry
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync union
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync LOCO local;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync SHCO shco;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync } co;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync short refcnt;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Bool fShared;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} Entry;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * only needs one cell table, we arbitrarily pick red. We keep track
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * of that table with freeRed, numPixelsRed, and clientPixelsRed
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The padN variables are unfortunate ABI BC. See fdo bug #6924.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _ColormapRec
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync VisualPtr pVisual;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync short class; /* PseudoColor or DirectColor */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#if defined(_LP64)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync short pad0;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XID pad1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XID mid; /* client's name for colormap */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#if defined(_LP64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XID pad2;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ScreenPtr pScreen; /* screen map is associated with */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync short flags; /* 1 = IsDefault
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * 2 = AllAllocated */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int freeRed;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int freeGreen;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int freeBlue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *numPixelsRed;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *numPixelsGreen;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *numPixelsBlue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Pixel **clientPixelsRed;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Pixel **clientPixelsGreen;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Pixel **clientPixelsBlue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Entry *red;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Entry *green;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Entry *blue;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PrivateRec *devPrivates;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} ColormapRec;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* COLORMAP_H */