File: color_mapper.H

package info (click to toggle)
xjig 2.4-14.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 892 kB
  • sloc: cpp: 10,177; makefile: 1,142; perl: 23
file content (40 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __color_mapper_h
#define __color_mapper_h

class ColorMapper {
	public:
		ColorMapper(Display *dpy);
		~ColorMapper();

		unsigned long alloc_color( XColor *col );
		unsigned long alloc_named_color( const char *name );
		Colormap	get_colormap()	{ return mymap; }

		Display	*GetDisplay()	{ return dpy; }

	private:
		void setup_usage();
		void free_usage();

		Display	*dpy;
		Colormap	mymap;
		int		cells;
		XColor	*colors;
};

class Port {
	public:
		Port(Display *dpy);
		~Port();

		Display		*GetDisplay()		{ return dpy; }
		ColorMapper *GetMapper()		{ return mapper; }

		unsigned long	AllocNamedColor( const char *name )
				{ return mapper->alloc_named_color( name ); }

	private:
		Display		*dpy;
		ColorMapper	*mapper;
};
#endif