/////////////////////////////////////////////////////////////////////////////
// Name: brush.h
// Purpose: wxBrush class
-// Author: Julian Smart
+// Author: Julian Smart, Robert Roebling
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart
+// Copyright: (c) Julian Smart, Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/gdiobj.h"
#include "wx/bitmap.h"
-class WXDLLEXPORT wxBrush;
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
-class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
-{
- friend class WXDLLEXPORT wxBrush;
-public:
- wxBrushRefData();
- wxBrushRefData(const wxBrushRefData& data);
- ~wxBrushRefData();
-
-protected:
- int m_style;
- wxBitmap m_stipple ;
- wxColour m_colour;
-};
+class wxBrush;
-#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
+//-----------------------------------------------------------------------------
+// wxBrush
+//-----------------------------------------------------------------------------
-// Brush
-class WXDLLEXPORT wxBrush: public wxGDIObject
+class wxBrush: public wxGDIObject
{
- DECLARE_DYNAMIC_CLASS(wxBrush)
-
public:
- wxBrush();
- wxBrush(const wxColour& col, int style);
- wxBrush(const wxBitmap& stipple);
- inline wxBrush(const wxBrush& brush) { Ref(brush); }
- ~wxBrush();
-
- 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) ;
+ wxBrush() { }
- inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
- inline bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; }
- inline bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; }
-
- inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
- inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
- inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
+ wxBrush( const wxColour &colour, int style );
+ wxBrush( const wxBitmap &stippleBitmap );
+ ~wxBrush();
- virtual bool Ok() const { return (m_refData != NULL) ; }
+ wxBrush( const wxBrush &brush ) { Ref(brush); }
+ wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; }
- // Implementation
+ bool Ok() const { return m_refData != NULL; }
- // Useful helper: create the brush resource
- bool RealizeResource();
+ bool operator == ( const wxBrush& brush ) const;
+ bool operator != (const wxBrush& brush) const { return !(*this == brush); }
+
+ int GetStyle() const;
+ wxColour &GetColour() const;
+ wxBitmap *GetStipple() const;
+
+ void SetColour( const wxColour& col );
+ void SetColour( unsigned char r, unsigned char g, unsigned char b );
+ void SetStyle( int style );
+ void SetStipple( const wxBitmap& stipple );
+
+private:
+ // ref counting code
+ virtual wxObjectRefData *CreateRefData() const;
+ virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
- // When setting properties, we must make sure we're not changing
- // another object
- void Unshare();
+ DECLARE_DYNAMIC_CLASS(wxBrush)
};
#endif
int m_currentPenJoin ;
int m_currentPenCap ;
int m_currentPenDashCount ;
- wxMOTIFDash* m_currentPenDash ;
+ wxX11Dash* m_currentPenDash ;
wxBitmap m_currentStipple ;
int m_currentStyle ;
int m_currentFill ;
#include "wx/colour.h"
#include "wx/bitmap.h"
-typedef char wxMOTIFDash;
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
-class WXDLLEXPORT wxPen;
+class wxPen;
-class WXDLLEXPORT wxPenRefData: public wxGDIRefData
-{
- friend class WXDLLEXPORT wxPen;
-public:
- wxPenRefData();
- wxPenRefData(const wxPenRefData& data);
- ~wxPenRefData();
-
-protected:
- int m_width;
- int m_style;
- int m_join ;
- int m_cap ;
- wxBitmap m_stipple ;
- int m_nbDash ;
- wxMOTIFDash *m_dash ;
- wxColour m_colour;
-};
+typedef char wxX11Dash;
-#define M_PENDATA ((wxPenRefData *)m_refData)
+//-----------------------------------------------------------------------------
+// wxPen
+//-----------------------------------------------------------------------------
-// Pen
-class WXDLLEXPORT wxPen: public wxGDIObject
+class wxPen: public wxGDIObject
{
- DECLARE_DYNAMIC_CLASS(wxPen)
public:
- wxPen();
- wxPen(const wxColour& col, int width, int style);
- wxPen(const wxBitmap& stipple, int width);
- inline wxPen(const wxPen& pen) { Ref(pen); }
- ~wxPen();
-
- inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
- inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; }
- inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }
+ wxPen() { }
- virtual bool Ok() const { return (m_refData != NULL) ; }
-
- // Override in order to recreate the pen
- void SetColour(const wxColour& col) ;
- void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
-
- void SetWidth(int width) ;
- void SetStyle(int style) ;
- void SetStipple(const wxBitmap& stipple) ;
- void SetDashes(int nb_dashes, const wxDash *dash) ;
- void SetJoin(int join) ;
- void SetCap(int cap) ;
+ wxPen( const wxColour &colour, int width, int style );
+ ~wxPen();
- inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
- inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
- inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
- inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
- inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
- inline int GetDashes(wxDash **ptr) const
- {
- *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
- return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
- }
- inline int GetDashCount() const { return (M_PENDATA->m_nbDash); }
- inline wxDash* GetDash() const { return (wxDash*)M_PENDATA->m_dash; }
+ wxPen( const wxPen& pen ) { Ref(pen); }
+ wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
- inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
+ bool Ok() const { return m_refData != NULL; }
- // Implementation
+ 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 SetCap( int capStyle );
+ void SetJoin( int joinStyle );
+ void SetStyle( int style );
+ void SetWidth( int width );
+ void SetDashes( int number_of_dashes, const wxDash *dash );
- // Useful helper: create the brush resource
- bool RealizeResource();
+ wxColour &GetColour() const;
+ int GetCap() const;
+ int GetJoin() const;
+ int GetStyle() const;
+ int GetWidth() const;
+ int GetDashes(wxDash **ptr) const;
+ int GetDashCount() const;
+ wxDash* GetDash() const;
+
+private:
+ // ref counting code
+ virtual wxObjectRefData *CreateRefData() const;
+ virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
- // When setting properties, we must make sure we're not changing
- // another object
- void Unshare();
+ DECLARE_DYNAMIC_CLASS(wxPen)
};
#endif
#include "wx/utils.h"
#include "wx/brush.h"
-IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
+//-----------------------------------------------------------------------------
+// wxBrush
+//-----------------------------------------------------------------------------
-wxBrushRefData::wxBrushRefData()
+class wxBrushRefData: public wxObjectRefData
{
- m_style = wxSOLID;
-}
+public:
+ wxBrushRefData()
+ {
+ m_style = 0;
+ }
+
+ wxBrushRefData( const wxBrushRefData& data )
+ {
+ m_style = data.m_style;
+ 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;
+};
-wxBrushRefData::wxBrushRefData(const wxBrushRefData& data)
-{
- m_style = data.m_style;
- m_stipple = data.m_stipple;
- m_colour = data.m_colour;
-}
+//-----------------------------------------------------------------------------
-wxBrushRefData::~wxBrushRefData()
+#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
+
+IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
+
+wxBrush::wxBrush( const wxColour &colour, int style )
{
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_style = style;
+ M_BRUSHDATA->m_colour = colour;
}
-// Brushes
-wxBrush::wxBrush()
+wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_colour = *wxBLACK;
+
+ M_BRUSHDATA->m_stipple = stippleBitmap;
+
+ if (M_BRUSHDATA->m_stipple.GetMask())
+ M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
+ else
+ M_BRUSHDATA->m_style = wxSTIPPLE;
}
wxBrush::~wxBrush()
{
+ // m_refData unrefed in ~wxObject
}
-wxBrush::wxBrush(const wxColour& col, int Style)
+wxObjectRefData *wxBrush::CreateRefData() const
{
- m_refData = new wxBrushRefData;
-
- M_BRUSHDATA->m_colour = col;
- M_BRUSHDATA->m_style = Style;
-
- RealizeResource();
+ return new wxBrushRefData;
}
-wxBrush::wxBrush(const wxBitmap& stipple)
+wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
{
- m_refData = new wxBrushRefData;
-
- M_BRUSHDATA->m_style = wxSTIPPLE;
- M_BRUSHDATA->m_stipple = stipple;
+ return new wxBrushRefData(*(wxBrushRefData *)data);
+}
- RealizeResource();
+bool wxBrush::operator == ( const wxBrush& brush ) const
+{
+ if (m_refData == brush.m_refData) return TRUE;
+
+ if (!m_refData || !brush.m_refData) return FALSE;
+
+ return ( *(wxBrushRefData*)m_refData == *(wxBrushRefData*)brush.m_refData );
}
-void wxBrush::Unshare()
+int wxBrush::GetStyle() const
{
- // Don't change shared data
- if (!m_refData)
+ if (m_refData == NULL)
{
- m_refData = new wxBrushRefData();
- }
- else
- {
- wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
- UnRef();
- m_refData = ref;
+ wxFAIL_MSG( wxT("invalid brush") );
+ return 0;
}
+
+ return M_BRUSHDATA->m_style;
}
-void wxBrush::SetColour(const wxColour& col)
+wxColour &wxBrush::GetColour() const
{
- Unshare();
-
- M_BRUSHDATA->m_colour = col;
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return wxNullColour;
+ }
- RealizeResource();
+ return M_BRUSHDATA->m_colour;
}
-void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
+wxBitmap *wxBrush::GetStipple() const
{
- Unshare();
-
- M_BRUSHDATA->m_colour.Set(r, g, b);
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return &wxNullBitmap;
+ }
- RealizeResource();
+ return &M_BRUSHDATA->m_stipple;
}
-void wxBrush::SetStyle(int Style)
+void wxBrush::SetColour( const wxColour& col )
{
- Unshare();
-
- M_BRUSHDATA->m_style = Style;
-
- RealizeResource();
+ AllocExclusive();
+
+ M_BRUSHDATA->m_colour = col;
}
-void wxBrush::SetStipple(const wxBitmap& Stipple)
+void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
{
- Unshare();
-
- M_BRUSHDATA->m_stipple = Stipple;
-
- RealizeResource();
+ AllocExclusive();
+
+ M_BRUSHDATA->m_colour.Set( r, g, b );
}
-bool wxBrush::RealizeResource()
+void wxBrush::SetStyle( int style )
{
- // Nothing more to do
- return TRUE;
+ AllocExclusive();
+
+ M_BRUSHDATA->m_style = style;
}
+void wxBrush::SetStipple( const wxBitmap& stipple )
+{
+ AllocExclusive();
+
+ M_BRUSHDATA->m_stipple = stipple;
+ if (M_BRUSHDATA->m_stipple.GetMask())
+ {
+ M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
+ }
+ else
+ {
+ M_BRUSHDATA->m_style = wxSTIPPLE;
+ }
+}
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
- m_currentPenDash = (wxMOTIFDash*) NULL;
+ m_currentPenDash = (wxX11Dash*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
- m_currentPenDash = (wxMOTIFDash*) NULL;
+ m_currentPenDash = (wxX11Dash*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
int old_pen_join = m_currentPenJoin;
int old_pen_cap = m_currentPenCap;
int old_pen_nb_dash = m_currentPenDashCount;
- wxMOTIFDash *old_pen_dash = m_currentPenDash;
+ wxX11Dash *old_pen_dash = m_currentPenDash;
wxColour oldPenColour = m_currentColour;
m_currentColour = m_pen.GetColour ();
m_currentPenJoin = m_pen.GetJoin ();
m_currentPenCap = m_pen.GetCap ();
m_currentPenDashCount = m_pen.GetDashCount();
- m_currentPenDash = (wxMOTIFDash*)m_pen.GetDash();
+ m_currentPenDash = (wxX11Dash*)m_pen.GetDash();
+#if 0
+ // TODO
if (m_currentStyle == wxSTIPPLE)
m_currentStipple = * m_pen.GetStipple ();
+#endif
bool sameStyle = (oldStyle == m_currentStyle &&
oldFill == m_currentFill &&
int style;
int join;
int cap;
- static const wxMOTIFDash dotted[] = {2, 5};
- static const wxMOTIFDash short_dashed[] = {4, 4};
- static const wxMOTIFDash long_dashed[] = {4, 8};
- static const wxMOTIFDash dotted_dashed[] = {6, 6, 2, 6};
+ static const wxX11Dash dotted[] = {2, 5};
+ static const wxX11Dash short_dashed[] = {4, 4};
+ static const wxX11Dash long_dashed[] = {4, 8};
+ static const wxX11Dash dotted_dashed[] = {6, 6, 2, 6};
// We express dash pattern in pen width unit, so we are
// independent of zoom factor and so on...
int req_nb_dash;
- const wxMOTIFDash *req_dash;
+ const wxX11Dash *req_dash;
switch (m_pen.GetStyle ())
{
case wxTRANSPARENT:
default:
style = LineSolid;
- req_dash = (wxMOTIFDash*)NULL;
+ req_dash = (wxX11Dash*)NULL;
req_nb_dash = 0;
}
if (req_dash && req_nb_dash)
{
- wxMOTIFDash *real_req_dash = new wxMOTIFDash[req_nb_dash];
+ wxX11Dash *real_req_dash = new wxX11Dash[req_nb_dash];
if (real_req_dash)
{
int factor = scaled_width == 0 ? 1 : scaled_width;
#include "wx/utils.h"
#include "wx/pen.h"
-IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
+//-----------------------------------------------------------------------------
+// wxPen
+//-----------------------------------------------------------------------------
-wxPenRefData::wxPenRefData()
+class wxPenRefData: public wxObjectRefData
{
- m_style = wxSOLID;
- m_width = 1;
- m_join = wxJOIN_ROUND ;
- m_cap = wxCAP_ROUND ;
- m_nbDash = 0 ;
- m_dash = (wxMOTIFDash*)NULL;
-}
+public:
+ wxPenRefData()
+ {
+ m_width = 1;
+ m_style = wxSOLID;
+ m_joinStyle = wxJOIN_ROUND;
+ m_capStyle = wxCAP_ROUND;
+ m_dash = (wxX11Dash*) NULL;
+ m_countDashes = 0;
+ }
+
+ wxPenRefData( const wxPenRefData& data )
+ {
+ m_style = data.m_style;
+ m_width = data.m_width;
+ m_joinStyle = data.m_joinStyle;
+ m_capStyle = data.m_capStyle;
+ m_colour = data.m_colour;
+ m_countDashes = data.m_countDashes;
+/*
+ if (data.m_dash) TODO
+ m_dash = new
+*/
+ m_dash = data.m_dash;
+ }
-wxPenRefData::wxPenRefData(const wxPenRefData& data)
-{
- m_style = data.m_style;
- m_width = data.m_width;
- m_join = data.m_join;
- m_cap = data.m_cap;
- m_nbDash = data.m_nbDash;
- m_dash = data.m_dash;
- m_colour = data.m_colour;
-}
+ bool operator == (const wxPenRefData& data) const
+ {
+ return (m_style == data.m_style &&
+ m_width == data.m_width &&
+ m_joinStyle == data.m_joinStyle &&
+ m_capStyle == data.m_capStyle &&
+ m_colour == data.m_colour);
+ }
+
+ int m_width;
+ int m_style;
+ int m_joinStyle;
+ int m_capStyle;
+ wxColour m_colour;
+ int m_countDashes;
+ wxX11Dash *m_dash;
+};
-wxPenRefData::~wxPenRefData()
-{
-}
+//-----------------------------------------------------------------------------
+
+#define M_PENDATA ((wxPenRefData *)m_refData)
-// Pens
+IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
-wxPen::wxPen()
+wxPen::wxPen( const wxColour &colour, int width, int style )
{
+ m_refData = new wxPenRefData();
+ M_PENDATA->m_width = width;
+ M_PENDATA->m_style = style;
+ M_PENDATA->m_colour = colour;
}
wxPen::~wxPen()
{
+ // m_refData unrefed in ~wxObject
}
-// Should implement Create
-wxPen::wxPen(const wxColour& col, int Width, int Style)
+wxObjectRefData *wxPen::CreateRefData() const
{
- m_refData = new wxPenRefData;
-
- M_PENDATA->m_colour = col;
- M_PENDATA->m_width = Width;
- M_PENDATA->m_style = Style;
- M_PENDATA->m_join = wxJOIN_ROUND ;
- M_PENDATA->m_cap = wxCAP_ROUND ;
- M_PENDATA->m_nbDash = 0 ;
- M_PENDATA->m_dash = (wxMOTIFDash*)NULL;
-
- RealizeResource();
+ return new wxPenRefData;
}
-wxPen::wxPen(const wxBitmap& stipple, int Width)
+wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const
{
- m_refData = new wxPenRefData;
-
- M_PENDATA->m_stipple = stipple;
- M_PENDATA->m_width = Width;
- M_PENDATA->m_style = wxSTIPPLE;
- M_PENDATA->m_join = wxJOIN_ROUND ;
- M_PENDATA->m_cap = wxCAP_ROUND ;
- M_PENDATA->m_nbDash = 0 ;
- M_PENDATA->m_dash = (wxMOTIFDash*)NULL;
-
- RealizeResource();
+ return new wxPenRefData(*(wxPenRefData *)data);
}
-void wxPen::Unshare()
+bool wxPen::operator == ( const wxPen& pen ) const
{
- // Don't change shared data
- if (!m_refData)
- {
- m_refData = new wxPenRefData();
- }
- else
- {
- wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData);
- UnRef();
- m_refData = ref;
- }
+ 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& col)
+void wxPen::SetColour( const wxColour &colour )
{
- Unshare();
-
- M_PENDATA->m_colour = col;
-
- RealizeResource();
+ AllocExclusive();
+
+ M_PENDATA->m_colour = colour;
}
-void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b)
+void wxPen::SetDashes( int number_of_dashes, const wxDash *dash )
{
- Unshare();
-
- M_PENDATA->m_colour.Set(r, g, b);
+ AllocExclusive();
+
+ M_PENDATA->m_countDashes = number_of_dashes;
+ M_PENDATA->m_dash = (wxX11Dash *)dash; // TODO
+}
- RealizeResource();
+void wxPen::SetColour( int red, int green, int blue )
+{
+ AllocExclusive();
+
+ M_PENDATA->m_colour.Set( red, green, blue );
}
-void wxPen::SetWidth(int Width)
+void wxPen::SetCap( int capStyle )
{
- Unshare();
+ AllocExclusive();
+
+ M_PENDATA->m_capStyle = capStyle;
+}
- M_PENDATA->m_width = Width;
+void wxPen::SetJoin( int joinStyle )
+{
+ AllocExclusive();
+
+ M_PENDATA->m_joinStyle = joinStyle;
+}
- RealizeResource();
+void wxPen::SetStyle( int style )
+{
+ AllocExclusive();
+
+ M_PENDATA->m_style = style;
}
-void wxPen::SetStyle(int Style)
+void wxPen::SetWidth( int width )
{
- Unshare();
+ AllocExclusive();
+
+ M_PENDATA->m_width = width;
+}
- M_PENDATA->m_style = Style;
+int wxPen::GetDashes( wxDash **ptr ) const
+{
+ *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
+ return (M_PENDATA ? M_PENDATA->m_countDashes : 0);
+}
- RealizeResource();
+int wxPen::GetDashCount() const
+{
+ return (M_PENDATA->m_countDashes);
}
-void wxPen::SetStipple(const wxBitmap& Stipple)
+wxDash* wxPen::GetDash() const
{
- Unshare();
+ return (wxDash*)M_PENDATA->m_dash;
+}
- M_PENDATA->m_stipple = Stipple;
- M_PENDATA->m_style = wxSTIPPLE;
+int wxPen::GetCap() const
+{
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
- RealizeResource();
+ return M_PENDATA->m_capStyle;
}
-void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
+int wxPen::GetJoin() const
{
- Unshare();
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
- M_PENDATA->m_nbDash = nb_dashes;
- M_PENDATA->m_dash = (wxMOTIFDash *)Dash;
-
- RealizeResource();
+ return M_PENDATA->m_joinStyle;
}
-void wxPen::SetJoin(int Join)
+int wxPen::GetStyle() const
{
- Unshare();
-
- M_PENDATA->m_join = Join;
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
- RealizeResource();
+ return M_PENDATA->m_style;
}
-void wxPen::SetCap(int Cap)
+int wxPen::GetWidth() const
{
- Unshare();
-
- M_PENDATA->m_cap = Cap;
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
- RealizeResource();
+ return M_PENDATA->m_width;
}
-bool wxPen::RealizeResource()
+wxColour &wxPen::GetColour() const
{
- // Nothing more to do
- return TRUE;
-}
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ return M_PENDATA->m_colour;
+}