From 344bd1d00ac69ad073b83269fd57787a23e305e5 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 23 Feb 2003 01:09:20 +0000 Subject: using short instead of char --- src/FbTk/Color.cc | 8 ++++---- src/FbTk/Color.hh | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc index 44cd1bb..0cfa481 100644 --- a/src/FbTk/Color.cc +++ b/src/FbTk/Color.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Color.cc,v 1.3 2002/12/01 13:42:14 rathnor Exp $ +// $Id: Color.cc,v 1.4 2003/02/23 01:09:20 fluxgen Exp $ #include "Color.hh" @@ -50,7 +50,7 @@ Color::Color(const Color &col_copy) { copy(col_copy); } -Color::Color(unsigned char red, unsigned char green, unsigned char blue, int screen): +Color::Color(unsigned short red, unsigned short green, unsigned short blue, int screen): m_red(red), m_green(green), m_blue(blue), m_pixel(0), m_allocated(false), m_screen(screen) { @@ -138,7 +138,7 @@ void Color::copy(const Color &col_copy) { } -void Color::allocate(unsigned char red, unsigned char green, unsigned char blue, int screen) { +void Color::allocate(unsigned short red, unsigned short green, unsigned short blue, int screen) { Display *disp = App::instance()->display(); XColor color; @@ -161,7 +161,7 @@ void Color::allocate(unsigned char red, unsigned char green, unsigned char blue, m_screen = screen; } -void Color::setRGB(unsigned char red, unsigned char green, unsigned char blue) { +void Color::setRGB(unsigned short red, unsigned short green, unsigned short blue) { m_red = red; m_green = green; m_blue = blue; diff --git a/src/FbTk/Color.hh b/src/FbTk/Color.hh index d96db8d..e54512c 100644 --- a/src/FbTk/Color.hh +++ b/src/FbTk/Color.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Color.hh,v 1.2 2002/12/01 13:42:14 rathnor Exp $ +// $Id: Color.hh,v 1.3 2003/02/23 01:09:02 fluxgen Exp $ #ifndef FBTK_COLOR_HH #define FBTK_COLOR_HH @@ -38,7 +38,7 @@ public: Color(); explicit Color(unsigned long pixel); Color(const Color &col_copy); - Color(unsigned char red, unsigned char green, unsigned char blue, int screen); + Color(unsigned short red, unsigned short green, unsigned short blue, int screen); Color(const char *color_string, int screen); ~Color(); @@ -49,20 +49,21 @@ public: //Color &operator = (const Color &col_copy); bool isAllocated() const { return m_allocated; } - unsigned char red() const { return m_red; } - unsigned char green() const { return m_green; } - unsigned char blue() const { return m_blue; } + unsigned short red() const { return m_red; } + unsigned short green() const { return m_green; } + unsigned short blue() const { return m_blue; } unsigned long pixel() const { return m_pixel; } private: void free(); void copy(const Color &col); - void allocate(unsigned char red, unsigned char green, unsigned char blue, int screen); + void allocate(unsigned short red, unsigned short green, + unsigned short blue, int screen); inline void setAllocated(bool a) { m_allocated = a; } - void setRGB(unsigned char red, unsigned char green, unsigned char blue); + void setRGB(unsigned short red, unsigned short green, unsigned short blue); - unsigned char m_red, m_green, m_blue; + unsigned short m_red, m_green, m_blue; unsigned long m_pixel; bool m_allocated; int m_screen; -- cgit v0.11.2