a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/*
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncCopyright 1987, 1998 The Open Group
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncPermission to use, copy, modify, distribute, and sell this software and its
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncdocumentation for any purpose is hereby granted without fee, provided that
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncthe above copyright notice appear in all copies and that both that
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynccopyright notice and this permission notice appear in supporting
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncdocumentation.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncThe above copyright notice and this permission notice shall be included in
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncall copies or substantial portions of the Software.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncExcept as contained in this notice, the name of The Open Group shall not be
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncused in advertising or otherwise to promote the sale, use or other dealings
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncin this Software without prior written authorization from The Open Group.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync All Rights Reserved
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncPermission to use, copy, modify, and distribute this software and its
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncdocumentation for any purpose and without fee is hereby granted,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncprovided that the above copyright notice appear in all copies and that
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncboth that copyright notice and this permission notice appear in
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncsupporting documentation, and that the name of Digital not be
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncused in advertising or publicity pertaining to distribution of the
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncsoftware without specific, written prior permission.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsyncSOFTWARE.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync*/
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#ifndef CMAPSTRUCT_H
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#define CMAPSTRUCT_H 1
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "colormap.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "screenint.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#include "privates.h"
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* Shared color -- the color is used by AllocColorPlanes */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short color;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync short refcnt;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} SHAREDCOLOR;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * use the first value (called red) in the structure. What channel they
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * are really talking about depends on which map they are in. */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync unsigned short red, green, blue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} LOCO;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * DirectColor maps always use the first value (called red) in the structure.
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * What channel they are really talking about depends on which map they
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * are in. */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync SHAREDCOLOR *red, *green, *blue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} SHCO;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* color map entry */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct _CMEntry {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync union {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync LOCO local;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync SHCO shco;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync } co;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync short refcnt;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Bool fShared;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} Entry;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * only needs one cell table, we arbitrarily pick red. We keep track
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * of that table with freeRed, numPixelsRed, and clientPixelsRed */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsynctypedef struct _ColormapRec {
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync VisualPtr pVisual;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync short class; /* PseudoColor or DirectColor */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync XID mid; /* client's name for colormap */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync ScreenPtr pScreen; /* screen map is associated with */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync short flags; /* 1 = IsDefault
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync * 2 = AllAllocated */
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int freeRed;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int freeGreen;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int freeBlue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *numPixelsRed;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *numPixelsGreen;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync int *numPixelsBlue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Pixel **clientPixelsRed;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Pixel **clientPixelsGreen;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Pixel **clientPixelsBlue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Entry *red;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Entry *green;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync Entry *blue;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync PrivateRec *devPrivates;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync} ColormapRec;
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync
a3f3701cea1ba388e7c877955252bb7375eedebdvboxsync#endif /* COLORMAP_H */