From 46562151eb21235344768ea4b53c204d0c03fcee Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 4 Oct 2005 16:13:42 +0000 Subject: [PATCH] wxBrush::SetColour and wxPen::SetColour unified. Source cleaning. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/pen.tex | 17 ++++++--- include/wx/cocoa/brush.h | 10 +++--- include/wx/cocoa/pen.h | 4 +-- include/wx/gtk/brush.h | 4 +-- include/wx/gtk/pen.h | 16 ++++----- include/wx/gtk1/brush.h | 4 +-- include/wx/gtk1/pen.h | 16 ++++----- include/wx/mac/carbon/brush.h | 6 ++-- include/wx/mac/carbon/pen.h | 4 +-- include/wx/mac/classic/brush.h | 4 +-- include/wx/mac/classic/pen.h | 4 +-- include/wx/mgl/brush.h | 4 +-- include/wx/mgl/pen.h | 8 ++--- include/wx/msw/brush.h | 2 +- include/wx/msw/pen.h | 5 ++- include/wx/os2/brush.h | 21 +++++------ include/wx/os2/pen.h | 7 ++-- include/wx/palmos/brush.h | 2 +- include/wx/palmos/pen.h | 5 ++- include/wx/x11/brush.h | 4 +-- include/wx/x11/pen.h | 18 +++++----- src/cocoa/brush.mm | 5 ++- src/cocoa/pen.mm | 17 +++++---- src/gtk/brush.cpp | 25 +++++++------ src/gtk/pen.cpp | 37 ++++++++++--------- src/gtk1/brush.cpp | 25 +++++++------ src/gtk1/pen.cpp | 37 ++++++++++--------- src/mac/carbon/brush.cpp | 66 +++++++++++++++++----------------- src/mac/carbon/pen.cpp | 50 +++++++++++++------------- src/mac/classic/brush.cpp | 64 ++++++++++++++++----------------- src/mac/classic/pen.cpp | 50 +++++++++++++------------- src/mgl/brush.cpp | 29 ++++++++------- src/mgl/pen.cpp | 25 +++++++------ src/msw/brush.cpp | 4 +-- src/msw/pen.cpp | 5 ++- src/os2/brush.cpp | 27 +++++--------- src/os2/pen.cpp | 20 ++++------- src/palmos/brush.cpp | 6 ++-- src/palmos/pen.cpp | 3 +- src/x11/brush.cpp | 2 +- src/x11/pen.cpp | 2 +- 41 files changed, 313 insertions(+), 351 deletions(-) diff --git a/docs/latex/wx/pen.tex b/docs/latex/wx/pen.tex index e3e759d5af..ec2a6a36e6 100644 --- a/docs/latex/wx/pen.tex +++ b/docs/latex/wx/pen.tex @@ -1,8 +1,19 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: pen.tex +%% Purpose: wxPen docs +%% Author: +%% Modified by: +%% Created: +%% RCS-ID: $Id$ +%% Copyright: (c) wxWidgets +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \section{\class{wxPen}}\label{wxpen} A pen is a drawing tool for drawing outlines. It is used for drawing lines and painting the outline of rectangles, ellipses, etc. It has a -colour, a width and a style. +colour, a width and a style. \wxheading{Derived from} @@ -251,7 +262,7 @@ Sets the pen cap style, which may be one of {\bf wxCAP\_ROUND}, {\bf wxCAP\_PROJ \func{void}{SetColour}{\param{const wxString\& }{colourName}} -\func{void}{SetColour}{\param{int}{ red}, \param{int}{ green}, \param{int}{ blue}} +\func{void}{SetColour}{\param{const unsigned char}{ red}, \param{const unsigned char}{ green}, \param{const unsigned char}{ blue}} The pen's colour is changed to the given colour. @@ -412,5 +423,3 @@ to the pen list, and returns it. \func{void}{RemovePen}{\param{wxPen*}{ pen}} Used by wxWidgets to remove a pen from the list. - - diff --git a/include/wx/cocoa/brush.h b/include/wx/cocoa/brush.h index 728a0ab2de..d3655e5146 100644 --- a/include/wx/cocoa/brush.h +++ b/include/wx/cocoa/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/cocoa/brush.h +// Name: wx/cocoa/brush.h // Purpose: wxBrush class // Author: David Elliott // Modified by: @@ -39,10 +39,10 @@ public: // ------------------------------------------------------------------------ // Implementation // ------------------------------------------------------------------------ - virtual void SetColour(const wxColour& col) ; - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; - virtual void SetStyle(int style) ; - virtual void SetStipple(const wxBitmap& stipple) ; + virtual void SetColour(const wxColour& col) ; + virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; + virtual void SetStyle(int style) ; + virtual void SetStipple(const wxBitmap& stipple) ; // assignment wxBrush& operator = (const wxBrush& brush) diff --git a/include/wx/cocoa/pen.h b/include/wx/cocoa/pen.h index 6608e2c978..2b71f91e0c 100644 --- a/include/wx/cocoa/pen.h +++ b/include/wx/cocoa/pen.h @@ -6,7 +6,7 @@ // Created: 2003/08/02 (stubs from 22.03.2003) // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_COCOA_PEN_H__ @@ -47,7 +47,7 @@ public: virtual bool Ok() const { return (m_refData != NULL) ; } void SetColour(const wxColour& col) ; - void SetColour(unsigned char r, unsigned char g, unsigned char b) ; + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; void SetWidth(int width); void SetStyle(int style); diff --git a/include/wx/gtk/brush.h b/include/wx/gtk/brush.h index 70654a77a3..2e46a0a9a4 100644 --- a/include/wx/gtk/brush.h +++ b/include/wx/gtk/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/gtk/brush.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -51,7 +51,7 @@ public: wxBitmap *GetStipple() const; void SetColour( const wxColour& col ); - void SetColour( unsigned char r, unsigned char g, unsigned char b ); + void SetColour( const unsigned char r, const unsigned char g, const unsigned char b ); void SetStyle( int style ); void SetStipple( const wxBitmap& stipple ); diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index ccb8369703..17dd2ab6b3 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -36,28 +36,28 @@ class WXDLLIMPEXP_CORE wxPen: public wxGDIObject { public: wxPen() { } - + wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); ~wxPen(); - + wxPen( const wxPen& pen ) : wxGDIObject() { Ref(pen); } wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } - + bool Ok() const { return m_refData != NULL; } - + bool operator == ( const wxPen& pen ) const; bool operator != (const wxPen& pen) const { return !(*this == pen); } void SetColour( const wxColour &colour ); - void SetColour( int red, int green, int blue ); + void SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ); void SetCap( int capStyle ); void SetJoin( int joinStyle ); void SetStyle( int style ); void SetWidth( int width ); void SetDashes( int number_of_dashes, const wxDash *dash ); - + wxColour &GetColour() const; int GetCap() const; int GetJoin() const; @@ -67,11 +67,11 @@ public: int GetDashCount() const; wxDash* GetDash() const; -private: +private: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - + DECLARE_DYNAMIC_CLASS(wxPen) }; diff --git a/include/wx/gtk1/brush.h b/include/wx/gtk1/brush.h index 70654a77a3..2e46a0a9a4 100644 --- a/include/wx/gtk1/brush.h +++ b/include/wx/gtk1/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/gtk/brush.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -51,7 +51,7 @@ public: wxBitmap *GetStipple() const; void SetColour( const wxColour& col ); - void SetColour( unsigned char r, unsigned char g, unsigned char b ); + void SetColour( const unsigned char r, const unsigned char g, const unsigned char b ); void SetStyle( int style ); void SetStipple( const wxBitmap& stipple ); diff --git a/include/wx/gtk1/pen.h b/include/wx/gtk1/pen.h index ccb8369703..17dd2ab6b3 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -36,28 +36,28 @@ class WXDLLIMPEXP_CORE wxPen: public wxGDIObject { public: wxPen() { } - + wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); ~wxPen(); - + wxPen( const wxPen& pen ) : wxGDIObject() { Ref(pen); } wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } - + bool Ok() const { return m_refData != NULL; } - + bool operator == ( const wxPen& pen ) const; bool operator != (const wxPen& pen) const { return !(*this == pen); } void SetColour( const wxColour &colour ); - void SetColour( int red, int green, int blue ); + void SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ); void SetCap( int capStyle ); void SetJoin( int joinStyle ); void SetStyle( int style ); void SetWidth( int width ); void SetDashes( int number_of_dashes, const wxDash *dash ); - + wxColour &GetColour() const; int GetCap() const; int GetJoin() const; @@ -67,11 +67,11 @@ public: int GetDashCount() const; wxDash* GetDash() const; -private: +private: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - + DECLARE_DYNAMIC_CLASS(wxPen) }; diff --git a/include/wx/mac/carbon/brush.h b/include/wx/mac/carbon/brush.h index 2bdfa0fb13..e2e180c4d4 100644 --- a/include/wx/mac/carbon/brush.h +++ b/include/wx/mac/carbon/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/mac/carbon/brush.h // Purpose: wxBrush class // Author: Stefan Csomor // Modified by: @@ -40,8 +40,8 @@ public: { Ref(brush); } ~wxBrush(); - virtual void SetColour(const wxColour& col) ; - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; + virtual void SetColour(const wxColour& col) ; + virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; virtual void SetStyle(int style) ; virtual void SetStipple(const wxBitmap& stipple) ; virtual void MacSetTheme(short macThemeBrush) ; diff --git a/include/wx/mac/carbon/pen.h b/include/wx/mac/carbon/pen.h index a6055de188..b1032c2fb7 100644 --- a/include/wx/mac/carbon/pen.h +++ b/include/wx/mac/carbon/pen.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/pen.h +// Name: wx/mac/carbon/pen.h // Purpose: wxPen class // Author: Stefan Csomor // Modified by: @@ -65,7 +65,7 @@ public: // Override in order to recreate the pen void SetColour(const wxColour& col) ; - void SetColour(unsigned char r, unsigned char g, unsigned char b) ; + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; void SetWidth(int width) ; void SetStyle(int style) ; diff --git a/include/wx/mac/classic/brush.h b/include/wx/mac/classic/brush.h index 51cf58939c..f2535ac5f2 100644 --- a/include/wx/mac/classic/brush.h +++ b/include/wx/mac/classic/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/mac/classic/brush.h // Purpose: wxBrush class // Author: Stefan Csomor // Modified by: @@ -41,7 +41,7 @@ public: ~wxBrush(); virtual void SetColour(const wxColour& col) ; - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; + virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; virtual void SetStyle(int style) ; virtual void SetStipple(const wxBitmap& stipple) ; virtual void SetMacTheme(short macThemeBrush) ; diff --git a/include/wx/mac/classic/pen.h b/include/wx/mac/classic/pen.h index a6055de188..cac09f1310 100644 --- a/include/wx/mac/classic/pen.h +++ b/include/wx/mac/classic/pen.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/pen.h +// Name: wx/mac/classic/pen.h // Purpose: wxPen class // Author: Stefan Csomor // Modified by: @@ -65,7 +65,7 @@ public: // Override in order to recreate the pen void SetColour(const wxColour& col) ; - void SetColour(unsigned char r, unsigned char g, unsigned char b) ; + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; void SetWidth(int width) ; void SetStyle(int style) ; diff --git a/include/wx/mgl/brush.h b/include/wx/mgl/brush.h index f9ac95c4f1..c419a9f5ae 100644 --- a/include/wx/mgl/brush.h +++ b/include/wx/mgl/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/mgl/brush.h // Purpose: // Author: Vaclav Slavik // Id: $Id$ @@ -45,7 +45,7 @@ public: wxBitmap *GetStipple() const; void SetColour(const wxColour& col); - void SetColour(unsigned char r, unsigned char g, unsigned char b); + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b); void SetStyle(int style); void SetStipple(const wxBitmap& stipple); diff --git a/include/wx/mgl/pen.h b/include/wx/mgl/pen.h index 0892b45b43..a4f59afc5b 100644 --- a/include/wx/mgl/pen.h +++ b/include/wx/mgl/pen.h @@ -40,14 +40,14 @@ public: bool operator != (const wxPen& pen) const; void SetColour(const wxColour &colour); - void SetColour(int red, int green, int blue); + void SetColour(const unsigned char red, const unsigned char green, const unsigned char blue); void SetCap(int capStyle); void SetJoin(int joinStyle); void SetStyle(int style); void SetWidth(int width); void SetDashes(int number_of_dashes, const wxDash *dash); void SetStipple(const wxBitmap& stipple); - + wxColour &GetColour() const; int GetCap() const; int GetJoin() const; @@ -57,7 +57,7 @@ public: int GetDashCount() const; wxDash* GetDash() const; wxBitmap *GetStipple() const; - + bool Ok() const; // implementation: @@ -68,7 +68,7 @@ protected: virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; -private: +private: DECLARE_DYNAMIC_CLASS(wxPen) }; diff --git a/include/wx/msw/brush.h b/include/wx/msw/brush.h index 22784809f2..4452e29c24 100644 --- a/include/wx/msw/brush.h +++ b/include/wx/msw/brush.h @@ -32,7 +32,7 @@ public: virtual ~wxBrush(); virtual void SetColour(const wxColour& col); - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b); + virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b); virtual void SetStyle(int style); virtual void SetStipple(const wxBitmap& stipple); diff --git a/include/wx/msw/pen.h b/include/wx/msw/pen.h index c37c0e9433..b5439e8bdf 100644 --- a/include/wx/msw/pen.h +++ b/include/wx/msw/pen.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/pen.h +// Name: wx/msw/pen.h // Purpose: wxPen class // Author: Julian Smart // Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=() @@ -102,7 +102,7 @@ public: // Override in order to recreate the pen void SetColour(const wxColour& col); - void SetColour(unsigned char r, unsigned char g, unsigned char b); + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b); void SetWidth(int width); void SetStyle(int style); @@ -138,4 +138,3 @@ private: }; #endif // _WX_PEN_H_ - diff --git a/include/wx/os2/brush.h b/include/wx/os2/brush.h index 365a4a0575..71661f2277 100644 --- a/include/wx/os2/brush.h +++ b/include/wx/os2/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/os2/brush.h // Purpose: wxBrush class // Author: David Webster // Modified by: @@ -27,11 +27,11 @@ public: ~wxBrushRefData(); protected: - int m_nStyle; - wxBitmap m_vStipple ; - wxColour m_vColour; - WXHBRUSH m_hBrush; // in OS/2 GPI this will be the PS the pen is associated with - AREABUNDLE m_vBundle; + int m_nStyle; + wxBitmap m_vStipple ; + wxColour m_vColour; + WXHBRUSH m_hBrush; // in OS/2 GPI this will be the PS the pen is associated with + AREABUNDLE m_vBundle; }; #define M_BRUSHDATA ((wxBrushRefData *)m_refData) @@ -43,9 +43,7 @@ class WXDLLEXPORT wxBrush: public wxBrushBase public: wxBrush(); - wxBrush( const wxColour& rCol - ,int nStyle = wxSOLID - ); + wxBrush(const wxColour& rCol, int nStyle = wxSOLID); wxBrush(const wxBitmap& rStipple); inline wxBrush(const wxBrush& rBrush) { Ref(rBrush); } ~wxBrush(); @@ -55,10 +53,7 @@ public: inline bool operator != (const wxBrush& rBrush) const { return m_refData != rBrush.m_refData; } virtual void SetColour(const wxColour& rColour); - virtual void SetColour( unsigned char cRed - ,unsigned char cGreen - ,unsigned char cBrush - ); + virtual void SetColour(const unsigned char cRed, const unsigned char cGreen, const unsigned char cBrush); virtual void SetPS(HPS hPS); virtual void SetStyle(int nStyle) ; virtual void SetStipple(const wxBitmap& rStipple); diff --git a/include/wx/os2/pen.h b/include/wx/os2/pen.h index fe4c3460ef..a2b65cb6b9 100644 --- a/include/wx/os2/pen.h +++ b/include/wx/os2/pen.h @@ -68,10 +68,7 @@ public: // Override in order to recreate the pen // void SetColour(const wxColour& rColour); - void SetColour( unsigned char cRed - ,unsigned char cGreen - ,unsigned char cBlue - ); + void SetColour(const unsigned char cRed, const unsigned char cGreen, const unsigned char cBlue); void SetWidth(int nWidth); void SetStyle(int nStyle); @@ -100,7 +97,7 @@ public: // Useful helper: create the brush resource // bool RealizeResource(void); - bool FreeResource(bool bForce = FALSE); + bool FreeResource(bool bForce = false); WXHANDLE GetResourceHandle(void); bool IsFree(void) const; void Unshare(void); diff --git a/include/wx/palmos/brush.h b/include/wx/palmos/brush.h index 37b4f2388f..a831ebda8c 100644 --- a/include/wx/palmos/brush.h +++ b/include/wx/palmos/brush.h @@ -32,7 +32,7 @@ public: virtual ~wxBrush(); virtual void SetColour(const wxColour& col); - virtual void SetColour(unsigned char r, unsigned char g, unsigned char b); + virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b); virtual void SetStyle(int style); virtual void SetStipple(const wxBitmap& stipple); diff --git a/include/wx/palmos/pen.h b/include/wx/palmos/pen.h index 80c3c3f0d6..bb4b023a8b 100644 --- a/include/wx/palmos/pen.h +++ b/include/wx/palmos/pen.h @@ -102,7 +102,7 @@ public: // Override in order to recreate the pen void SetColour(const wxColour& col); - void SetColour(unsigned char r, unsigned char g, unsigned char b); + void SetColour(const unsigned char r, const unsigned char g, const unsigned char b); void SetWidth(int width); void SetStyle(int style); @@ -128,7 +128,7 @@ public: // Internal bool RealizeResource(); - bool FreeResource(bool force = FALSE); + bool FreeResource(bool force = false); WXHANDLE GetResourceHandle() const; bool IsFree() const; void Unshare(); @@ -138,4 +138,3 @@ private: }; #endif // _WX_PEN_H_ - diff --git a/include/wx/x11/brush.h b/include/wx/x11/brush.h index b5a61ad396..95629e88cb 100644 --- a/include/wx/x11/brush.h +++ b/include/wx/x11/brush.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.h +// Name: wx/x11/brush.h // Purpose: wxBrush class // Author: Julian Smart, Robert Roebling // Modified by: @@ -48,7 +48,7 @@ public: wxBitmap *GetStipple() const; void SetColour( const wxColour& col ); - void SetColour( unsigned char r, unsigned char g, unsigned char b ); + void SetColour( const unsigned char r, const unsigned char g, const unsigned char b ); void SetStyle( int style ); void SetStipple( const wxBitmap& stipple ); diff --git a/include/wx/x11/pen.h b/include/wx/x11/pen.h index 5206da4978..40f0ccf341 100644 --- a/include/wx/x11/pen.h +++ b/include/wx/x11/pen.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.h +// Name: wx/x11/pen.h // Purpose: wxPen 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_PEN_H_ @@ -33,21 +33,21 @@ class WXDLLIMPEXP_CORE wxPen: public wxGDIObject { public: wxPen() { } - + wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); wxPen( const wxBitmap &stipple, int width ); ~wxPen(); - + wxPen( const wxPen& pen ) { Ref(pen); } wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } - + bool Ok() const { return m_refData != NULL; } - + bool operator == ( const wxPen& pen ) const; bool operator != (const wxPen& pen) const { return !(*this == pen); } void SetColour( const wxColour &colour ); - void SetColour( int red, int green, int blue ); + void SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ); void SetCap( int capStyle ); void SetJoin( int joinStyle ); void SetStyle( int style ); @@ -65,11 +65,11 @@ public: wxDash* GetDash() const; wxBitmap* GetStipple() const; -private: +private: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - + DECLARE_DYNAMIC_CLASS(wxPen) }; diff --git a/src/cocoa/brush.mm b/src/cocoa/brush.mm index 3e24adc742..eeafeff7e8 100644 --- a/src/cocoa/brush.mm +++ b/src/cocoa/brush.mm @@ -6,7 +6,7 @@ // Created: 2003/07/03 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -173,7 +173,7 @@ void wxBrush::SetColour(const wxColour& col) M_BRUSHDATA->SetColour(col); } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { AllocExclusive(); M_BRUSHDATA->SetColour(wxColour(r,g,b)); @@ -215,4 +215,3 @@ WX_NSColor wxBrush::GetNSColor() return [NSColor clearColor]; return M_BRUSHDATA->GetNSColor(); } - diff --git a/src/cocoa/pen.mm b/src/cocoa/pen.mm index 2ab4e00e28..b82e879cad 100644 --- a/src/cocoa/pen.mm +++ b/src/cocoa/pen.mm @@ -6,7 +6,7 @@ // Created: 2003/08/02 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -303,7 +303,7 @@ void wxPen::SetColour(const wxColour& col) M_PENDATA->SetColour(col); } -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { AllocExclusive(); M_PENDATA->SetColour(wxColour(r, g, b)); @@ -323,27 +323,27 @@ void wxPen::SetStipple(const wxBitmap& Stipple) wxColour& wxPen::GetColour() const { - return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); + return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); } int wxPen::GetWidth() const { - return (M_PENDATA ? M_PENDATA->m_width : 0); + return (M_PENDATA ? M_PENDATA->m_width : 0); } int wxPen::GetStyle() const { - return (M_PENDATA ? M_PENDATA->m_style : 0); + return (M_PENDATA ? M_PENDATA->m_style : 0); } int wxPen::GetJoin() const { - return (M_PENDATA ? M_PENDATA->m_join : 0); + return (M_PENDATA ? M_PENDATA->m_join : 0); } int wxPen::GetCap() const { - return (M_PENDATA ? M_PENDATA->m_cap : 0); + return (M_PENDATA ? M_PENDATA->m_cap : 0); } int wxPen::GetDashes(wxDash **ptr) const @@ -353,7 +353,7 @@ int wxPen::GetDashes(wxDash **ptr) const wxBitmap *wxPen::GetStipple() const { - return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); + return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); } WX_NSColor wxPen::GetNSColor() @@ -369,4 +369,3 @@ int wxPen::GetCocoaLineDash(const float **pattern) *pattern = NULL; return 0; } - diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index f3278719ca..f2237b0a66 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -26,7 +26,7 @@ public: { m_style = 0; } - + wxBrushRefData( const wxBrushRefData& data ) : wxObjectRefData() { @@ -34,14 +34,14 @@ public: m_stipple = data.m_stipple; m_colour = data.m_colour; } - + bool operator == (const wxBrushRefData& data) const { return (m_style == data.m_style && m_stipple == data.m_stipple && m_colour == data.m_colour); } - + int m_style; wxColour m_colour; wxBitmap m_stipple; @@ -90,10 +90,10 @@ wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const bool wxBrush::operator == ( const wxBrush& brush ) const { - if (m_refData == brush.m_refData) return TRUE; - - if (!m_refData || !brush.m_refData) return FALSE; - + if (m_refData == brush.m_refData) return true; + + if (!m_refData || !brush.m_refData) return false; + return ( *(wxBrushRefData*)m_refData == *(wxBrushRefData*)brush.m_refData ); } @@ -133,28 +133,28 @@ wxBitmap *wxBrush::GetStipple() const void wxBrush::SetColour( const wxColour& col ) { AllocExclusive(); - + M_BRUSHDATA->m_colour = col; } -void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b ) +void wxBrush::SetColour( const unsigned char r, const unsigned char g, const unsigned char b ) { AllocExclusive(); - + M_BRUSHDATA->m_colour.Set( r, g, b ); } void wxBrush::SetStyle( int style ) { AllocExclusive(); - + M_BRUSHDATA->m_style = style; } void wxBrush::SetStipple( const wxBitmap& stipple ) { AllocExclusive(); - + M_BRUSHDATA->m_stipple = stipple; if (M_BRUSHDATA->m_stipple.GetMask()) { @@ -165,4 +165,3 @@ void wxBrush::SetStipple( const wxBitmap& stipple ) M_BRUSHDATA->m_style = wxSTIPPLE; } } - diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index 721b850a9f..cecc379b85 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/gtk/pen.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -31,7 +31,7 @@ public: m_dash = (wxGTKDash*) NULL; m_countDashes = 0; } - + wxPenRefData( const wxPenRefData& data ) : wxObjectRefData() { @@ -47,19 +47,19 @@ public: bool operator == (const wxPenRefData& data) const { if ( m_countDashes != data.m_countDashes ) - return FALSE; + return false; if ( m_dash ) { if ( !data.m_dash || memcmp(m_dash, data.m_dash, m_countDashes*sizeof(wxGTKDash)) ) { - return FALSE; + return false; } } else if ( data.m_dash ) { - return FALSE; + return false; } @@ -69,7 +69,7 @@ public: m_capStyle == data.m_capStyle && m_colour == data.m_colour; } - + int m_width; int m_style; int m_joinStyle; @@ -110,60 +110,60 @@ wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const bool wxPen::operator == ( const wxPen& pen ) const { - if (m_refData == pen.m_refData) return TRUE; - - if (!m_refData || !pen.m_refData) return FALSE; - + if (m_refData == pen.m_refData) return true; + + if (!m_refData || !pen.m_refData) return false; + return ( *(wxPenRefData*)m_refData == *(wxPenRefData*)pen.m_refData ); } void wxPen::SetColour( const wxColour &colour ) { AllocExclusive(); - + M_PENDATA->m_colour = colour; } void wxPen::SetDashes( int number_of_dashes, const wxDash *dash ) { AllocExclusive(); - + M_PENDATA->m_countDashes = number_of_dashes; M_PENDATA->m_dash = (wxGTKDash *)dash; } -void wxPen::SetColour( int red, int green, int blue ) +void wxPen::SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ) { AllocExclusive(); - + M_PENDATA->m_colour.Set( red, green, blue ); } void wxPen::SetCap( int capStyle ) { AllocExclusive(); - + M_PENDATA->m_capStyle = capStyle; } void wxPen::SetJoin( int joinStyle ) { AllocExclusive(); - + M_PENDATA->m_joinStyle = joinStyle; } void wxPen::SetStyle( int style ) { AllocExclusive(); - + M_PENDATA->m_style = style; } void wxPen::SetWidth( int width ) { AllocExclusive(); - + M_PENDATA->m_width = width; } @@ -217,4 +217,3 @@ wxColour &wxPen::GetColour() const return M_PENDATA->m_colour; } - diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index f3278719ca..f2237b0a66 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -26,7 +26,7 @@ public: { m_style = 0; } - + wxBrushRefData( const wxBrushRefData& data ) : wxObjectRefData() { @@ -34,14 +34,14 @@ public: m_stipple = data.m_stipple; m_colour = data.m_colour; } - + bool operator == (const wxBrushRefData& data) const { return (m_style == data.m_style && m_stipple == data.m_stipple && m_colour == data.m_colour); } - + int m_style; wxColour m_colour; wxBitmap m_stipple; @@ -90,10 +90,10 @@ wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const bool wxBrush::operator == ( const wxBrush& brush ) const { - if (m_refData == brush.m_refData) return TRUE; - - if (!m_refData || !brush.m_refData) return FALSE; - + if (m_refData == brush.m_refData) return true; + + if (!m_refData || !brush.m_refData) return false; + return ( *(wxBrushRefData*)m_refData == *(wxBrushRefData*)brush.m_refData ); } @@ -133,28 +133,28 @@ wxBitmap *wxBrush::GetStipple() const void wxBrush::SetColour( const wxColour& col ) { AllocExclusive(); - + M_BRUSHDATA->m_colour = col; } -void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b ) +void wxBrush::SetColour( const unsigned char r, const unsigned char g, const unsigned char b ) { AllocExclusive(); - + M_BRUSHDATA->m_colour.Set( r, g, b ); } void wxBrush::SetStyle( int style ) { AllocExclusive(); - + M_BRUSHDATA->m_style = style; } void wxBrush::SetStipple( const wxBitmap& stipple ) { AllocExclusive(); - + M_BRUSHDATA->m_stipple = stipple; if (M_BRUSHDATA->m_stipple.GetMask()) { @@ -165,4 +165,3 @@ void wxBrush::SetStipple( const wxBitmap& stipple ) M_BRUSHDATA->m_style = wxSTIPPLE; } } - diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 721b850a9f..cecc379b85 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/gtk/pen.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -31,7 +31,7 @@ public: m_dash = (wxGTKDash*) NULL; m_countDashes = 0; } - + wxPenRefData( const wxPenRefData& data ) : wxObjectRefData() { @@ -47,19 +47,19 @@ public: bool operator == (const wxPenRefData& data) const { if ( m_countDashes != data.m_countDashes ) - return FALSE; + return false; if ( m_dash ) { if ( !data.m_dash || memcmp(m_dash, data.m_dash, m_countDashes*sizeof(wxGTKDash)) ) { - return FALSE; + return false; } } else if ( data.m_dash ) { - return FALSE; + return false; } @@ -69,7 +69,7 @@ public: m_capStyle == data.m_capStyle && m_colour == data.m_colour; } - + int m_width; int m_style; int m_joinStyle; @@ -110,60 +110,60 @@ wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const bool wxPen::operator == ( const wxPen& pen ) const { - if (m_refData == pen.m_refData) return TRUE; - - if (!m_refData || !pen.m_refData) return FALSE; - + if (m_refData == pen.m_refData) return true; + + if (!m_refData || !pen.m_refData) return false; + return ( *(wxPenRefData*)m_refData == *(wxPenRefData*)pen.m_refData ); } void wxPen::SetColour( const wxColour &colour ) { AllocExclusive(); - + M_PENDATA->m_colour = colour; } void wxPen::SetDashes( int number_of_dashes, const wxDash *dash ) { AllocExclusive(); - + M_PENDATA->m_countDashes = number_of_dashes; M_PENDATA->m_dash = (wxGTKDash *)dash; } -void wxPen::SetColour( int red, int green, int blue ) +void wxPen::SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ) { AllocExclusive(); - + M_PENDATA->m_colour.Set( red, green, blue ); } void wxPen::SetCap( int capStyle ) { AllocExclusive(); - + M_PENDATA->m_capStyle = capStyle; } void wxPen::SetJoin( int joinStyle ) { AllocExclusive(); - + M_PENDATA->m_joinStyle = joinStyle; } void wxPen::SetStyle( int style ) { AllocExclusive(); - + M_PENDATA->m_style = style; } void wxPen::SetWidth( int width ) { AllocExclusive(); - + M_PENDATA->m_width = width; } @@ -217,4 +217,3 @@ wxColour &wxPen::GetColour() const return M_PENDATA->m_colour; } - diff --git a/src/mac/carbon/brush.cpp b/src/mac/carbon/brush.cpp index 878a38ce05..b7ada08a6d 100644 --- a/src/mac/carbon/brush.cpp +++ b/src/mac/carbon/brush.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp +// Name: src/mac/carbon/brush.cpp // Purpose: wxBrush // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -31,9 +31,9 @@ protected: int m_style; wxBitmap m_stipple ; wxColour m_colour; - + ThemeBrush m_macThemeBrush ; - + ThemeBackgroundKind m_macThemeBackground ; Rect m_macThemeBackgroundExtent ; }; @@ -87,7 +87,7 @@ wxBrush::wxBrush(const wxBitmap& stipple) M_BRUSHDATA->m_colour = *wxBLACK; M_BRUSHDATA->m_stipple = stipple; - + if (M_BRUSHDATA->m_stipple.GetMask()) M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; else @@ -96,7 +96,7 @@ wxBrush::wxBrush(const wxBitmap& stipple) RealizeResource(); } -wxBrush::wxBrush(ThemeBrush macThemeBrush ) +wxBrush::wxBrush(ThemeBrush macThemeBrush ) { m_refData = new wxBrushRefData; @@ -129,7 +129,7 @@ void wxBrush::SetColour(const wxColour& col) RealizeResource(); } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { Unshare(); @@ -168,7 +168,7 @@ void wxBrush::MacSetTheme(ThemeBrush macThemeBrush) RGBColor color ; GetThemeBrushAsColor( macThemeBrush , 32, true, &color ); M_BRUSHDATA->m_colour.Set( color.red >> 8 , color.green >> 8 , color.blue >> 8 ) ; - + RealizeResource(); } @@ -184,44 +184,44 @@ void wxBrush::MacSetThemeBackground(unsigned long macThemeBackground, const WXRE bool wxBrush::RealizeResource() { - return TRUE; + return true; } -unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const +unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const { - if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) - { - if ( extent ) - *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; - return M_BRUSHDATA->m_macThemeBackground ; - } - else - { - return 0 ; - } + if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) + { + if ( extent ) + *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; + return M_BRUSHDATA->m_macThemeBackground ; + } + else + { + return 0 ; + } } -short wxBrush::MacGetTheme() const -{ - return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); +short wxBrush::MacGetTheme() const +{ + return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); } -wxColour& wxBrush::GetColour() const +wxColour& wxBrush::GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); } -int wxBrush::GetStyle() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); +int wxBrush::GetStyle() const +{ + return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); } -wxBitmap *wxBrush::GetStipple() const -{ - return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); +wxBitmap *wxBrush::GetStipple() const +{ + return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); } -wxMacBrushKind wxBrush::MacGetBrushKind() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); +wxMacBrushKind wxBrush::MacGetBrushKind() const +{ + return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); } diff --git a/src/mac/carbon/pen.cpp b/src/mac/carbon/pen.cpp index e2f0df1545..be3a7a405a 100644 --- a/src/mac/carbon/pen.cpp +++ b/src/mac/carbon/pen.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/mac/carbon/pen.cpp // Purpose: wxPen // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -56,7 +56,7 @@ wxPen::~wxPen() wxPen::wxPen(const wxColour& col, int Width, int Style) { m_refData = new wxPenRefData; - + M_PENDATA->m_colour = col; M_PENDATA->m_width = Width; M_PENDATA->m_style = Style; @@ -64,14 +64,14 @@ wxPen::wxPen(const wxColour& col, int Width, int Style) M_PENDATA->m_cap = wxCAP_ROUND ; M_PENDATA->m_nbDash = 0 ; M_PENDATA->m_dash = 0 ; - + RealizeResource(); } wxPen::wxPen(const wxBitmap& stipple, int Width) { m_refData = new wxPenRefData; - + M_PENDATA->m_stipple = stipple; M_PENDATA->m_width = Width; M_PENDATA->m_style = wxSTIPPLE; @@ -79,7 +79,7 @@ wxPen::wxPen(const wxBitmap& stipple, int Width) M_PENDATA->m_cap = wxCAP_ROUND ; M_PENDATA->m_nbDash = 0 ; M_PENDATA->m_dash = 0 ; - + RealizeResource(); } @@ -101,81 +101,79 @@ void wxPen::Unshare() void wxPen::SetColour(const wxColour& col) { Unshare(); - + M_PENDATA->m_colour = col; - + RealizeResource(); } -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { Unshare(); - + M_PENDATA->m_colour.Set(r, g, b); - + RealizeResource(); } void wxPen::SetWidth(int Width) { Unshare(); - + M_PENDATA->m_width = Width; - + RealizeResource(); } void wxPen::SetStyle(int Style) { Unshare(); - + M_PENDATA->m_style = Style; - + RealizeResource(); } void wxPen::SetStipple(const wxBitmap& Stipple) { Unshare(); - + M_PENDATA->m_stipple = Stipple; M_PENDATA->m_style = wxSTIPPLE; - + RealizeResource(); } void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) { Unshare(); - + M_PENDATA->m_nbDash = nb_dashes; M_PENDATA->m_dash = (wxDash *)Dash; - + RealizeResource(); } void wxPen::SetJoin(int Join) { Unshare(); - + M_PENDATA->m_join = Join; - + RealizeResource(); } void wxPen::SetCap(int Cap) { Unshare(); - + M_PENDATA->m_cap = Cap; - + RealizeResource(); } bool wxPen::RealizeResource() { // nothing to do here for mac - return TRUE; + return true; } - - diff --git a/src/mac/classic/brush.cpp b/src/mac/classic/brush.cpp index f68830c59b..49d0c53ad2 100644 --- a/src/mac/classic/brush.cpp +++ b/src/mac/classic/brush.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp +// Name: src/mac/classic/brush.cpp // Purpose: wxBrush // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/setup.h" @@ -30,9 +30,9 @@ protected: int m_style; wxBitmap m_stipple ; wxColour m_colour; - + ThemeBrush m_macThemeBrush ; - + ThemeBackgroundKind m_macThemeBackground ; Rect m_macThemeBackgroundExtent ; }; @@ -86,7 +86,7 @@ wxBrush::wxBrush(const wxBitmap& stipple) M_BRUSHDATA->m_colour = *wxBLACK; M_BRUSHDATA->m_stipple = stipple; - + if (M_BRUSHDATA->m_stipple.GetMask()) M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; else @@ -95,7 +95,7 @@ wxBrush::wxBrush(const wxBitmap& stipple) RealizeResource(); } -wxBrush::wxBrush(ThemeBrush macThemeBrush ) +wxBrush::wxBrush(ThemeBrush macThemeBrush ) { m_refData = new wxBrushRefData; @@ -128,7 +128,7 @@ void wxBrush::SetColour(const wxColour& col) RealizeResource(); } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { Unshare(); @@ -180,44 +180,44 @@ void wxBrush::SetMacThemeBackground(unsigned long macThemeBackground, const WXRE bool wxBrush::RealizeResource() { - return TRUE; + return true; } -unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const +unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const { - if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) - { - if ( extent ) - *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; - return M_BRUSHDATA->m_macThemeBackground ; - } - else - { - return 0 ; - } + if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground ) + { + if ( extent ) + *(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ; + return M_BRUSHDATA->m_macThemeBackground ; + } + else + { + return 0 ; + } } -short wxBrush::GetMacTheme() const -{ - return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); +short wxBrush::GetMacTheme() const +{ + return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); } -wxColour& wxBrush::GetColour() const +wxColour& wxBrush::GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); } -int wxBrush::GetStyle() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); +int wxBrush::GetStyle() const +{ + return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); } -wxBitmap *wxBrush::GetStipple() const -{ - return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); +wxBitmap *wxBrush::GetStipple() const +{ + return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); } -wxMacBrushKind wxBrush::MacGetBrushKind() const -{ - return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); +wxMacBrushKind wxBrush::MacGetBrushKind() const +{ + return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); } diff --git a/src/mac/classic/pen.cpp b/src/mac/classic/pen.cpp index 2482ad62dd..2f27d50493 100644 --- a/src/mac/classic/pen.cpp +++ b/src/mac/classic/pen.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/mac/classic/pen.cpp // Purpose: wxPen // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/setup.h" @@ -55,7 +55,7 @@ wxPen::~wxPen() wxPen::wxPen(const wxColour& col, int Width, int Style) { m_refData = new wxPenRefData; - + M_PENDATA->m_colour = col; M_PENDATA->m_width = Width; M_PENDATA->m_style = Style; @@ -63,14 +63,14 @@ wxPen::wxPen(const wxColour& col, int Width, int Style) M_PENDATA->m_cap = wxCAP_ROUND ; M_PENDATA->m_nbDash = 0 ; M_PENDATA->m_dash = 0 ; - + RealizeResource(); } wxPen::wxPen(const wxBitmap& stipple, int Width) { m_refData = new wxPenRefData; - + M_PENDATA->m_stipple = stipple; M_PENDATA->m_width = Width; M_PENDATA->m_style = wxSTIPPLE; @@ -78,7 +78,7 @@ wxPen::wxPen(const wxBitmap& stipple, int Width) M_PENDATA->m_cap = wxCAP_ROUND ; M_PENDATA->m_nbDash = 0 ; M_PENDATA->m_dash = 0 ; - + RealizeResource(); } @@ -100,81 +100,79 @@ void wxPen::Unshare() void wxPen::SetColour(const wxColour& col) { Unshare(); - + M_PENDATA->m_colour = col; - + RealizeResource(); } -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { Unshare(); - + M_PENDATA->m_colour.Set(r, g, b); - + RealizeResource(); } void wxPen::SetWidth(int Width) { Unshare(); - + M_PENDATA->m_width = Width; - + RealizeResource(); } void wxPen::SetStyle(int Style) { Unshare(); - + M_PENDATA->m_style = Style; - + RealizeResource(); } void wxPen::SetStipple(const wxBitmap& Stipple) { Unshare(); - + M_PENDATA->m_stipple = Stipple; M_PENDATA->m_style = wxSTIPPLE; - + RealizeResource(); } void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) { Unshare(); - + M_PENDATA->m_nbDash = nb_dashes; M_PENDATA->m_dash = (wxDash *)Dash; - + RealizeResource(); } void wxPen::SetJoin(int Join) { Unshare(); - + M_PENDATA->m_join = Join; - + RealizeResource(); } void wxPen::SetCap(int Cap) { Unshare(); - + M_PENDATA->m_cap = Cap; - + RealizeResource(); } bool wxPen::RealizeResource() { // nothing to do here for mac - return TRUE; + return true; } - - diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index 0c033d2ada..26ea8e74f6 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp +// Name: src/mgl/brush.cpp // Purpose: // Author: Vaclav Slavik // Id: $Id$ // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -26,13 +26,13 @@ // This function converts wxBitmap into pixpattern24_t representation // (used by wxBrush and wxPen) -void wxBitmapToPixPattern(const wxBitmap& bitmap, +void wxBitmapToPixPattern(const wxBitmap& bitmap, pixpattern24_t *pix, pattern_t *mask) { wxMemoryDC mem; MGLDevCtx *dc; int x, y; - + if ( pix != NULL ) { mem.SelectObject(bitmap); @@ -41,9 +41,9 @@ void wxBitmapToPixPattern(const wxBitmap& bitmap, dc->beginPixel(); for (y = 0; y < 8; y++) for (x = 0; x < 8; x++) - dc->unpackColorFast(dc->getPixelFast(x, y), + dc->unpackColorFast(dc->getPixelFast(x, y), pix->p[y][x][2], - pix->p[y][x][1], + pix->p[y][x][1], pix->p[y][x][0]); dc->endPixel(); } @@ -127,20 +127,20 @@ wxBrush::wxBrush(const wxColour &colour, int style) wxBrush::wxBrush(const wxBitmap &stippleBitmap) { wxCHECK_RET( stippleBitmap.Ok(), _T("invalid bitmap") ); - wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8, + wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8, _T("stipple bitmap must be 8x8") ); m_refData = new wxBrushRefData(); M_BRUSHDATA->m_colour = *wxBLACK; - + M_BRUSHDATA->m_stipple = stippleBitmap; - wxBitmapToPixPattern(stippleBitmap, &(M_BRUSHDATA->m_pixPattern), + wxBitmapToPixPattern(stippleBitmap, &(M_BRUSHDATA->m_pixPattern), &(M_BRUSHDATA->m_maskPattern)); if (M_BRUSHDATA->m_stipple.GetMask()) - M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; - else - M_BRUSHDATA->m_style = wxSTIPPLE; + M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE; + else + M_BRUSHDATA->m_style = wxSTIPPLE; } wxBrush::wxBrush(const wxBrush &brush) @@ -223,7 +223,7 @@ void wxBrush::SetColour(const wxColour& col) M_BRUSHDATA->m_colour = col; } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { AllocExclusive(); M_BRUSHDATA->m_colour.Set(r, g, b); @@ -240,7 +240,7 @@ void wxBrush::SetStipple(const wxBitmap& stipple) AllocExclusive(); wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); - wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, + wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, _T("stipple bitmap must be 8x8") ); M_BRUSHDATA->m_stipple = stipple; @@ -262,4 +262,3 @@ wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const { return new wxBrushRefData(*(wxBrushRefData *)data); } - diff --git a/src/mgl/pen.cpp b/src/mgl/pen.cpp index f4a878aefb..ce9e56c741 100644 --- a/src/mgl/pen.cpp +++ b/src/mgl/pen.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/mgl/pen.cpp // Purpose: // Author: Vaclav Slavik // Id: $Id$ @@ -93,7 +93,7 @@ wxPen::wxPen(const wxColour &colour, int width, int style) wxPen::wxPen(const wxBitmap& stipple, int width) { wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); - wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, + wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, _T("stipple bitmap must be 8x8") ); m_refData = new wxPenRefData(); @@ -138,7 +138,7 @@ void wxPen::SetDashes(int number_of_dashes, const wxDash *dash) M_PENDATA->m_dash = (wxDash *)dash; /* TODO */ } -void wxPen::SetColour(int red, int green, int blue) +void wxPen::SetColour(const unsigned char red, const unsigned char green, const unsigned char blue) { AllocExclusive(); M_PENDATA->m_colour.Set(red, green, blue); @@ -165,7 +165,7 @@ void wxPen::SetStyle(int style) void wxPen::SetStipple(const wxBitmap& stipple) { wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); - wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, + wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, _T("stipple bitmap must be 8x8") ); AllocExclusive(); @@ -179,20 +179,20 @@ void wxPen::SetWidth(int width) M_PENDATA->m_width = width; } -int wxPen::GetDashes(wxDash **ptr) const +int wxPen::GetDashes(wxDash **ptr) const { - *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL); + *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_countDashes : 0); } -int wxPen::GetDashCount() const -{ - return (M_PENDATA->m_countDashes); +int wxPen::GetDashCount() const +{ + return (M_PENDATA->m_countDashes); } -wxDash* wxPen::GetDash() const -{ - return (wxDash*)M_PENDATA->m_dash; +wxDash* wxPen::GetDash() const +{ + return (wxDash*)M_PENDATA->m_dash; } int wxPen::GetCap() const @@ -259,4 +259,3 @@ wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const { return new wxPenRefData(*(wxPenRefData *)data); } - diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index e14fd9fcbc..3ca22f6375 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -314,7 +314,7 @@ void wxBrush::SetColour(const wxColour& col) M_BRUSHDATA->SetColour(col); } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { AllocExclusive(); @@ -334,5 +334,3 @@ void wxBrush::SetStipple(const wxBitmap& stipple) M_BRUSHDATA->SetStipple(stipple); } - - diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index f255240708..ddded9fc63 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/pen.cpp +// Name: src/msw/pen.cpp // Purpose: wxPen // Author: Julian Smart // Modified by: @@ -305,7 +305,7 @@ void wxPen::SetColour(const wxColour& col) RealizeResource(); } -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { Unshare(); @@ -397,4 +397,3 @@ int wx2msPenStyle(int wx_style) #endif return PS_SOLID; } - diff --git a/src/os2/brush.cpp b/src/os2/brush.cpp index 45fadb451a..dc81e06918 100644 --- a/src/os2/brush.cpp +++ b/src/os2/brush.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp +// Name: src/os2/brush.cpp // Purpose: wxBrush // Author: David Webster // Modified by: @@ -139,7 +139,7 @@ bool wxBrush::RealizeResource() vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); - return FALSE; + return false; } if (M_BRUSHDATA->m_nStyle==wxTRANSPARENT) @@ -224,7 +224,7 @@ bool wxBrush::RealizeResource() } return bOk; } - return FALSE; + return false; } // end of wxBrush::RealizeResource WXHANDLE wxBrush::GetResourceHandle() @@ -241,7 +241,7 @@ bool wxBrush::FreeResource( bool WXUNUSED(bForce) ) M_BRUSHDATA->m_hBrush = 0; return true; } - else return FALSE; + else return false; } // end of wxBrush::FreeResource bool wxBrush::IsFree() const @@ -266,32 +266,21 @@ void wxBrush::Unshare() } } // end of wxBrush::Unshare -void wxBrush::SetColour( - const wxColour& rColour -) +void wxBrush::SetColour( const wxColour& rColour ) { Unshare(); M_BRUSHDATA->m_vColour = rColour; RealizeResource(); } -void wxBrush::SetColour( - unsigned char cRed -, unsigned char cGreen -, unsigned char cBlue -) +void wxBrush::SetColour(const unsigned char cRed, const unsigned char cGreen, const unsigned char cBlue) { Unshare(); - M_BRUSHDATA->m_vColour.Set( cRed - ,cGreen - ,cBlue - ); + M_BRUSHDATA->m_vColour.Set( cRed, cGreen, cBlue ); RealizeResource(); } // end of wxBrush::SetColour -void wxBrush::SetStyle( - int nStyle -) +void wxBrush::SetStyle(int nStyle) { Unshare(); M_BRUSHDATA->m_nStyle = nStyle; diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index a19f195160..cd6504be81 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp +// Name: src/os2/pen.cpp // Purpose: wxPen // Author: David Webster // Modified by: @@ -152,7 +152,7 @@ bool wxPen::RealizeResource() vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); - return FALSE; + return false; } if (M_PENDATA->m_nStyle == wxTRANSPARENT) { @@ -216,7 +216,7 @@ bool wxPen::RealizeResource() vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); wxLogError(_T("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str()); - return FALSE; + return false; } ULONG flAttrMask = 0L; @@ -346,29 +346,21 @@ void wxPen::Unshare() } } // end of wxPen::Unshare -void wxPen::SetColour( - const wxColour& rColour -) +void wxPen::SetColour( const wxColour& rColour ) { Unshare(); M_PENDATA->m_vColour = rColour; RealizeResource(); } // end of wxPen::SetColour -void wxPen::SetColour( - unsigned char cRed -, unsigned char cGreen -, unsigned char cBlue -) +void wxPen::SetColour( const unsigned char cRed, const unsigned char cGreen, const unsigned char cBlue) { Unshare(); M_PENDATA->m_vColour.Set(cRed, cGreen, cBlue); RealizeResource(); } // end of wxPen::SetColour -void wxPen::SetPS( - HPS hPS -) +void wxPen::SetPS( HPS hPS ) { Unshare(); if (M_PENDATA->m_hPen) diff --git a/src/palmos/brush.cpp b/src/palmos/brush.cpp index 791b9c8330..3711839c57 100644 --- a/src/palmos/brush.cpp +++ b/src/palmos/brush.cpp @@ -72,7 +72,7 @@ wxBrush& wxBrush::operator=(const wxBrush& brush) bool wxBrush::operator==(const wxBrush& brush) const { - return FALSE; + return false; } wxObjectRefData *wxBrush::CreateRefData() const @@ -117,7 +117,7 @@ void wxBrush::SetColour(const wxColour& col) { } -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { } @@ -128,5 +128,3 @@ void wxBrush::SetStyle(int style) void wxBrush::SetStipple(const wxBitmap& stipple) { } - - diff --git a/src/palmos/pen.cpp b/src/palmos/pen.cpp index a3d82ee89c..b0d821755a 100644 --- a/src/palmos/pen.cpp +++ b/src/palmos/pen.cpp @@ -88,7 +88,7 @@ void wxPen::SetColour(const wxColour& col) { } -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) +void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) { } @@ -115,4 +115,3 @@ void wxPen::SetJoin(int Join) void wxPen::SetCap(int Cap) { } - diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp index 736dcc6cfd..a239850cca 100644 --- a/src/x11/brush.cpp +++ b/src/x11/brush.cpp @@ -138,7 +138,7 @@ void wxBrush::SetColour( const wxColour& col ) M_BRUSHDATA->m_colour = col; } -void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b ) +void wxBrush::SetColour( const unsigned char r, const unsigned char g, const unsigned char b ) { AllocExclusive(); diff --git a/src/x11/pen.cpp b/src/x11/pen.cpp index 6fc6a57176..a843cdce9f 100644 --- a/src/x11/pen.cpp +++ b/src/x11/pen.cpp @@ -122,7 +122,7 @@ void wxPen::SetDashes( int number_of_dashes, const wxDash *dash ) M_PENDATA->m_dash = (wxX11Dash *)dash; // TODO } -void wxPen::SetColour( int red, int green, int blue ) +void wxPen::SetColour( const unsigned char red, const unsigned char green, const unsigned char blue ) { AllocExclusive(); -- 2.45.2