IS_HATCH macro replaced with wxBrush::IsHatch() + source and docs little cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -33,6 +33,7 @@ All (GUI):
|
||||
- wxBookCtrl renamed to wxBookCtrlBase, wxBookCtrl is reserved for most native
|
||||
book control (for now wxChoicebook for MSSmartphone, wxNotebook for others).
|
||||
Necessary event macros, types and styles mapped accordingly.
|
||||
- new wxBrush::IsHatch() checking for brush type replaces IS_HATCH macro
|
||||
|
||||
Unix:
|
||||
|
||||
|
@@ -178,6 +178,16 @@ Returns the brush style, one of:
|
||||
\helpref{wxBrush::SetStyle}{wxbrushsetstyle}, \helpref{wxBrush::SetColour}{wxbrushsetcolour},\rtfsp
|
||||
\helpref{wxBrush::SetStipple}{wxbrushsetstipple}
|
||||
|
||||
\membersection{wxBrush::IsHatch}\label{wxbrushishatch}
|
||||
|
||||
\constfunc{bool}{IsHatch}{\void}
|
||||
|
||||
Returns true if the style of the brush is any of hatched fills.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxBrush::GetStyle}{wxbrushgetstyle}
|
||||
|
||||
\membersection{wxBrush::Ok}\label{wxbrushok}
|
||||
|
||||
\constfunc{bool}{Ok}{\void}
|
||||
|
@@ -4,17 +4,17 @@ Listed here are the depreciated and incompatable changes made to wxWidgets.
|
||||
|
||||
For other changes (such as additional features, bug fixes, etc.) see the changes.txt file located in the docs directory of your wxWidgets directory.
|
||||
|
||||
\subsection{Incompatable changes since 2.4.x}
|
||||
\subsection{Incompatable changes since 2.4.x}\label{incompatiblesince24}
|
||||
|
||||
\subsubsection{New window repainting behaviour}
|
||||
\subsubsection{New window repainting behaviour}\label{newwindowrepainting}
|
||||
|
||||
Windows are no longer fully repainted when resized, use new style wxFULL\_REPAINT\_ON\_RESIZE to force this (wxNO\_FULL\_REPAINT\_ON\_RESIZE still exists but doesn't do anything any more, this behaviour is default now).
|
||||
|
||||
\subsubsection{Window class member changes}
|
||||
\subsubsection{Window class member changes}\label{windowclassmemberchanges}
|
||||
|
||||
wxWindow::m\_font and m\_backgroundColour/m\_foregroundColour are no longer always set, use GetFont(), GetBack/ForegroundColour() to access them, and they will be dynamically determined if necessary.
|
||||
|
||||
\subsubsection{Sizers Internal Overhaul}
|
||||
\subsubsection{Sizers Internal Overhaul}\label{sizersinternaloverhaul}
|
||||
|
||||
The Sizers have had some fundamental internal changes in the 2.5.2 and 2.5.3 releases intended to make them do more of the "Right Thing" but also be as backwards compatible as possible. First a bit about how things used to work:
|
||||
|
||||
@@ -94,7 +94,7 @@ The Sizers have had some fundamental internal changes in the 2.5.2 and 2.5.3 rel
|
||||
control is sized to a blending of the min size and best size.
|
||||
This can be done by calling SetBestFittingSize.
|
||||
|
||||
\subsubsection{Massive wxURL Rewrite}
|
||||
\subsubsection{Massive wxURL Rewrite}\label{wxurlrewrite}
|
||||
|
||||
wxURL has undergone some radical changes.
|
||||
|
||||
@@ -107,7 +107,7 @@ wxURL has undergone some radical changes.
|
||||
|
||||
* ConvertFromURI has been replaced by wxURI::Unescape.
|
||||
|
||||
\subsubsection{Less drastic incompatable changes since 2.4.x}
|
||||
\subsubsection{Less drastic incompatable changes since 2.4.x}\label{24incompatiblelessdrastic}
|
||||
|
||||
- no initialization/cleanup can be done in wxApp/~wxApp because they are
|
||||
now called much earlier/later than before; please move any exiting code
|
||||
@@ -188,7 +188,9 @@ wxURL has undergone some radical changes.
|
||||
- wxSizer::Add/Insert returns pointer to wxSizerItem just added so conditions
|
||||
writeen with if(Add(..)==true) will not work. Use if(Add(..)) instead.
|
||||
|
||||
\subsection{Depreciated changes since 2.4.x}
|
||||
- New wxBrush::IsHatch() checking for brush type replaces IS_HATCH macro.
|
||||
|
||||
\subsection{Depreciated changes since 2.4.x}\label{depreciatedsince24}
|
||||
|
||||
- wxURL::GetInputStream() and similar functionality has been depreciated in
|
||||
favor of other ways of connecting, such as though sockets or wxFileSystem.
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 2003/07/03
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 David Elliott
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __WX_COCOA_BRUSH_H__
|
||||
@@ -59,6 +59,9 @@ public:
|
||||
int GetStyle() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
virtual bool Ok() const
|
||||
{ return (m_refData != NULL); }
|
||||
|
||||
|
@@ -1824,28 +1824,31 @@ enum
|
||||
wxCAP_BUTT
|
||||
};
|
||||
|
||||
/* VZ: why doesn't it start with "wx"? FIXME */
|
||||
#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
|
||||
#else
|
||||
/* use wxBrush::IsHatch() instead thought wxMotif still uses it in src/motif/dcclient.cpp */
|
||||
#endif
|
||||
|
||||
/* Logical ops */
|
||||
typedef enum
|
||||
{
|
||||
wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, /* 0 */
|
||||
wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, /* src XOR dst */
|
||||
wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, /* NOT dst */
|
||||
wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, /* src OR (NOT dst) */
|
||||
wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, /* src AND (NOT dst) */
|
||||
wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, /* src */
|
||||
wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, /* src AND dst */
|
||||
wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, /* (NOT src) AND dst */
|
||||
wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, /* dst */
|
||||
wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, /* (NOT src) AND (NOT dst) */
|
||||
wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, /* (NOT src) XOR dst */
|
||||
wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, /* (NOT src) */
|
||||
wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, /* (NOT src) OR dst */
|
||||
wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, /* (NOT src) OR (NOT dst) */
|
||||
wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, /* src OR dst */
|
||||
wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET /* 1 */
|
||||
wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, /* 0 */
|
||||
wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, /* src XOR dst */
|
||||
wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, /* NOT dst */
|
||||
wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, /* src OR (NOT dst) */
|
||||
wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, /* src AND (NOT dst) */
|
||||
wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, /* src */
|
||||
wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, /* src AND dst */
|
||||
wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, /* (NOT src) AND dst */
|
||||
wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, /* dst */
|
||||
wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, /* (NOT src) AND (NOT dst) */
|
||||
wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, /* (NOT src) XOR dst */
|
||||
wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, /* (NOT src) */
|
||||
wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, /* (NOT src) OR dst */
|
||||
wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, /* (NOT src) OR (NOT dst) */
|
||||
wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, /* src OR dst */
|
||||
wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET /* 1 */
|
||||
} form_ops_t;
|
||||
|
||||
/* Flood styles */
|
||||
|
@@ -54,6 +54,9 @@ public:
|
||||
wxColour &GetColour() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
void SetColour( const wxColour& col );
|
||||
void SetColour( unsigned char r, unsigned char g, unsigned char b );
|
||||
void SetStyle( int style );
|
||||
|
@@ -54,6 +54,9 @@ public:
|
||||
wxColour &GetColour() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
void SetColour( const wxColour& col );
|
||||
void SetColour( unsigned char r, unsigned char g, unsigned char b );
|
||||
void SetStyle( int style );
|
||||
|
@@ -24,58 +24,61 @@ class WXDLLEXPORT wxBrush;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kwxMacBrushColour ,
|
||||
kwxMacBrushTheme ,
|
||||
kwxMacBrushThemeBackground
|
||||
kwxMacBrushColour ,
|
||||
kwxMacBrushTheme ,
|
||||
kwxMacBrushThemeBackground
|
||||
} wxMacBrushKind ;
|
||||
|
||||
// Brush
|
||||
class WXDLLEXPORT wxBrush: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
|
||||
public:
|
||||
wxBrush();
|
||||
wxBrush(short macThemeBrush ) ;
|
||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
wxBrush(const wxBrush& brush)
|
||||
: wxGDIObject()
|
||||
{ Ref(brush); }
|
||||
~wxBrush();
|
||||
wxBrush();
|
||||
wxBrush(short macThemeBrush ) ;
|
||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
wxBrush(const wxBrush& brush)
|
||||
: wxGDIObject()
|
||||
{ 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) ;
|
||||
virtual void MacSetTheme(short macThemeBrush) ;
|
||||
virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
||||
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 MacSetTheme(short macThemeBrush) ;
|
||||
virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
||||
|
||||
wxBrush& operator = (const wxBrush& brush)
|
||||
{ if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
bool operator == (const wxBrush& brush)
|
||||
{ return m_refData == brush.m_refData; }
|
||||
bool operator != (const wxBrush& brush)
|
||||
{ return m_refData != brush.m_refData; }
|
||||
wxBrush& operator = (const wxBrush& brush)
|
||||
{ if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
bool operator == (const wxBrush& brush)
|
||||
{ return m_refData == brush.m_refData; }
|
||||
bool operator != (const wxBrush& brush)
|
||||
{ return m_refData != brush.m_refData; }
|
||||
|
||||
wxMacBrushKind MacGetBrushKind() const ;
|
||||
wxMacBrushKind MacGetBrushKind() const ;
|
||||
|
||||
unsigned long MacGetThemeBackground(WXRECTPTR extent) const ;
|
||||
short MacGetTheme() const ;
|
||||
wxColour& GetColour() const ;
|
||||
int GetStyle() const ;
|
||||
wxBitmap *GetStipple() const ;
|
||||
unsigned long MacGetThemeBackground(WXRECTPTR extent) const ;
|
||||
short MacGetTheme() const ;
|
||||
wxColour& GetColour() const ;
|
||||
int GetStyle() const ;
|
||||
wxBitmap *GetStipple() const ;
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
// Implementation
|
||||
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -24,58 +24,61 @@ class WXDLLEXPORT wxBrush;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kwxMacBrushColour ,
|
||||
kwxMacBrushTheme ,
|
||||
kwxMacBrushThemeBackground
|
||||
kwxMacBrushColour ,
|
||||
kwxMacBrushTheme ,
|
||||
kwxMacBrushThemeBackground
|
||||
} wxMacBrushKind ;
|
||||
|
||||
// Brush
|
||||
class WXDLLEXPORT wxBrush: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
|
||||
public:
|
||||
wxBrush();
|
||||
wxBrush(short macThemeBrush ) ;
|
||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
wxBrush(const wxBrush& brush)
|
||||
: wxGDIObject()
|
||||
{ Ref(brush); }
|
||||
~wxBrush();
|
||||
wxBrush();
|
||||
wxBrush(short macThemeBrush ) ;
|
||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
wxBrush(const wxBrush& brush)
|
||||
: wxGDIObject()
|
||||
{ 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) ;
|
||||
virtual void SetMacTheme(short macThemeBrush) ;
|
||||
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
||||
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 SetMacTheme(short macThemeBrush) ;
|
||||
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
||||
|
||||
wxBrush& operator = (const wxBrush& brush)
|
||||
{ if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
bool operator == (const wxBrush& brush)
|
||||
{ return m_refData == brush.m_refData; }
|
||||
bool operator != (const wxBrush& brush)
|
||||
{ return m_refData != brush.m_refData; }
|
||||
wxBrush& operator = (const wxBrush& brush)
|
||||
{ if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
bool operator == (const wxBrush& brush)
|
||||
{ return m_refData == brush.m_refData; }
|
||||
bool operator != (const wxBrush& brush)
|
||||
{ return m_refData != brush.m_refData; }
|
||||
|
||||
wxMacBrushKind MacGetBrushKind() const ;
|
||||
wxMacBrushKind MacGetBrushKind() const ;
|
||||
|
||||
unsigned long GetMacThemeBackground(WXRECTPTR extent) const ;
|
||||
short GetMacTheme() const ;
|
||||
wxColour& GetColour() const ;
|
||||
int GetStyle() const ;
|
||||
wxBitmap *GetStipple() const ;
|
||||
unsigned long GetMacThemeBackground(WXRECTPTR extent) const ;
|
||||
short GetMacTheme() const ;
|
||||
wxColour& GetColour() const ;
|
||||
int GetStyle() const ;
|
||||
wxBitmap *GetStipple() const ;
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
// Implementation
|
||||
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -49,6 +49,9 @@ public:
|
||||
wxColour &GetColour() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
void SetColour(const wxColour& col);
|
||||
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
||||
void SetStyle(int style);
|
||||
|
@@ -48,6 +48,9 @@ public:
|
||||
int GetStyle() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
bool Ok() const { return m_refData != NULL; }
|
||||
|
||||
// return the HBRUSH for this brush
|
||||
|
@@ -68,6 +68,9 @@ public:
|
||||
inline wxBitmap* GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_vStipple : 0); };
|
||||
inline int GetPS(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_hBrush : 0); };
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
inline virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
//
|
||||
@@ -79,7 +82,7 @@ public:
|
||||
//
|
||||
bool RealizeResource(void);
|
||||
WXHANDLE GetResourceHandle(void) ;
|
||||
bool FreeResource(bool bForce = FALSE);
|
||||
bool FreeResource(bool bForce = false);
|
||||
bool IsFree(void) const;
|
||||
void Unshare(void);
|
||||
}; // end of CLASS wxBrush
|
||||
|
@@ -48,6 +48,9 @@ public:
|
||||
int GetStyle() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
bool Ok() const { return m_refData != NULL; }
|
||||
|
||||
// return the HBRUSH for this brush
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 17/09/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart, Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BRUSH_H_
|
||||
@@ -51,6 +51,9 @@ public:
|
||||
wxColour &GetColour() const;
|
||||
wxBitmap *GetStipple() const;
|
||||
|
||||
bool IsHatch() const
|
||||
{ return (GetStyle()>=wxBDIAGONAL_HATCH) && (GetStyle()<=wxVERTICAL_HATCH); }
|
||||
|
||||
void SetColour( const wxColour& col );
|
||||
void SetColour( unsigned char r, unsigned char g, unsigned char b );
|
||||
void SetStyle( int style );
|
||||
|
@@ -225,11 +225,11 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
|
||||
wxGCPool[i].m_gc = gdk_gc_new( window );
|
||||
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
|
||||
wxGCPool[i].m_type = type;
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
}
|
||||
if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_type == type))
|
||||
{
|
||||
wxGCPool[i].m_used = TRUE;
|
||||
wxGCPool[i].m_used = true;
|
||||
return wxGCPool[i].m_gc;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
|
||||
wxGCPool[wxGCPoolSize].m_gc = gdk_gc_new( window );
|
||||
gdk_gc_set_exposures( wxGCPool[wxGCPoolSize].m_gc, FALSE );
|
||||
wxGCPool[wxGCPoolSize].m_type = type;
|
||||
wxGCPool[wxGCPoolSize].m_used = TRUE;
|
||||
wxGCPool[wxGCPoolSize].m_used = true;
|
||||
|
||||
// Set new value of pool size.
|
||||
wxGCPoolSize += GC_POOL_ALLOC_SIZE;
|
||||
@@ -270,7 +270,7 @@ static void wxFreePoolGC( GdkGC *gc )
|
||||
{
|
||||
if (wxGCPool[i].m_gc == gc)
|
||||
{
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -291,8 +291,8 @@ wxWindowDC::wxWindowDC()
|
||||
m_textGC = (GdkGC *) NULL;
|
||||
m_bgGC = (GdkGC *) NULL;
|
||||
m_cmap = (GdkColormap *) NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
#ifdef __WXGTK20__
|
||||
m_context = (PangoContext *)NULL;
|
||||
@@ -311,8 +311,8 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
m_bgGC = (GdkGC *) NULL;
|
||||
m_cmap = (GdkColormap *) NULL;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_font = window->GetFont();
|
||||
|
||||
GtkWidget *widget = window->m_wxwindow;
|
||||
@@ -341,7 +341,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
if (!m_window)
|
||||
{
|
||||
// Don't report problems as per MSW.
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ wxWindowDC::~wxWindowDC()
|
||||
|
||||
void wxWindowDC::SetUpDC()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
wxASSERT_MSG( !m_penGC, wxT("GCs already created") );
|
||||
|
||||
@@ -486,7 +486,7 @@ bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
|
||||
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
@@ -1038,7 +1038,7 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||
{
|
||||
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, true );
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
||||
@@ -1203,11 +1203,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
bool useMask,
|
||||
wxCoord xsrcMask, wxCoord ysrcMask )
|
||||
{
|
||||
wxCHECK_MSG( Ok(), FALSE, wxT("invalid window dc") );
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid window dc") );
|
||||
|
||||
wxCHECK_MSG( source, FALSE, wxT("invalid source dc") );
|
||||
wxCHECK_MSG( source, false, wxT("invalid source dc") );
|
||||
|
||||
if (!m_window) return FALSE;
|
||||
if (!m_window) return false;
|
||||
|
||||
// transform the source DC coords to the device ones
|
||||
xsrc = source->XLOG2DEV(xsrc);
|
||||
@@ -1216,8 +1216,8 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
wxClientDC *srcDC = (wxClientDC*)source;
|
||||
wxMemoryDC *memDC = (wxMemoryDC*)source;
|
||||
|
||||
bool use_bitmap_method = FALSE;
|
||||
bool is_mono = FALSE;
|
||||
bool use_bitmap_method = false;
|
||||
bool is_mono = false;
|
||||
|
||||
// TODO: use the mask origin when drawing transparently
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
@@ -1228,7 +1228,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
if (srcDC->m_isMemDC)
|
||||
{
|
||||
if (!memDC->m_selected.Ok()) return FALSE;
|
||||
if (!memDC->m_selected.Ok()) return false;
|
||||
|
||||
is_mono = (memDC->m_selected.GetDepth() == 1);
|
||||
|
||||
@@ -1243,14 +1243,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
// we HAVE TO use the direct way for memory dcs
|
||||
// that have mask since the XCopyArea doesn't know
|
||||
// about masks
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if (is_mono)
|
||||
{
|
||||
// we HAVE TO use the direct way for memory dcs
|
||||
// that are bitmaps because XCopyArea doesn't cope
|
||||
// with different bit depths
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if ((xsrc == 0) && (ysrc == 0) &&
|
||||
(width == memDC->m_selected.GetWidth()) &&
|
||||
@@ -1260,11 +1260,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
// in the memory dc is copied in which case XCopyArea
|
||||
// wouldn't be able able to boost performace by reducing
|
||||
// the area to be scaled
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_bitmap_method = FALSE;
|
||||
use_bitmap_method = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1284,7 +1284,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
wxRegion tmp( xx,yy,ww,hh );
|
||||
tmp.Intersect( m_currentClippingRegion );
|
||||
if (tmp.IsEmpty())
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int old_logical_func = m_logicalFunction;
|
||||
@@ -1464,7 +1464,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
SetLogicalFunction( old_logical_func );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
@@ -1725,7 +1725,7 @@ void wxWindowDC::DoGetTextExtent(const wxString &string,
|
||||
if ( externalLeading )
|
||||
*externalLeading = 0;
|
||||
|
||||
if (string.IsEmpty())
|
||||
if (string.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2093,7 +2093,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_brush.GetStyle()))
|
||||
if (m_brush.IsHatch())
|
||||
{
|
||||
gdk_gc_set_fill( m_brushGC, GDK_STIPPLED );
|
||||
int num = m_brush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -2138,7 +2138,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_backgroundBrush.GetStyle()))
|
||||
if (m_backgroundBrush.IsHatch())
|
||||
{
|
||||
gdk_gc_set_fill( m_bgGC, GDK_STIPPLED );
|
||||
int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -2494,7 +2494,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
|
||||
bool wxDCModule::OnInit()
|
||||
{
|
||||
wxInitGCPool();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDCModule::OnExit()
|
||||
|
@@ -225,11 +225,11 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
|
||||
wxGCPool[i].m_gc = gdk_gc_new( window );
|
||||
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
|
||||
wxGCPool[i].m_type = type;
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
}
|
||||
if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_type == type))
|
||||
{
|
||||
wxGCPool[i].m_used = TRUE;
|
||||
wxGCPool[i].m_used = true;
|
||||
return wxGCPool[i].m_gc;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
|
||||
wxGCPool[wxGCPoolSize].m_gc = gdk_gc_new( window );
|
||||
gdk_gc_set_exposures( wxGCPool[wxGCPoolSize].m_gc, FALSE );
|
||||
wxGCPool[wxGCPoolSize].m_type = type;
|
||||
wxGCPool[wxGCPoolSize].m_used = TRUE;
|
||||
wxGCPool[wxGCPoolSize].m_used = true;
|
||||
|
||||
// Set new value of pool size.
|
||||
wxGCPoolSize += GC_POOL_ALLOC_SIZE;
|
||||
@@ -270,7 +270,7 @@ static void wxFreePoolGC( GdkGC *gc )
|
||||
{
|
||||
if (wxGCPool[i].m_gc == gc)
|
||||
{
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -291,8 +291,8 @@ wxWindowDC::wxWindowDC()
|
||||
m_textGC = (GdkGC *) NULL;
|
||||
m_bgGC = (GdkGC *) NULL;
|
||||
m_cmap = (GdkColormap *) NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
#ifdef __WXGTK20__
|
||||
m_context = (PangoContext *)NULL;
|
||||
@@ -311,8 +311,8 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
m_bgGC = (GdkGC *) NULL;
|
||||
m_cmap = (GdkColormap *) NULL;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_font = window->GetFont();
|
||||
|
||||
GtkWidget *widget = window->m_wxwindow;
|
||||
@@ -341,7 +341,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
if (!m_window)
|
||||
{
|
||||
// Don't report problems as per MSW.
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ wxWindowDC::~wxWindowDC()
|
||||
|
||||
void wxWindowDC::SetUpDC()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
wxASSERT_MSG( !m_penGC, wxT("GCs already created") );
|
||||
|
||||
@@ -486,7 +486,7 @@ bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
|
||||
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
@@ -1038,7 +1038,7 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||
{
|
||||
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, true );
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
||||
@@ -1203,11 +1203,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
bool useMask,
|
||||
wxCoord xsrcMask, wxCoord ysrcMask )
|
||||
{
|
||||
wxCHECK_MSG( Ok(), FALSE, wxT("invalid window dc") );
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid window dc") );
|
||||
|
||||
wxCHECK_MSG( source, FALSE, wxT("invalid source dc") );
|
||||
wxCHECK_MSG( source, false, wxT("invalid source dc") );
|
||||
|
||||
if (!m_window) return FALSE;
|
||||
if (!m_window) return false;
|
||||
|
||||
// transform the source DC coords to the device ones
|
||||
xsrc = source->XLOG2DEV(xsrc);
|
||||
@@ -1216,8 +1216,8 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
wxClientDC *srcDC = (wxClientDC*)source;
|
||||
wxMemoryDC *memDC = (wxMemoryDC*)source;
|
||||
|
||||
bool use_bitmap_method = FALSE;
|
||||
bool is_mono = FALSE;
|
||||
bool use_bitmap_method = false;
|
||||
bool is_mono = false;
|
||||
|
||||
// TODO: use the mask origin when drawing transparently
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
@@ -1228,7 +1228,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
if (srcDC->m_isMemDC)
|
||||
{
|
||||
if (!memDC->m_selected.Ok()) return FALSE;
|
||||
if (!memDC->m_selected.Ok()) return false;
|
||||
|
||||
is_mono = (memDC->m_selected.GetDepth() == 1);
|
||||
|
||||
@@ -1243,14 +1243,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
// we HAVE TO use the direct way for memory dcs
|
||||
// that have mask since the XCopyArea doesn't know
|
||||
// about masks
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if (is_mono)
|
||||
{
|
||||
// we HAVE TO use the direct way for memory dcs
|
||||
// that are bitmaps because XCopyArea doesn't cope
|
||||
// with different bit depths
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if ((xsrc == 0) && (ysrc == 0) &&
|
||||
(width == memDC->m_selected.GetWidth()) &&
|
||||
@@ -1260,11 +1260,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
// in the memory dc is copied in which case XCopyArea
|
||||
// wouldn't be able able to boost performace by reducing
|
||||
// the area to be scaled
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_bitmap_method = FALSE;
|
||||
use_bitmap_method = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1284,7 +1284,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
wxRegion tmp( xx,yy,ww,hh );
|
||||
tmp.Intersect( m_currentClippingRegion );
|
||||
if (tmp.IsEmpty())
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int old_logical_func = m_logicalFunction;
|
||||
@@ -1464,7 +1464,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
SetLogicalFunction( old_logical_func );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
@@ -1725,7 +1725,7 @@ void wxWindowDC::DoGetTextExtent(const wxString &string,
|
||||
if ( externalLeading )
|
||||
*externalLeading = 0;
|
||||
|
||||
if (string.IsEmpty())
|
||||
if (string.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2093,7 +2093,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_brush.GetStyle()))
|
||||
if (m_brush.IsHatch())
|
||||
{
|
||||
gdk_gc_set_fill( m_brushGC, GDK_STIPPLED );
|
||||
int num = m_brush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -2138,7 +2138,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_backgroundBrush.GetStyle()))
|
||||
if (m_backgroundBrush.IsHatch())
|
||||
{
|
||||
gdk_gc_set_fill( m_bgGC, GDK_STIPPLED );
|
||||
int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -2494,7 +2494,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
|
||||
bool wxDCModule::OnInit()
|
||||
{
|
||||
wxInitGCPool();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDCModule::OnExit()
|
||||
|
@@ -79,21 +79,21 @@ class wxMacFastPortSetter
|
||||
public :
|
||||
wxMacFastPortSetter( const wxDC *dc )
|
||||
{
|
||||
wxASSERT( dc->Ok() ) ;
|
||||
m_swapped = QDSwapPort( (GrafPtr) dc->m_macPort , &m_oldPort ) ;
|
||||
m_clipRgn = NewRgn() ;
|
||||
GetClip( m_clipRgn ) ;
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort( NULL ) ;
|
||||
wxASSERT( dc->Ok() ) ;
|
||||
m_swapped = QDSwapPort( (GrafPtr) dc->m_macPort , &m_oldPort ) ;
|
||||
m_clipRgn = NewRgn() ;
|
||||
GetClip( m_clipRgn ) ;
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort( NULL ) ;
|
||||
}
|
||||
~wxMacFastPortSetter()
|
||||
{
|
||||
// SetPort( (GrafPtr) m_dc->m_macPort ) ;
|
||||
SetClip( m_clipRgn ) ;
|
||||
if ( m_swapped )
|
||||
SetPort( m_oldPort ) ;
|
||||
m_dc->MacCleanupPort( NULL ) ;
|
||||
DisposeRgn( m_clipRgn ) ;
|
||||
SetPort( m_oldPort ) ;
|
||||
m_dc->MacCleanupPort( NULL ) ;
|
||||
DisposeRgn( m_clipRgn ) ;
|
||||
}
|
||||
private :
|
||||
bool m_swapped ;
|
||||
@@ -249,8 +249,8 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
|
||||
|
||||
wxDC::wxDC()
|
||||
{
|
||||
m_ok = FALSE;
|
||||
m_colour = TRUE;
|
||||
m_ok = false;
|
||||
m_colour = true;
|
||||
m_mm_to_pix_x = mm2pt;
|
||||
m_mm_to_pix_y = mm2pt;
|
||||
m_internalDeviceOriginX = 0;
|
||||
@@ -263,11 +263,11 @@ wxDC::wxDC()
|
||||
m_userScaleY = 1.0;
|
||||
m_scaleX = 1.0;
|
||||
m_scaleY = 1.0;
|
||||
m_needComputeScaleX = FALSE;
|
||||
m_needComputeScaleY = FALSE;
|
||||
m_needComputeScaleX = false;
|
||||
m_needComputeScaleY = false;
|
||||
m_macPort = NULL ;
|
||||
m_macMask = NULL ;
|
||||
m_ok = FALSE ;
|
||||
m_ok = false ;
|
||||
m_macFontInstalled = false ;
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
@@ -453,7 +453,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
}
|
||||
else
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipping = true;
|
||||
m_clipX1 = xx;
|
||||
m_clipY1 = yy;
|
||||
m_clipX2 = xx + ww;
|
||||
@@ -500,7 +500,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipping = true;
|
||||
m_clipX1 = xx;
|
||||
m_clipY1 = yy;
|
||||
m_clipX2 = xx + ww;
|
||||
@@ -562,8 +562,8 @@ void wxDC::SetMapMode( int mode )
|
||||
}
|
||||
if (mode != wxMM_TEXT)
|
||||
{
|
||||
m_needComputeScaleX = TRUE;
|
||||
m_needComputeScaleY = TRUE;
|
||||
m_needComputeScaleX = true;
|
||||
m_needComputeScaleY = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit Illegal dc"));
|
||||
wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC"));
|
||||
if ( logical_func == wxNO_OP )
|
||||
return TRUE ;
|
||||
return true ;
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
{
|
||||
xsrcMask = xsrc; ysrcMask = ysrc;
|
||||
@@ -1143,7 +1143,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
if ( mode == kUnsupportedMode )
|
||||
{
|
||||
wxFAIL_MSG(wxT("unsupported blitting mode" ));
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
||||
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
||||
@@ -1302,7 +1302,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
m_macPenInstalled = false ;
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef FixedToInt
|
||||
@@ -1341,16 +1341,16 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
||||
UniCharCount chars = str.Length() ;
|
||||
UniChar* ubuf = NULL ;
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
wxMBConvUTF16BE converter ;
|
||||
wxMBConvUTF16BE converter ;
|
||||
#if wxUSE_UNICODE
|
||||
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
|
||||
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , str.wc_str(), unicharlen + 2 ) ;
|
||||
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
|
||||
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , str.wc_str(), unicharlen + 2 ) ;
|
||||
#else
|
||||
const wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ;
|
||||
size_t unicharlen = converter.WC2MB( NULL , wchar.data() , 0 ) ;
|
||||
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , wchar.data() , unicharlen + 2 ) ;
|
||||
size_t unicharlen = converter.WC2MB( NULL , wchar.data() , 0 ) ;
|
||||
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , wchar.data() , unicharlen + 2 ) ;
|
||||
#endif
|
||||
chars = unicharlen / 2 ;
|
||||
#else
|
||||
@@ -1958,7 +1958,7 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
int brushStyle = background.GetStyle();
|
||||
if (brushStyle == wxSOLID)
|
||||
::BackPat(GetQDGlobalsWhite(&whiteColor));
|
||||
else if (IS_HATCH(brushStyle))
|
||||
else if (background.IsHatch())
|
||||
{
|
||||
Pattern pat ;
|
||||
wxMacGetPattern(brushStyle, &pat);
|
||||
@@ -1989,7 +1989,7 @@ void wxDC::MacInstallBrush() const
|
||||
{
|
||||
::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
}
|
||||
else if (IS_HATCH(brushStyle))
|
||||
else if (m_brush.IsHatch())
|
||||
{
|
||||
Pattern pat ;
|
||||
wxMacGetPattern(brushStyle, &pat);
|
||||
|
@@ -78,21 +78,21 @@ class wxMacFastPortSetter
|
||||
public :
|
||||
wxMacFastPortSetter( const wxDC *dc )
|
||||
{
|
||||
wxASSERT( dc->Ok() ) ;
|
||||
GetPort( &m_oldPort ) ;
|
||||
SetPort( (GrafPtr) dc->m_macPort ) ;
|
||||
m_clipRgn = NewRgn() ;
|
||||
GetClip( m_clipRgn ) ;
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort( NULL ) ;
|
||||
wxASSERT( dc->Ok() ) ;
|
||||
GetPort( &m_oldPort ) ;
|
||||
SetPort( (GrafPtr) dc->m_macPort ) ;
|
||||
m_clipRgn = NewRgn() ;
|
||||
GetClip( m_clipRgn ) ;
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort( NULL ) ;
|
||||
}
|
||||
~wxMacFastPortSetter()
|
||||
{
|
||||
SetPort( (GrafPtr) m_dc->m_macPort ) ;
|
||||
SetClip( m_clipRgn ) ;
|
||||
SetPort( m_oldPort ) ;
|
||||
m_dc->MacCleanupPort( NULL ) ;
|
||||
DisposeRgn( m_clipRgn ) ;
|
||||
SetPort( m_oldPort ) ;
|
||||
m_dc->MacCleanupPort( NULL ) ;
|
||||
DisposeRgn( m_clipRgn ) ;
|
||||
}
|
||||
private :
|
||||
RgnHandle m_clipRgn ;
|
||||
@@ -269,8 +269,8 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
|
||||
|
||||
wxDC::wxDC()
|
||||
{
|
||||
m_ok = FALSE;
|
||||
m_colour = TRUE;
|
||||
m_ok = false;
|
||||
m_colour = true;
|
||||
m_mm_to_pix_x = mm2pt;
|
||||
m_mm_to_pix_y = mm2pt;
|
||||
m_internalDeviceOriginX = 0;
|
||||
@@ -283,11 +283,11 @@ wxDC::wxDC()
|
||||
m_userScaleY = 1.0;
|
||||
m_scaleX = 1.0;
|
||||
m_scaleY = 1.0;
|
||||
m_needComputeScaleX = FALSE;
|
||||
m_needComputeScaleY = FALSE;
|
||||
m_needComputeScaleX = false;
|
||||
m_needComputeScaleY = false;
|
||||
m_macPort = NULL ;
|
||||
m_macMask = NULL ;
|
||||
m_ok = FALSE ;
|
||||
m_ok = false ;
|
||||
m_macFontInstalled = false ;
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
@@ -473,7 +473,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
}
|
||||
else
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipping = true;
|
||||
m_clipX1 = xx;
|
||||
m_clipY1 = yy;
|
||||
m_clipX2 = xx + ww;
|
||||
@@ -520,7 +520,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipping = true;
|
||||
m_clipX1 = xx;
|
||||
m_clipY1 = yy;
|
||||
m_clipX2 = xx + ww;
|
||||
@@ -582,8 +582,8 @@ void wxDC::SetMapMode( int mode )
|
||||
}
|
||||
if (mode != wxMM_TEXT)
|
||||
{
|
||||
m_needComputeScaleX = TRUE;
|
||||
m_needComputeScaleY = TRUE;
|
||||
m_needComputeScaleX = true;
|
||||
m_needComputeScaleY = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,7 +1100,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit Illegal dc"));
|
||||
wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC"));
|
||||
if ( logical_func == wxNO_OP )
|
||||
return TRUE ;
|
||||
return true ;
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
{
|
||||
xsrcMask = xsrc; ysrcMask = ysrc;
|
||||
@@ -1179,7 +1179,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
if ( mode == kUnsupportedMode )
|
||||
{
|
||||
wxFAIL_MSG(wxT("unsupported blitting mode" ));
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
||||
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
||||
@@ -1338,7 +1338,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
m_macPenInstalled = false ;
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef FixedToInt
|
||||
@@ -2093,7 +2093,7 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
int brushStyle = background.GetStyle();
|
||||
if (brushStyle == wxSOLID)
|
||||
::BackPat(GetQDGlobalsWhite(&whiteColor));
|
||||
else if (IS_HATCH(brushStyle))
|
||||
else if (background.IsHatch())
|
||||
{
|
||||
Pattern pat ;
|
||||
wxMacGetPattern(brushStyle, &pat);
|
||||
@@ -2123,7 +2123,7 @@ void wxDC::MacInstallBrush() const
|
||||
{
|
||||
::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
}
|
||||
else if (IS_HATCH(brushStyle))
|
||||
else if (m_brush.IsHatch())
|
||||
{
|
||||
Pattern pat ;
|
||||
wxMacGetPattern(brushStyle, &pat);
|
||||
|
@@ -86,9 +86,15 @@ static Pixmap bdiag, cdiag, fdiag, cross, horiz, verti;
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||
|
||||
#ifndef IS_HATCH
|
||||
// IS_HATCH exists for WXWIN_COMPATIBILITY_2_4 only
|
||||
// but wxMotif needs it for its internals here
|
||||
#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// prototypes
|
||||
@@ -163,7 +169,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
|
||||
m_window = window;
|
||||
m_font = window->GetFont();
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
m_display = window->GetXDisplay();
|
||||
m_pixmap = window->GetXWindow();
|
||||
@@ -242,7 +248,7 @@ bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
|
||||
memdc.SelectObject(wxNullBitmap);
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
@@ -781,9 +787,9 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
|
||||
bool wxWindowDC::CanDrawBitmap() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), FALSE, "invalid dc" );
|
||||
wxCHECK_MSG( Ok(), false, "invalid dc" );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: use scaled Blit e.g. as per John Price's implementation
|
||||
@@ -794,7 +800,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
int rop, bool useMask,
|
||||
wxCoord xsrcMask, wxCoord ysrcMask )
|
||||
{
|
||||
wxCHECK_MSG( Ok(), FALSE, "invalid dc" );
|
||||
wxCHECK_MSG( Ok(), false, "invalid dc" );
|
||||
|
||||
wxWindowDC* sourceDC = wxDynamicCast(source, wxWindowDC);
|
||||
|
||||
@@ -823,7 +829,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
if( m_textForegroundColour.GetPixel() <= -1 )
|
||||
CalculatePixel( m_textForegroundColour,
|
||||
m_textForegroundColour, TRUE);
|
||||
m_textForegroundColour, true);
|
||||
|
||||
int pixel = m_textForegroundColour.GetPixel();
|
||||
if (pixel > -1)
|
||||
@@ -836,7 +842,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
Pixmap sourcePixmap = (Pixmap) NULL;
|
||||
double scaleX, scaleY;
|
||||
GetUserScale(& scaleX, & scaleY);
|
||||
bool retVal = FALSE;
|
||||
bool retVal = false;
|
||||
|
||||
/* TODO: use the mask origin when drawing transparently */
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
@@ -997,7 +1003,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
|
||||
|
||||
SetLogicalFunction(orig);
|
||||
|
||||
retVal = TRUE;
|
||||
retVal = true;
|
||||
}
|
||||
if (scaledBitmap) delete scaledBitmap;
|
||||
|
||||
@@ -1115,7 +1121,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
if (!sameColour || !GetOptimization())
|
||||
{
|
||||
int pixel = CalculatePixel(m_textForegroundColour,
|
||||
m_currentColour, FALSE);
|
||||
m_currentColour, false);
|
||||
|
||||
// Set the GC to the required colour
|
||||
if (pixel > -1)
|
||||
@@ -1191,7 +1197,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
||||
|
||||
if( m_textForegroundColour.GetPixel() <= -1 )
|
||||
CalculatePixel( m_textForegroundColour,
|
||||
m_textForegroundColour, TRUE);
|
||||
m_textForegroundColour, true);
|
||||
|
||||
foregroundPixel = m_textForegroundColour.GetPixel();
|
||||
}
|
||||
@@ -1323,7 +1329,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
||||
|
||||
bool wxWindowDC::CanGetTextExtent() const
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
|
||||
@@ -1789,7 +1795,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
||||
pixel = m_backgroundPixel;
|
||||
else
|
||||
{
|
||||
pixel = CalculatePixel(m_pen.GetColour(), m_currentColour, FALSE);
|
||||
pixel = CalculatePixel(m_pen.GetColour(), m_currentColour, false);
|
||||
}
|
||||
|
||||
// Finally, set the GC to the required colour
|
||||
@@ -1951,7 +1957,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
// must test m_logicalFunction, because it involves background!
|
||||
if (!sameColour || !GetOptimization() || m_logicalFunction == wxXOR)
|
||||
{
|
||||
int pixel = CalculatePixel(m_brush.GetColour(), m_currentColour, TRUE);
|
||||
int pixel = CalculatePixel(m_brush.GetColour(), m_currentColour, true);
|
||||
|
||||
if (pixel > -1)
|
||||
SetForegroundPixelWithLogicalFunction(pixel);
|
||||
|
@@ -127,11 +127,11 @@ static GC wxGetPoolGC( Window window, wxPoolGCType type )
|
||||
wxGCPool[i].m_gc = XCreateGC( wxGlobalDisplay(), window, 0, NULL );
|
||||
XSetGraphicsExposures( wxGlobalDisplay(), wxGCPool[i].m_gc, FALSE );
|
||||
wxGCPool[i].m_type = type;
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
}
|
||||
if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_type == type))
|
||||
{
|
||||
wxGCPool[i].m_used = TRUE;
|
||||
wxGCPool[i].m_used = true;
|
||||
return wxGCPool[i].m_gc;
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ static void wxFreePoolGC( GC gc )
|
||||
{
|
||||
if (wxGCPool[i].m_gc == gc)
|
||||
{
|
||||
wxGCPool[i].m_used = FALSE;
|
||||
wxGCPool[i].m_used = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -169,8 +169,8 @@ wxWindowDC::wxWindowDC()
|
||||
m_textGC = (WXGC *) NULL;
|
||||
m_bgGC = (WXGC *) NULL;
|
||||
m_cmap = (WXColormap *) NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
@@ -190,8 +190,8 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
m_bgGC = (WXGC *) NULL;
|
||||
m_cmap = (WXColormap *) NULL;
|
||||
m_owner = (wxWindow *)NULL;
|
||||
m_isMemDC = FALSE;
|
||||
m_isScreenDC = FALSE;
|
||||
m_isMemDC = false;
|
||||
m_isScreenDC = false;
|
||||
m_font = window->GetFont();
|
||||
|
||||
m_window = (WXWindow*) window->GetMainWindow();
|
||||
@@ -200,7 +200,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
if (!m_window)
|
||||
{
|
||||
// don't report problems
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ wxWindowDC::~wxWindowDC()
|
||||
|
||||
void wxWindowDC::SetUpDC()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
m_ok = true;
|
||||
|
||||
wxASSERT_MSG( !m_penGC, wxT("GCs already created") );
|
||||
|
||||
@@ -356,7 +356,7 @@ bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
|
||||
memdc.SelectObject(wxNullBitmap);
|
||||
wxImage image(bitmap.ConvertToImage());
|
||||
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
@@ -993,7 +993,7 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
|
||||
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y)
|
||||
{
|
||||
DoDrawBitmap(icon, x, y, TRUE);
|
||||
DoDrawBitmap(icon, x, y, true);
|
||||
}
|
||||
|
||||
#if wxUSE_NANOX
|
||||
@@ -1257,11 +1257,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
of the source dc, but scales correctly on the target dc and
|
||||
knows about possible mask information in a memory dc. */
|
||||
|
||||
wxCHECK_MSG( Ok(), FALSE, wxT("invalid window dc") );
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid window dc") );
|
||||
|
||||
wxCHECK_MSG( source, FALSE, wxT("invalid source dc") );
|
||||
wxCHECK_MSG( source, false, wxT("invalid source dc") );
|
||||
|
||||
if (!m_window) return FALSE;
|
||||
if (!m_window) return false;
|
||||
|
||||
// transform the source DC coords to the device ones
|
||||
xsrc = source->XLOG2DEV(xsrc);
|
||||
@@ -1270,8 +1270,8 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
wxClientDC *srcDC = (wxClientDC*)source;
|
||||
wxMemoryDC *memDC = (wxMemoryDC*)source;
|
||||
|
||||
bool use_bitmap_method = FALSE;
|
||||
bool is_mono = FALSE;
|
||||
bool use_bitmap_method = false;
|
||||
bool is_mono = false;
|
||||
|
||||
// TODO: use the mask origin when drawing transparently
|
||||
if (xsrcMask == -1 && ysrcMask == -1)
|
||||
@@ -1282,7 +1282,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
|
||||
if (srcDC->m_isMemDC)
|
||||
{
|
||||
if (!memDC->m_selected.Ok()) return FALSE;
|
||||
if (!memDC->m_selected.Ok()) return false;
|
||||
|
||||
/* we use the "XCopyArea" way to copy a memory dc into
|
||||
y different window if the memory dc BOTH
|
||||
@@ -1295,15 +1295,15 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
/* we HAVE TO use the direct way for memory dcs
|
||||
that have mask since the XCopyArea doesn't know
|
||||
about masks */
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if (memDC->m_selected.GetDepth() == 1)
|
||||
{
|
||||
/* we HAVE TO use the direct way for memory dcs
|
||||
that are bitmaps because XCopyArea doesn't cope
|
||||
with different bit depths */
|
||||
is_mono = TRUE;
|
||||
use_bitmap_method = TRUE;
|
||||
is_mono = true;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else if ((xsrc == 0) && (ysrc == 0) &&
|
||||
(width == memDC->m_selected.GetWidth()) &&
|
||||
@@ -1313,11 +1313,11 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
in the memory dc is copied in which case XCopyArea
|
||||
wouldn't be able able to boost performace by reducing
|
||||
the area to be scaled */
|
||||
use_bitmap_method = TRUE;
|
||||
use_bitmap_method = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_bitmap_method = FALSE;
|
||||
use_bitmap_method = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,7 +1337,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
wxRegion tmp( xx,yy,ww,hh );
|
||||
tmp.Intersect( m_currentClippingRegion );
|
||||
if (tmp.IsEmpty())
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int old_logical_func = m_logicalFunction;
|
||||
@@ -1500,7 +1500,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
||||
|
||||
SetLogicalFunction( old_logical_func );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
@@ -1602,7 +1602,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
||||
|
||||
if (string.IsEmpty())
|
||||
if (string.empty())
|
||||
{
|
||||
if (width) (*width) = 0;
|
||||
if (height) (*height) = 0;
|
||||
@@ -1935,7 +1935,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
XSetStipple( (Display*) m_display, (GC) m_textGC, (Pixmap) m_brush.GetStipple()->GetMask()->GetBitmap() );
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_brush.GetStyle()))
|
||||
if (m_brush.IsHatch())
|
||||
{
|
||||
XSetFillStyle( (Display*) m_display, (GC) m_brushGC, FillStippled );
|
||||
int num = m_brush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -1980,7 +1980,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_backgroundBrush.GetStyle()))
|
||||
if (m_backgroundBrush.IsHatch())
|
||||
{
|
||||
XSetFillStyle( (Display*) m_display, (GC) m_bgGC, FillStippled );
|
||||
int num = m_backgroundBrush.GetStyle() - wxBDIAGONAL_HATCH;
|
||||
@@ -2355,7 +2355,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
|
||||
bool wxDCModule::OnInit()
|
||||
{
|
||||
wxInitGCPool();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDCModule::OnExit()
|
||||
|
Reference in New Issue
Block a user