#ifndef CODE_XCOLORSP_H
#define CODE_XCOLORSP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: Xcolors_p.h,v 1.1.1.1 1998/07/16 19:29:32 cvs Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *-----------------------------------------------------------------------
 */

#include <Xclasses/Xcolors.h>

#define PENS	11
struct ColorPens
{
	int cclass;
	int depth;
	int base_red,base_green,base_blue;	

	unsigned long Xbackground;
	unsigned long Xdarkbackground;
	unsigned long Xmarkbackground;
	unsigned long Xshinebackground;
	unsigned long Xselected;
	unsigned long Xactive;
	unsigned long Xshine;
	unsigned long Xshadow;
	unsigned long Xshine2;
	unsigned long Xshadow2;
	unsigned long Xtext;
	unsigned long Xhitext;
	unsigned long Xselectedtext;
	unsigned long Xblack;
	unsigned long Xwhite;
};

struct ColorAlloced
{
	unsigned short	red;
	unsigned short	green;
	unsigned short	blue;
	long			color;
	unsigned long	count;
};

class pXcolors
{
	friend class Xcolors;

	class Xcolors *o;
public:
	unsigned long *cols;
	unsigned long colnum;
	unsigned long colmem;
	
	struct ColorPens *ppens;

//	unsigned long getcolor(int r,int g,int b);	// black on error
	unsigned short mixr(int r);
	unsigned short mixg(int g);
	unsigned short mixb(int b);

	void set_col(unsigned long offset,char *);
	ColorPens *genPens(void);
	unsigned long get_col(unsigned long offset);

	pXcolors(void);
	~pXcolors(void);
};

#endif
