wxColour source cleaning. Corrections to 'const unsigned char' within wxColour docs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-05 16:22:44 +00:00
parent 6e21a3db8a
commit edc536d358
20 changed files with 213 additions and 182 deletions

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/cocoa/colour.h
// Purpose: wxColour class
// Author: David Elliott
// Modified by:
@@ -21,12 +21,18 @@
class WXDLLEXPORT wxColour: public wxObject
{
public:
// constructors
// ------------
// default
wxColour() { Init(); }
// from RGB
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
: m_cocoaNSColor(NULL)
{ Set(red,green,blue); }
// from packed RGB
wxColour( unsigned long colRGB )
: m_cocoaNSColor(NULL)
{ Set(colRGB); }

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/gtk/colour.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
@@ -34,10 +34,16 @@ class WXDLLIMPEXP_CORE wxColour;
class WXDLLIMPEXP_CORE wxColour: public wxGDIObject
{
public:
// constructors
// ------------
// default
wxColour() { }
// Construct from RGB
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue );
// from packed RGB
wxColour( unsigned long colRGB ) { Set(colRGB); }
// Implicit conversion from the colour name

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/gtk/colour.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
@@ -34,10 +34,16 @@ class WXDLLIMPEXP_CORE wxColour;
class WXDLLIMPEXP_CORE wxColour: public wxGDIObject
{
public:
// constructors
// ------------
// default
wxColour() { }
// Construct from RGB
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue );
// from packed RGB
wxColour( unsigned long colRGB ) { Set(colRGB); }
// Implicit conversion from the colour name

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/mac/carbon/colour.h
// Purpose: wxColour class
// Author: Stefan Csomor
// Modified by:
@@ -19,57 +19,62 @@
class WXDLLEXPORT wxColour: public wxObject
{
public:
// ctors
// constructors
// ------------
// default
wxColour() { Init(); }
// from RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
{ Set(red, green, blue); }
wxColour( unsigned long colRGB )
{ Set(colRGB); }
wxColour() { Init(); }
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
{ Set(red, green, blue); }
// from packed RGB
wxColour( unsigned long colRGB )
{ Set(colRGB); }
// implicit conversion from the colour name
wxColour( const wxString &colourName )
{ InitFromName(colourName); }
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
wxColour( const wxString &colourName )
{ InitFromName(colourName); }
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
// copy ctors and assignment operators
wxColour( const wxColour& col );
wxColour& operator = ( const wxColour& col );
wxColour( const wxColour& col );
wxColour& operator = ( const wxColour& col );
// dtor
~wxColour();
~wxColour();
// Set() functions
void Set( unsigned char red, unsigned char green, unsigned char blue );
void Set( unsigned long colRGB )
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// Set() functions
void Set( unsigned char red, unsigned char green, unsigned char blue );
void Set( unsigned long colRGB )
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// accessors
bool Ok() const {return m_isInit; }
// accessors
bool Ok() const {return m_isInit; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
// comparison
bool operator == (const wxColour& colour) const
{
return (m_isInit == colour.m_isInit
&& m_red == colour.m_red
&& m_green == colour.m_green
&& m_blue == colour.m_blue);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }
// comparison
bool operator == (const wxColour& colour) const
{
return (m_isInit == colour.m_isInit
&& m_red == colour.m_red
&& m_green == colour.m_green
&& m_blue == colour.m_blue);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }
const WXCOLORREF& GetPixel() const { return m_pixel; };
const WXCOLORREF& GetPixel() const { return m_pixel; };
void InitFromName(const wxString& col);
@@ -79,17 +84,17 @@ protected :
void Init();
private:
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
public:
WXCOLORREF m_pixel ;
void Set( const WXCOLORREF* color ) ;
WXCOLORREF m_pixel ;
void Set( const WXCOLORREF* color ) ;
private:
DECLARE_DYNAMIC_CLASS(wxColour)
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/mac/classic/colour.h
// Purpose: wxColour class
// Author: Stefan Csomor
// Modified by:
@@ -19,58 +19,63 @@
class WXDLLEXPORT wxColour: public wxObject
{
public:
// ctors
// constructors
// ------------
// default
wxColour() { Init(); }
// from RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
{ Set(red, green, blue); }
wxColour( unsigned long colRGB )
{ Set(colRGB); }
wxColour() { Init(); }
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
{ Set(red, green, blue); }
// from packed RGB
wxColour( unsigned long colRGB )
{ Set(colRGB); }
// implicit conversion from the colour name
wxColour( const wxString &colourName )
{ InitFromName(colourName); }
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
wxColour( const wxString &colourName )
{ InitFromName(colourName); }
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
// copy ctors and assignment operators
wxColour( const wxColour& col );
wxColour( const wxColour* col );
wxColour& operator = ( const wxColour& col );
wxColour( const wxColour& col );
wxColour( const wxColour* col );
wxColour& operator = ( const wxColour& col );
// dtor
~wxColour();
~wxColour();
// Set() functions
void Set( unsigned char red, unsigned char green, unsigned char blue );
void Set( unsigned long colRGB )
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// Set() functions
void Set( unsigned char red, unsigned char green, unsigned char blue );
void Set( unsigned long colRGB )
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// accessors
bool Ok() const {return m_isInit; }
// accessors
bool Ok() const {return m_isInit; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
// comparison
bool operator == (const wxColour& colour) const
{
return (m_isInit == colour.m_isInit
&& m_red == colour.m_red
&& m_green == colour.m_green
&& m_blue == colour.m_blue);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }
// comparison
bool operator == (const wxColour& colour) const
{
return (m_isInit == colour.m_isInit
&& m_red == colour.m_red
&& m_green == colour.m_green
&& m_blue == colour.m_blue);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }
const WXCOLORREF& GetPixel() const { return m_pixel; };
const WXCOLORREF& GetPixel() const { return m_pixel; };
void InitFromName(const wxString& col);
@@ -80,17 +85,17 @@ protected :
void Init();
private:
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
public:
WXCOLORREF m_pixel ;
void Set( const WXCOLORREF* color ) ;
WXCOLORREF m_pixel ;
void Set( const WXCOLORREF* color ) ;
private:
DECLARE_DYNAMIC_CLASS(wxColour)
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/mgl/colour.h
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
@@ -18,35 +18,40 @@
class WXDLLEXPORT wxColour: public wxObject
{
public:
// ctors
// default
// constructors
// ------------
// default
wxColour();
// from RGB
// from separate RGB
wxColour(unsigned char red, unsigned char green, unsigned char blue)
{ Set(red, green, blue); }
// from packed RGB
wxColour(unsigned long colRGB) { Set(colRGB); }
// implicit conversion from the colour name
// implicit conversion from the colour name
wxColour(const wxString &colourName) { InitFromName(colourName); }
wxColour(const char *colourName) { InitFromName(colourName); }
// copy ctors and assignment operators
// copy ctors and assignment operators
wxColour(const wxColour& col);
wxColour& operator = (const wxColour& col);
// dtor
// dtor
~wxColour();
// Set() functions
void Set(unsigned char red, unsigned char green, unsigned char blue);
void Set(unsigned long colRGB)
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// accessors
@@ -59,10 +64,10 @@ public:
// comparison
bool operator == (const wxColour& colour) const
{
return (m_red == colour.m_red &&
m_green == colour.m_green &&
m_blue == colour.m_blue &&
m_isInit == colour.m_isInit);
return (m_red == colour.m_red &&
m_green == colour.m_green &&
m_blue == colour.m_blue &&
m_isInit == colour.m_isInit);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }

View File

@@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/motif/colour.h
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_
@@ -20,12 +20,17 @@ class WXDLLEXPORT wxColour : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxColour)
public:
// ctors
// constructors
// ------------
// default
wxColour();
// from RGB
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue )
{ Set(red, green, blue); }
// from packed RGB
wxColour( unsigned long colRGB ) { Set(colRGB); }
// implicit conversion from the colour name

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/os2/colour.h
// Purpose: wxColour class
// Author: David Webster
// Modified by:
@@ -18,56 +18,36 @@
class WXDLLEXPORT wxColour: public wxObject
{
public:
//
// Ctors
//
// constructors
// ------------
//
// Default
//
// default
wxColour();
//
// from RGB
//
wxColour( unsigned char cRed
,unsigned char cGreen
,unsigned char cBlue
);
// from separate RGB
wxColour( unsigned char cRed, unsigned char cGreen, unsigned char cBlue );
// from packed RGB
wxColour( unsigned long colRGB ) { Set(colRGB); }
//
// Implicit conversion from the colour name
//
wxColour(const wxString& rColourName) { InitFromName(rColourName); }
wxColour(const wxChar *zColourName) { InitFromName(zColourName); }
//
// Copy ctors and assignment operators
//
wxColour(const wxColour& rCol);
wxColour(const wxColour* pCol);
wxColour&operator = (const wxColour& rCol);
//
// Dtor
//
~wxColour();
//
// Set functions
//
void Set( unsigned char cRed
,unsigned char cGreen
,unsigned char cBlue
);
void Set(unsigned long lColRGB)
void Set( unsigned char cRed, unsigned char cGreen, unsigned char cBlue);
void Set( unsigned long lColRGB)
{
//
// We don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
//
Set( (unsigned char)lColRGB
,(unsigned char)(lColRGB >> 8)
,(unsigned char)(lColRGB >> 16)
@@ -78,18 +58,14 @@ public:
InitFromName(rsColour);
}
//
// Accessors
//
bool Ok(void) const {return m_bIsInit; }
unsigned char Red(void) const { return m_cRed; }
unsigned char Green(void) const { return m_cGreen; }
unsigned char Blue(void) const { return m_cBlue; }
//
// Comparison
//
bool operator == (const wxColour& rColour) const
{
return (m_bIsInit == rColour.m_bIsInit
@@ -118,7 +94,7 @@ private:
public:
WXCOLORREF m_vPixel ;
private:
DECLARE_DYNAMIC_CLASS(wxColour)
DECLARE_DYNAMIC_CLASS(wxColour)
}; // end of class wxColour
#endif

View File

@@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Name: wx/x11/colour.h
// Purpose: wxColour class
// Author: Julian Smart, Robert Roebling
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_
@@ -36,10 +36,16 @@ class WXDLLIMPEXP_CORE wxColour;
class WXDLLEXPORT wxColour: public wxGDIObject
{
public:
// constructors
// ------------
// default
wxColour() { }
// Construct from RGB
// from separate RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue );
// from packed RGB
wxColour( unsigned long colRGB ) { Set(colRGB); }
// Implicit conversion from the colour name
@@ -97,4 +103,3 @@ private:
#endif
// _WX_COLOUR_H_