StCol.c revision 1ab64890
11ab64890Smrg/* $Xorg: StCol.c,v 1.3 2000/08/17 19:44:55 cpqbld Exp $ */
21ab64890Smrg
31ab64890Smrg/*
41ab64890Smrg * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
51ab64890Smrg * 	All Rights Reserved
61ab64890Smrg *
71ab64890Smrg * This file is a component of an X Window System-specific implementation
81ab64890Smrg * of Xcms based on the TekColor Color Management System.  Permission is
91ab64890Smrg * hereby granted to use, copy, modify, sell, and otherwise distribute this
101ab64890Smrg * software and its documentation for any purpose and without fee, provided
111ab64890Smrg * that this copyright, permission, and disclaimer notice is reproduced in
121ab64890Smrg * all copies of this software and in supporting documentation.  TekColor
131ab64890Smrg * is a trademark of Tektronix, Inc.
141ab64890Smrg *
151ab64890Smrg * Tektronix makes no representation about the suitability of this software
161ab64890Smrg * for any purpose.  It is provided "as is" and with all faults.
171ab64890Smrg *
181ab64890Smrg * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
191ab64890Smrg * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
201ab64890Smrg * PARTICULAR PURPOSE.  IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
211ab64890Smrg * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
221ab64890Smrg * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
231ab64890Smrg * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
241ab64890Smrg * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
251ab64890Smrg *
261ab64890Smrg *
271ab64890Smrg *	NAME
281ab64890Smrg *		XcmsStCol.c
291ab64890Smrg *
301ab64890Smrg *	DESCRIPTION
311ab64890Smrg *		Source for XcmsStoreColor
321ab64890Smrg *
331ab64890Smrg *
341ab64890Smrg */
351ab64890Smrg/* $XFree86: xc/lib/X11/StCol.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */
361ab64890Smrg
371ab64890Smrg#ifdef HAVE_CONFIG_H
381ab64890Smrg#include <config.h>
391ab64890Smrg#endif
401ab64890Smrg#include "Xlibint.h"
411ab64890Smrg#include "Xcmsint.h"
421ab64890Smrg#include "Cv.h"
431ab64890Smrg
441ab64890Smrg
451ab64890Smrg/************************************************************************
461ab64890Smrg *									*
471ab64890Smrg *			PUBLIC ROUTINES					*
481ab64890Smrg *									*
491ab64890Smrg ************************************************************************/
501ab64890Smrg
511ab64890Smrg/*
521ab64890Smrg *	NAME
531ab64890Smrg *		XcmsStoreColor - Store Color
541ab64890Smrg *
551ab64890Smrg *	SYNOPSIS
561ab64890Smrg */
571ab64890SmrgStatus
581ab64890SmrgXcmsStoreColor(
591ab64890Smrg    Display *dpy,
601ab64890Smrg    Colormap colormap,
611ab64890Smrg    XcmsColor *pColor_in)
621ab64890Smrg/*
631ab64890Smrg *	DESCRIPTION
641ab64890Smrg *		Given a device-dependent or device-independent color
651ab64890Smrg *		specification, this routine will convert it to X RGB
661ab64890Smrg *		values then use it in a call to XStoreColor.
671ab64890Smrg *
681ab64890Smrg *	RETURNS
691ab64890Smrg *		XcmsFailure if failed;
701ab64890Smrg *		XcmsSuccess if it succeeded without gamut compression;
711ab64890Smrg *		XcmsSuccessWithCompression if it succeeded with gamut
721ab64890Smrg *			compression;
731ab64890Smrg *
741ab64890Smrg *		Since XStoreColor has no return value this routine
751ab64890Smrg *		does not return the color specification of the color actually
761ab64890Smrg *		stored.
771ab64890Smrg */
781ab64890Smrg{
791ab64890Smrg    XcmsColor tmpColor;
801ab64890Smrg
811ab64890Smrg    tmpColor = *pColor_in;
821ab64890Smrg    return(_XcmsSetGetColor(XStoreColor, dpy, colormap,
831ab64890Smrg			      &tmpColor, XcmsRGBFormat, (Bool *) NULL));
841ab64890Smrg}
85