aboutsummaryrefslogtreecommitdiff
path: root/src/Color.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-26 15:57:11 (GMT)
committerfluxgen <fluxgen>2002-11-26 15:57:11 (GMT)
commitb5acf3a78f51e9fb1503f82e2235d98694328a67 (patch)
treea003883b85909bc1e1d20d30e1e2d98f8df6e470 /src/Color.hh
parentfe2e6b32e7fd285a32d5210220e18da9abb7732f (diff)
downloadfluxbox_pavel-b5acf3a78f51e9fb1503f82e2235d98694328a67.zip
fluxbox_pavel-b5acf3a78f51e9fb1503f82e2235d98694328a67.tar.bz2
moved to FbTk
Diffstat (limited to 'src/Color.hh')
-rw-r--r--src/Color.hh73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/Color.hh b/src/Color.hh
deleted file mode 100644
index b26c575..0000000
--- a/src/Color.hh
+++ /dev/null
@@ -1,73 +0,0 @@
1// Color.hh for Fluxbox Window Manager
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@users.sourceforge.net)
3//
4// from Image.hh for Blackbox - an X11 Window manager
5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
6//
7// Permission is hereby granted, free of charge, to any person obtaining a
8// copy of this software and associated documentation files (the "Software"),
9// to deal in the Software without restriction, including without limitation
10// the rights to use, copy, modify, merge, publish, distribute, sublicense,
11// and/or sell copies of the Software, and to permit persons to whom the
12// Software is furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE.
24
25// $Id: Color.hh,v 1.3 2002/09/20 13:02:40 fluxgen Exp $
26
27#ifndef FBTK_COLOR_HH
28#define FBTK_COLOR_HH
29
30#include "NotCopyable.hh"
31
32namespace FbTk {
33/**
34 Holds rgb color and pixel value
35*/
36class Color {
37public:
38 Color();
39 explicit Color(unsigned long pixel);
40 Color(const Color &col_copy);
41 Color(unsigned char red, unsigned char green, unsigned char blue, int screen);
42 Color(const char *color_string, int screen);
43 ~Color();
44
45 bool setFromString(const char *color_string, int screen);
46 /// TODO don't like this
47 void setPixel(unsigned long pixel) { m_pixel = pixel; }
48 // TODO
49 //Color &operator = (const Color &col_copy);
50
51 bool isAllocated() const { return m_allocated; }
52 unsigned char red() const { return m_red; }
53 unsigned char green() const { return m_green; }
54 unsigned char blue() const { return m_blue; }
55 unsigned long pixel() const { return m_pixel; }
56
57private:
58 void free();
59 void copy(const Color &col);
60 void allocate(unsigned char red, unsigned char green, unsigned char blue, int screen);
61 inline void setAllocated(bool a) { m_allocated = a; }
62 void setRGB(unsigned char red, unsigned char green, unsigned char blue);
63
64
65 unsigned char m_red, m_green, m_blue;
66 unsigned long m_pixel;
67 bool m_allocated;
68 int m_screen;
69};
70
71}; // end namespace FbTk
72
73#endif // FBTK_COLOR_HH