Lotta stuff for drawing etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -115,6 +115,7 @@ public:
 | 
				
			|||||||
    GdkGC        *m_bgGC;
 | 
					    GdkGC        *m_bgGC;
 | 
				
			||||||
    GdkColormap  *m_cmap;
 | 
					    GdkColormap  *m_cmap;
 | 
				
			||||||
    bool          m_isMemDC;
 | 
					    bool          m_isMemDC;
 | 
				
			||||||
 | 
					    bool          m_isScreenDC;
 | 
				
			||||||
    wxWindow     *m_owner;
 | 
					    wxWindow     *m_owner;
 | 
				
			||||||
    wxRegion      m_currentClippingRegion;
 | 
					    wxRegion      m_currentClippingRegion;
 | 
				
			||||||
    wxRegion      m_paintClippingRegion;
 | 
					    wxRegion      m_paintClippingRegion;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,8 @@ public:
 | 
				
			|||||||
    virtual bool GetVisible() { return m_visible; }
 | 
					    virtual bool GetVisible() { return m_visible; }
 | 
				
			||||||
    virtual void SetVisible( bool visible ) { m_visible = visible; }
 | 
					    virtual void SetVisible( bool visible ) { m_visible = visible; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool IsNull() const { return (m_refData == 0); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
    bool m_visible; /* can a pointer to this object be safely taken?
 | 
					    bool m_visible; /* can a pointer to this object be safely taken?
 | 
				
			||||||
                     * - only if created within FindOrCreate... */
 | 
					                     * - only if created within FindOrCreate... */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,16 +30,19 @@ class wxRegion;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
enum wxRegionContain
 | 
					enum wxRegionContain
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
 | 
					    wxOutRegion = 0, 
 | 
				
			||||||
 | 
					    wxPartRegion = 1, 
 | 
				
			||||||
 | 
					    wxInRegion = 2
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// So far, for internal use only
 | 
					// So far, for internal use only
 | 
				
			||||||
enum wxRegionOp {
 | 
					enum wxRegionOp 
 | 
				
			||||||
wxRGN_AND,          // Creates the intersection of the two combined regions.
 | 
					{
 | 
				
			||||||
wxRGN_COPY,         // Creates a copy of the region identified by hrgnSrc1.
 | 
					   wxRGN_AND,          // Creates the intersection of the two combined regions.
 | 
				
			||||||
wxRGN_DIFF,         // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
 | 
					   wxRGN_COPY,         // Creates a copy of the region identified by hrgnSrc1.
 | 
				
			||||||
wxRGN_OR,           // Creates the union of two combined regions.
 | 
					   wxRGN_DIFF,         // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
 | 
				
			||||||
wxRGN_XOR           // Creates the union of two combined regions except for any overlapping areas.
 | 
					   wxRGN_OR,           // Creates the union of two combined regions.
 | 
				
			||||||
 | 
					   wxRGN_XOR           // Creates the union of two combined regions except for any overlapping areas.
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
@@ -48,10 +51,7 @@ wxRGN_XOR           // Creates the union of two combined regions except for any
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class wxRegion : public wxGDIObject
 | 
					class wxRegion : public wxGDIObject
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  DECLARE_DYNAMIC_CLASS(wxRegion);
 | 
					public:
 | 
				
			||||||
 | 
					 | 
				
			||||||
  public:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    wxRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h );
 | 
					    wxRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h );
 | 
				
			||||||
    wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
 | 
					    wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
 | 
				
			||||||
    wxRegion( const wxRect& rect );
 | 
					    wxRegion( const wxRect& rect );
 | 
				
			||||||
@@ -95,10 +95,12 @@ class wxRegion : public wxGDIObject
 | 
				
			|||||||
    wxRegionContain Contains(const wxPoint& pt) const;
 | 
					    wxRegionContain Contains(const wxPoint& pt) const;
 | 
				
			||||||
    wxRegionContain Contains(const wxRect& rect) const;
 | 
					    wxRegionContain Contains(const wxRect& rect) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public:
 | 
					public:
 | 
				
			||||||
 | 
					 | 
				
			||||||
    wxList    *GetRectList() const;
 | 
					    wxList    *GetRectList() const;
 | 
				
			||||||
    GdkRegion *GetRegion() const;
 | 
					    GdkRegion *GetRegion() const;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					  DECLARE_DYNAMIC_CLASS(wxRegion);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class wxRegionIterator: public wxObject
 | 
					class wxRegionIterator: public wxObject
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -115,6 +115,7 @@ public:
 | 
				
			|||||||
    GdkGC        *m_bgGC;
 | 
					    GdkGC        *m_bgGC;
 | 
				
			||||||
    GdkColormap  *m_cmap;
 | 
					    GdkColormap  *m_cmap;
 | 
				
			||||||
    bool          m_isMemDC;
 | 
					    bool          m_isMemDC;
 | 
				
			||||||
 | 
					    bool          m_isScreenDC;
 | 
				
			||||||
    wxWindow     *m_owner;
 | 
					    wxWindow     *m_owner;
 | 
				
			||||||
    wxRegion      m_currentClippingRegion;
 | 
					    wxRegion      m_currentClippingRegion;
 | 
				
			||||||
    wxRegion      m_paintClippingRegion;
 | 
					    wxRegion      m_paintClippingRegion;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,8 @@ public:
 | 
				
			|||||||
    virtual bool GetVisible() { return m_visible; }
 | 
					    virtual bool GetVisible() { return m_visible; }
 | 
				
			||||||
    virtual void SetVisible( bool visible ) { m_visible = visible; }
 | 
					    virtual void SetVisible( bool visible ) { m_visible = visible; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool IsNull() const { return (m_refData == 0); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
    bool m_visible; /* can a pointer to this object be safely taken?
 | 
					    bool m_visible; /* can a pointer to this object be safely taken?
 | 
				
			||||||
                     * - only if created within FindOrCreate... */
 | 
					                     * - only if created within FindOrCreate... */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,16 +30,19 @@ class wxRegion;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
enum wxRegionContain
 | 
					enum wxRegionContain
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
 | 
					    wxOutRegion = 0, 
 | 
				
			||||||
 | 
					    wxPartRegion = 1, 
 | 
				
			||||||
 | 
					    wxInRegion = 2
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// So far, for internal use only
 | 
					// So far, for internal use only
 | 
				
			||||||
enum wxRegionOp {
 | 
					enum wxRegionOp 
 | 
				
			||||||
wxRGN_AND,          // Creates the intersection of the two combined regions.
 | 
					{
 | 
				
			||||||
wxRGN_COPY,         // Creates a copy of the region identified by hrgnSrc1.
 | 
					   wxRGN_AND,          // Creates the intersection of the two combined regions.
 | 
				
			||||||
wxRGN_DIFF,         // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
 | 
					   wxRGN_COPY,         // Creates a copy of the region identified by hrgnSrc1.
 | 
				
			||||||
wxRGN_OR,           // Creates the union of two combined regions.
 | 
					   wxRGN_DIFF,         // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
 | 
				
			||||||
wxRGN_XOR           // Creates the union of two combined regions except for any overlapping areas.
 | 
					   wxRGN_OR,           // Creates the union of two combined regions.
 | 
				
			||||||
 | 
					   wxRGN_XOR           // Creates the union of two combined regions except for any overlapping areas.
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
@@ -48,10 +51,7 @@ wxRGN_XOR           // Creates the union of two combined regions except for any
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class wxRegion : public wxGDIObject
 | 
					class wxRegion : public wxGDIObject
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  DECLARE_DYNAMIC_CLASS(wxRegion);
 | 
					public:
 | 
				
			||||||
 | 
					 | 
				
			||||||
  public:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    wxRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h );
 | 
					    wxRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h );
 | 
				
			||||||
    wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
 | 
					    wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
 | 
				
			||||||
    wxRegion( const wxRect& rect );
 | 
					    wxRegion( const wxRect& rect );
 | 
				
			||||||
@@ -95,10 +95,12 @@ class wxRegion : public wxGDIObject
 | 
				
			|||||||
    wxRegionContain Contains(const wxPoint& pt) const;
 | 
					    wxRegionContain Contains(const wxPoint& pt) const;
 | 
				
			||||||
    wxRegionContain Contains(const wxRect& rect) const;
 | 
					    wxRegionContain Contains(const wxRect& rect) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public:
 | 
					public:
 | 
				
			||||||
 | 
					 | 
				
			||||||
    wxList    *GetRectList() const;
 | 
					    wxList    *GetRectList() const;
 | 
				
			||||||
    GdkRegion *GetRegion() const;
 | 
					    GdkRegion *GetRegion() const;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					  DECLARE_DYNAMIC_CLASS(wxRegion);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class wxRegionIterator: public wxObject
 | 
					class wxRegionIterator: public wxObject
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,6 +73,7 @@ static wxBitmap gs_bmpNoMask,
 | 
				
			|||||||
                gs_bmpMask,
 | 
					                gs_bmpMask,
 | 
				
			||||||
                gs_bmpWithMask,
 | 
					                gs_bmpWithMask,
 | 
				
			||||||
                gs_bmp4,
 | 
					                gs_bmp4,
 | 
				
			||||||
 | 
					                gs_bmp4_mono,
 | 
				
			||||||
                gs_bmp36;
 | 
					                gs_bmp36;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ----------------------------------------------------------------------------
 | 
					// ----------------------------------------------------------------------------
 | 
				
			||||||
@@ -243,9 +244,12 @@ bool MyApp::LoadImages()
 | 
				
			|||||||
    wxString path = pathList.FindValidPath("pat4.bmp");
 | 
					    wxString path = pathList.FindValidPath("pat4.bmp");
 | 
				
			||||||
    if ( !path )
 | 
					    if ( !path )
 | 
				
			||||||
        return FALSE;
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					    /* 4 colour bitmap */
 | 
				
			||||||
    gs_bmp4.LoadFile(path, wxBITMAP_TYPE_BMP);
 | 
					    gs_bmp4.LoadFile(path, wxBITMAP_TYPE_BMP);
 | 
				
			||||||
    wxMask* mask4 = new wxMask(gs_bmp4, *wxBLACK);
 | 
					    /* turn into mono-bitmap */
 | 
				
			||||||
    gs_bmp4.SetMask(mask4);
 | 
					    gs_bmp4_mono.LoadFile(path, wxBITMAP_TYPE_BMP);
 | 
				
			||||||
 | 
					    wxMask* mask4 = new wxMask(gs_bmp4_mono, *wxBLACK);
 | 
				
			||||||
 | 
					    gs_bmp4_mono.SetMask(mask4);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    path = pathList.FindValidPath("pat36.bmp");
 | 
					    path = pathList.FindValidPath("pat36.bmp");
 | 
				
			||||||
    if ( !path )
 | 
					    if ( !path )
 | 
				
			||||||
@@ -325,20 +329,21 @@ MyCanvas::MyCanvas( MyFrame *parent ) : wxScrolledWindow( parent )
 | 
				
			|||||||
    m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
 | 
					    m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//draw a polygon and an overlapping rectangle
 | 
					// Draw a polygon and an overlapping rectangle
 | 
				
			||||||
//is transparent is 1, the fill pattern are made transparent
 | 
					// If transparent is 1, the fill pattern is made transparent.
 | 
				
			||||||
//is transparent is 2, the fill pattern are made transparent but inversed
 | 
					// If transparent is 2, the fill pattern is made transparent but inversed
 | 
				
			||||||
//is transparent is 0 the text for and background color will be used to represent/map
 | 
					// If is transparent is 0 the text for and background color will be used to represent/map
 | 
				
			||||||
//the colors of the monochrome bitmap pixels to the fillpattern
 | 
					// the colors of the monochrome bitmap pixels to the fillpattern
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//i miss_used the the menu items for setting so called back and fore ground color
 | 
					// I abused the the menu items for setting so called back and fore ground color
 | 
				
			||||||
//just to show how the those colors do influence the fillpatterns
 | 
					// just to show how the those colors do influence the fillpatterns just play 
 | 
				
			||||||
//just play with those,
 | 
					// with those, and with the code variations are endless using other logical 
 | 
				
			||||||
//and with the code
 | 
					// functions.
 | 
				
			||||||
//variations are endless using other logical functions
 | 
					
 | 
				
			||||||
void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 | 
					void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wxBrush* brush4  = new wxBrush(gs_bmp4);
 | 
					    wxBrush* brush4 = new wxBrush(gs_bmp4);
 | 
				
			||||||
 | 
					    wxBrush* brush4_mono = new wxBrush(gs_bmp4_mono);
 | 
				
			||||||
    wxBrush* brush36 = new wxBrush(gs_bmp36);
 | 
					    wxBrush* brush36 = new wxBrush(gs_bmp36);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxPoint todraw[5];
 | 
					    wxPoint todraw[5];
 | 
				
			||||||
@@ -369,20 +374,24 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        case 0:
 | 
					        case 0:
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                dc.SetLogicalFunction(wxCOPY);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                dc.SetPen( wxPen( "black", 4, wxSOLID) );
 | 
					                dc.SetPen( wxPen( "black", 4, wxSOLID) );
 | 
				
			||||||
                dc.SetBrush( *brush4 );
 | 
					                dc.SetBrush( *brush4 );
 | 
				
			||||||
                dc.SetTextForeground(*wxGREEN);
 | 
					 | 
				
			||||||
                dc.SetTextBackground(m_owner->m_colourForeground);
 | 
					 | 
				
			||||||
                dc.SetLogicalFunction(wxCOPY);
 | 
					 | 
				
			||||||
                dc.DrawPolygon(5,todraw,0,0,wxWINDING_RULE);
 | 
					                dc.DrawPolygon(5,todraw,0,0,wxWINDING_RULE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //don't understand hwo but the outline is also depending on logicalfunction
 | 
					 | 
				
			||||||
                dc.SetPen( wxPen( "red", 4, wxSOLID) );
 | 
					                dc.SetPen( wxPen( "red", 4, wxSOLID) );
 | 
				
			||||||
                dc.SetBrush( *brush36 );
 | 
					                dc.SetBrush( *brush36 );
 | 
				
			||||||
                dc.SetTextForeground(*wxCYAN);
 | 
					                dc.SetTextForeground(*wxCYAN);
 | 
				
			||||||
                dc.SetTextBackground(m_owner->m_colourBackground);
 | 
					                dc.SetTextBackground(m_owner->m_colourBackground);
 | 
				
			||||||
                dc.SetLogicalFunction(wxCOPY);
 | 
					 | 
				
			||||||
                dc.DrawRectangle( x+10, y+10, 200, 200 );
 | 
					                dc.DrawRectangle( x+10, y+10, 200, 200 );
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                dc.SetPen( wxPen( "green", 4, wxSOLID) );
 | 
				
			||||||
 | 
					                dc.SetBrush( *brush4_mono );
 | 
				
			||||||
 | 
					                dc.SetTextForeground(*wxCYAN);
 | 
				
			||||||
 | 
					                dc.SetTextBackground(m_owner->m_colourBackground);
 | 
				
			||||||
 | 
					                dc.DrawRectangle( x+50, y+50, 200, 200 );
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
                dc.SetBrush(wxNullBrush);
 | 
					                dc.SetBrush(wxNullBrush);
 | 
				
			||||||
                dc.SetPen(wxNullPen);
 | 
					                dc.SetPen(wxNullPen);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
@@ -523,6 +532,7 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    delete brush4;
 | 
					    delete brush4;
 | 
				
			||||||
 | 
					    delete brush4_mono;
 | 
				
			||||||
    delete brush36;
 | 
					    delete brush36;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -943,7 +953,7 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//    dc.Clear();
 | 
					    dc.Clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( m_owner->m_textureBackground) {
 | 
					    if ( m_owner->m_textureBackground) {
 | 
				
			||||||
        dc.SetPen(*wxMEDIUM_GREY_PEN);
 | 
					        dc.SetPen(*wxMEDIUM_GREY_PEN);
 | 
				
			||||||
@@ -974,8 +984,10 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        case Show_Polygons:
 | 
					        case Show_Polygons:
 | 
				
			||||||
            DrawTestPoly( 0,  100, dc, 0 );
 | 
					            DrawTestPoly( 0,  100, dc, 0 );
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
            DrawTestPoly( 33, 500, dc, 1 );
 | 
					            DrawTestPoly( 33, 500, dc, 1 );
 | 
				
			||||||
            DrawTestPoly( 43, 1000, dc, 2 );
 | 
					            DrawTestPoly( 43, 1000, dc, 2 );
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case Show_Mask:
 | 
					        case Show_Mask:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2657,7 +2657,7 @@ void wxListMainWindow::CalculatePositions()
 | 
				
			|||||||
                if (y+lineSpacing-6 >= clientHeight) // -6 for earlier "line breaking"
 | 
					                if (y+lineSpacing-6 >= clientHeight) // -6 for earlier "line breaking"
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    m_currentVisibleLines = 0;
 | 
					                    m_currentVisibleLines = 0;
 | 
				
			||||||
                    y = 5;
 | 
					                    y = 2;
 | 
				
			||||||
                    x += maxWidth+6;
 | 
					                    x += maxWidth+6;
 | 
				
			||||||
                    entireWidth += maxWidth+6;
 | 
					                    entireWidth += maxWidth+6;
 | 
				
			||||||
                    maxWidth = 0;
 | 
					                    maxWidth = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,15 +66,13 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    m_refData = new wxBrushRefData();
 | 
					    m_refData = new wxBrushRefData();
 | 
				
			||||||
    M_BRUSHDATA->m_colour = *wxBLACK;
 | 
					    M_BRUSHDATA->m_colour = *wxBLACK;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    M_BRUSHDATA->m_stipple = stippleBitmap;
 | 
					    M_BRUSHDATA->m_stipple = stippleBitmap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (M_BRUSHDATA->m_stipple.GetMask())
 | 
					    if (M_BRUSHDATA->m_stipple.GetMask())
 | 
				
			||||||
    {
 | 
							M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
 | 
				
			||||||
		   M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
 | 
						else
 | 
				
			||||||
	 }
 | 
							M_BRUSHDATA->m_style = wxSTIPPLE;
 | 
				
			||||||
	 else
 | 
					 | 
				
			||||||
	 {		
 | 
					 | 
				
			||||||
		   M_BRUSHDATA->m_style = wxSTIPPLE;
 | 
					 | 
				
			||||||
	 }		
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 | 
					    if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
// local defines
 | 
					// local defines
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define USE_PAINT_REGION 0
 | 
					#define USE_PAINT_REGION 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
// local data
 | 
					// local data
 | 
				
			||||||
@@ -110,6 +110,8 @@ void gdk_draw_bitmap     (GdkDrawable  *drawable,
 | 
				
			|||||||
// Implement Pool of Graphic contexts. Creating them takes too much time.
 | 
					// Implement Pool of Graphic contexts. Creating them takes too much time.
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define GC_POOL_SIZE 200
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum wxPoolGCType
 | 
					enum wxPoolGCType
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   wxGC_ERROR = 0,
 | 
					   wxGC_ERROR = 0,
 | 
				
			||||||
@@ -130,16 +132,16 @@ struct wxGC
 | 
				
			|||||||
    bool          m_used;
 | 
					    bool          m_used;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static wxGC wxGCPool[200];
 | 
					static wxGC wxGCPool[GC_POOL_SIZE];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void wxInitGCPool()
 | 
					static void wxInitGCPool()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    memset( wxGCPool, 0, 200*sizeof(wxGC) );
 | 
					    memset( wxGCPool, 0, GC_POOL_SIZE*sizeof(wxGC) );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void wxCleanUpGCPool()
 | 
					static void wxCleanUpGCPool()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (wxGCPool[i].m_gc)
 | 
					        if (wxGCPool[i].m_gc)
 | 
				
			||||||
            gdk_gc_unref( wxGCPool[i].m_gc );
 | 
					            gdk_gc_unref( wxGCPool[i].m_gc );
 | 
				
			||||||
@@ -148,7 +150,7 @@ static void wxCleanUpGCPool()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
					static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (!wxGCPool[i].m_gc)
 | 
					        if (!wxGCPool[i].m_gc)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -171,7 +173,7 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void wxFreePoolGC( GdkGC *gc )
 | 
					static void wxFreePoolGC( GdkGC *gc )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (wxGCPool[i].m_gc == gc)
 | 
					        if (wxGCPool[i].m_gc == gc)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -197,6 +199,7 @@ wxWindowDC::wxWindowDC()
 | 
				
			|||||||
    m_bgGC = (GdkGC *) NULL;
 | 
					    m_bgGC = (GdkGC *) NULL;
 | 
				
			||||||
    m_cmap = (GdkColormap *) NULL;
 | 
					    m_cmap = (GdkColormap *) NULL;
 | 
				
			||||||
    m_isMemDC = FALSE;
 | 
					    m_isMemDC = FALSE;
 | 
				
			||||||
 | 
					    m_isScreenDC = FALSE;
 | 
				
			||||||
    m_owner = (wxWindow *)NULL;
 | 
					    m_owner = (wxWindow *)NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -209,6 +212,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
 | 
				
			|||||||
    m_cmap = (GdkColormap *) NULL;
 | 
					    m_cmap = (GdkColormap *) NULL;
 | 
				
			||||||
    m_owner = (wxWindow *)NULL;
 | 
					    m_owner = (wxWindow *)NULL;
 | 
				
			||||||
    m_isMemDC = FALSE;
 | 
					    m_isMemDC = FALSE;
 | 
				
			||||||
 | 
					    m_isScreenDC = FALSE;
 | 
				
			||||||
    m_font = window->GetFont();
 | 
					    m_font = window->GetFont();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxASSERT_MSG( window, wxT("DC needs a window") );
 | 
					    wxASSERT_MSG( window, wxT("DC needs a window") );
 | 
				
			||||||
@@ -524,26 +528,42 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (m_window)
 | 
					    if (m_window)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					        if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
            gdk_draw_polygon (m_window, m_textGC, TRUE, gdkpoints, n);
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if ((m_brush.GetStyle() != wxTRANSPARENT))
 | 
					            if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
                gdk_draw_polygon (m_window, m_brushGC, TRUE, gdkpoints, n);
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 0, 0 );
 | 
				
			||||||
 | 
					            } else
 | 
				
			||||||
 | 
					            if (m_brush.GetStyle() == wxSTIPPLE)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // To do: Fillstyle
 | 
					        // To do: Fillstyle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
 | 
					        if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        for (i = 0 ; i < n ; i++)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_draw_line( m_window, m_penGC,
 | 
					            for (i = 0 ; i < n ; i++)
 | 
				
			||||||
                           gdkpoints[i%n].x,
 | 
					            {
 | 
				
			||||||
                           gdkpoints[i%n].y,
 | 
					                gdk_draw_line( m_window, m_penGC,
 | 
				
			||||||
                           gdkpoints[(i+1)%n].x,
 | 
					                               gdkpoints[i%n].x,
 | 
				
			||||||
                           gdkpoints[(i+1)%n].y);
 | 
					                               gdkpoints[i%n].y,
 | 
				
			||||||
 | 
					                               gdkpoints[(i+1)%n].x,
 | 
				
			||||||
 | 
					                               gdkpoints[(i+1)%n].y);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -568,19 +588,32 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (m_window)
 | 
					    if (m_window)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					        if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
 | 
					            if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
					            {
 | 
				
			||||||
        }
 | 
					                gdk_gc_set_ts_origin( m_textGC, 
 | 
				
			||||||
        else
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
        {
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
            if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
					                gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 0, 0 );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (m_brush.GetStyle() == wxSTIPPLE)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
					                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
 | 
				
			||||||
            if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
					            }
 | 
				
			||||||
                gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
 | 
					            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CalcBoundingBox( x, y );
 | 
					    CalcBoundingBox( x, y );
 | 
				
			||||||
@@ -717,7 +750,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
    int hh = YLOG2DEVREL(h);
 | 
					    int hh = YLOG2DEVREL(h);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* compare to current clipping region */
 | 
					    /* compare to current clipping region */
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxRegion tmp( xx,yy,ww,hh );
 | 
					        wxRegion tmp( xx,yy,ww,hh );
 | 
				
			||||||
        tmp.Intersect( m_currentClippingRegion );
 | 
					        tmp.Intersect( m_currentClippingRegion );
 | 
				
			||||||
@@ -748,7 +781,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
        if (useMask && mask)
 | 
					        if (useMask && mask)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
					            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                GdkColor col;
 | 
					                GdkColor col;
 | 
				
			||||||
                new_mask = gdk_pixmap_new( wxRootWindow->window, ww, hh, 1 );
 | 
					                new_mask = gdk_pixmap_new( wxRootWindow->window, ww, hh, 1 );
 | 
				
			||||||
@@ -810,14 +843,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
					            gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
				
			||||||
            gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
					            gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
					                gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
					            gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
				
			||||||
            gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
					            gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
					                gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -896,7 +929,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
    wxCoord hh = YLOG2DEVREL(height);
 | 
					    wxCoord hh = YLOG2DEVREL(height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* compare to current clipping region */
 | 
					    /* compare to current clipping region */
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxRegion tmp( xx,yy,ww,hh );
 | 
					        wxRegion tmp( xx,yy,ww,hh );
 | 
				
			||||||
        tmp.Intersect( m_currentClippingRegion );
 | 
					        tmp.Intersect( m_currentClippingRegion );
 | 
				
			||||||
@@ -941,7 +974,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
        if (useMask && mask)
 | 
					        if (useMask && mask)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
					            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                GdkColor col;
 | 
					                GdkColor col;
 | 
				
			||||||
                new_mask = gdk_pixmap_new( wxRootWindow->window, bm_ww, bm_hh, 1 );
 | 
					                new_mask = gdk_pixmap_new( wxRootWindow->window, bm_ww, bm_hh, 1 );
 | 
				
			||||||
@@ -996,14 +1029,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
					                gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
				
			||||||
                gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
					                gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
				
			||||||
                if (!m_currentClippingRegion.IsEmpty())
 | 
					                if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                    gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
					                    gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
					                gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
				
			||||||
                gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
					                gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
				
			||||||
                if (!m_currentClippingRegion.IsEmpty())
 | 
					                if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                    gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
					                    gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -1027,18 +1060,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            wxBitmap bitmap( width, height );
 | 
					            wxBitmap bitmap( width, height );
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            /* We have to use the srcDC's GC as it might be a 
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
               wxScreenDC and we only have the GDK_INCLUDE_INFERIORS
 | 
					 | 
				
			||||||
               flag set there. */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gdk_window_copy_area( bitmap.GetPixmap(), srcDC->m_penGC, 0, 0,
 | 
					            gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
 | 
				
			||||||
                                  srcDC->GetWindow(),
 | 
					                                  srcDC->GetWindow(),
 | 
				
			||||||
                                  xsrc, ysrc, width, height );
 | 
					                                  xsrc, ysrc, width, height );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            /* scale image */
 | 
					            /* scale image */
 | 
				
			||||||
@@ -1059,14 +1088,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            /* No scaling and not a memory dc with a mask either */
 | 
					            /* No scaling and not a memory dc with a mask either */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gdk_window_copy_area( m_window, m_penGC, xx, yy,
 | 
					            gdk_window_copy_area( m_window, m_penGC, xx, yy,
 | 
				
			||||||
                                  srcDC->GetWindow(),
 | 
					                                  srcDC->GetWindow(),
 | 
				
			||||||
                                  xsrc, ysrc, width, height );
 | 
					                                  xsrc, ysrc, width, height );
 | 
				
			||||||
                                  
 | 
					                                  
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -1474,8 +1503,8 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					    if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
            gdk_gc_set_fill( m_textGC, GDK_OPAQUE_STIPPLED);
 | 
					        gdk_gc_set_fill( m_textGC, GDK_OPAQUE_STIPPLED);
 | 
				
			||||||
            gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
 | 
					        gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (IS_HATCH(m_brush.GetStyle()))
 | 
					    if (IS_HATCH(m_brush.GetStyle()))
 | 
				
			||||||
@@ -1650,13 +1679,13 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
 | 
				
			|||||||
    rect.width = XLOG2DEVREL(width);
 | 
					    rect.width = XLOG2DEVREL(width);
 | 
				
			||||||
    rect.height = YLOG2DEVREL(height);
 | 
					    rect.height = YLOG2DEVREL(height);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( rect );
 | 
					        m_currentClippingRegion.Intersect( rect );
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        m_currentClippingRegion.Union( rect );
 | 
					        m_currentClippingRegion.Union( rect );
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!m_paintClippingRegion.IsEmpty())
 | 
					    if (!m_paintClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
					        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1683,13 +1712,13 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion  )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (!m_window) return;
 | 
					    if (!m_window) return;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( region );
 | 
					        m_currentClippingRegion.Intersect( region );
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        m_currentClippingRegion.Union( region );
 | 
					        m_currentClippingRegion.Union( region );
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!m_paintClippingRegion.IsEmpty())
 | 
					    if (!m_paintClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
					        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1960,16 +1989,13 @@ wxPaintDC::wxPaintDC( wxWindow *win )
 | 
				
			|||||||
  : wxWindowDC( win )
 | 
					  : wxWindowDC( win )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!win->GetUpdateRegion().IsEmpty())
 | 
					    m_paintClippingRegion = win->GetUpdateRegion();
 | 
				
			||||||
    {
 | 
					    m_currentClippingRegion.Union( m_paintClippingRegion );
 | 
				
			||||||
        m_paintClippingRegion = win->GetUpdateRegion();
 | 
					 | 
				
			||||||
        m_currentClippingRegion.Union( m_paintClippingRegion );
 | 
					 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        gdk_gc_set_clip_region( m_penGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_penGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_brushGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_brushGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,8 @@ wxScreenDC::wxScreenDC()
 | 
				
			|||||||
    m_cmap = gdk_colormap_get_system();
 | 
					    m_cmap = gdk_colormap_get_system();
 | 
				
			||||||
    m_window = GDK_ROOT_PARENT();
 | 
					    m_window = GDK_ROOT_PARENT();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    m_isScreenDC = TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SetUpDC();
 | 
					    SetUpDC();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					    gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -94,20 +94,11 @@ wxRegion::wxRegion( const wxRect& rect )
 | 
				
			|||||||
    g_rect.height = rect.height;
 | 
					    g_rect.height = rect.height;
 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
 | 
					    M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
 | 
				
			||||||
    gdk_region_destroy( reg );
 | 
					    gdk_region_destroy( reg );
 | 
				
			||||||
 | 
					    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(rect.x,rect.y,rect.width,rect.height) );
 | 
				
			||||||
    wxNode *node = M_REGIONDATA->m_rects.First();
 | 
					 | 
				
			||||||
    while (node)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        wxRect *r = (wxRect*)node->Data();
 | 
					 | 
				
			||||||
        M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(r->x,r->y,r->width,r->height) );
 | 
					 | 
				
			||||||
        node = node->Next();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegion::wxRegion()
 | 
					wxRegion::wxRegion()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    m_refData = new wxRegionRefData();
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_new();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegion::~wxRegion()
 | 
					wxRegion::~wxRegion()
 | 
				
			||||||
@@ -127,8 +118,6 @@ bool wxRegion::operator != ( const wxRegion& region )
 | 
				
			|||||||
void wxRegion::Clear()
 | 
					void wxRegion::Clear()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    UnRef();
 | 
					    UnRef();
 | 
				
			||||||
    m_refData = new wxRegionRefData();
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_new();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
@@ -138,29 +127,41 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
    rect.y = y;
 | 
					    rect.y = y;
 | 
				
			||||||
    rect.width = width;
 | 
					    rect.width = width;
 | 
				
			||||||
    rect.height = height;
 | 
					    rect.height = height;
 | 
				
			||||||
    GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
 | 
					    if (!m_refData)
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    {
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        GdkRegion *reg = gdk_region_new();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
 | 
				
			||||||
 | 
					        gdk_region_destroy( reg );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
 | 
				
			||||||
 | 
					        gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = reg;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(x,y,width,height) );
 | 
					    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(x,y,width,height) );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( const wxRect& rect )
 | 
					bool wxRegion::Union( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    GdkRectangle g_rect;
 | 
					    return Union( rect.x, rect.y, rect.width, rect.height );
 | 
				
			||||||
    g_rect.x = rect.x;
 | 
					 | 
				
			||||||
    g_rect.y = rect.y;
 | 
					 | 
				
			||||||
    g_rect.width = rect.width;
 | 
					 | 
				
			||||||
    g_rect.height = rect.height;
 | 
					 | 
				
			||||||
    GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &g_rect );
 | 
					 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(rect.x,rect.y,rect.width,rect.height) );
 | 
					 | 
				
			||||||
    return TRUE;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( const wxRegion& region )
 | 
					bool wxRegion::Union( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_union( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_union( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -178,6 +179,12 @@ bool wxRegion::Union( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Intersect( reg );
 | 
					    Intersect( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -185,6 +192,12 @@ bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( const wxRect& rect )
 | 
					bool wxRegion::Intersect( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Intersect( reg );
 | 
					    Intersect( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -192,6 +205,16 @@ bool wxRegion::Intersect( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( const wxRegion& region )
 | 
					bool wxRegion::Intersect( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					        return TRUE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_intersect( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_intersect( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -200,6 +223,12 @@ bool wxRegion::Intersect( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Subtract( reg );
 | 
					    Subtract( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -207,6 +236,12 @@ bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( const wxRect& rect )
 | 
					bool wxRegion::Subtract( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Subtract( reg );
 | 
					    Subtract( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -214,6 +249,15 @@ bool wxRegion::Subtract( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( const wxRegion& region )
 | 
					bool wxRegion::Subtract( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_subtract( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_subtract( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -222,6 +266,12 @@ bool wxRegion::Subtract( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Xor( reg );
 | 
					    Xor( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -229,6 +279,12 @@ bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( const wxRect& rect )
 | 
					bool wxRegion::Xor( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Xor( reg );
 | 
					    Xor( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -236,6 +292,15 @@ bool wxRegion::Xor( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( const wxRegion& region )
 | 
					bool wxRegion::Xor( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -251,12 +316,15 @@ bool wxRegion::Xor( const wxRegion& region )
 | 
				
			|||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void wxRegion::GetBox( wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h ) const
 | 
					void wxRegion::GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    x = 0;
 | 
					    x = 0;
 | 
				
			||||||
    y = 0;
 | 
					    y = 0;
 | 
				
			||||||
    w = -1;
 | 
					    w = -1;
 | 
				
			||||||
    h = -1;
 | 
					    h = -1;
 | 
				
			||||||
 | 
					    if (m_refData)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRectangle rect;
 | 
					    GdkRectangle rect;
 | 
				
			||||||
    gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
 | 
					    gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
 | 
				
			||||||
    x = rect.x;
 | 
					    x = rect.x;
 | 
				
			||||||
@@ -277,11 +345,17 @@ wxRect wxRegion::GetBox() const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Empty() const
 | 
					bool wxRegion::Empty() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return gdk_region_empty( M_REGIONDATA->m_region );
 | 
					    return gdk_region_empty( M_REGIONDATA->m_region );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
					wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return wxOutRegion;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (gdk_region_point_in( M_REGIONDATA->m_region, x, y ))
 | 
					    if (gdk_region_point_in( M_REGIONDATA->m_region, x, y ))
 | 
				
			||||||
        return wxInRegion;
 | 
					        return wxInRegion;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@@ -290,6 +364,9 @@ wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) const
 | 
					wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return wxOutRegion;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRectangle rect;
 | 
					    GdkRectangle rect;
 | 
				
			||||||
    rect.x = x;
 | 
					    rect.x = x;
 | 
				
			||||||
    rect.y = y;
 | 
					    rect.y = y;
 | 
				
			||||||
@@ -317,11 +394,17 @@ wxRegionContain wxRegion::Contains(const wxRect& rect) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
GdkRegion *wxRegion::GetRegion() const
 | 
					GdkRegion *wxRegion::GetRegion() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return (GdkRegion*) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return M_REGIONDATA->m_region;
 | 
					    return M_REGIONDATA->m_region;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxList *wxRegion::GetRectList() const
 | 
					wxList *wxRegion::GetRectList() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return (wxList*) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return &(M_REGIONDATA->m_rects);
 | 
					    return &(M_REGIONDATA->m_rects);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,15 +66,13 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    m_refData = new wxBrushRefData();
 | 
					    m_refData = new wxBrushRefData();
 | 
				
			||||||
    M_BRUSHDATA->m_colour = *wxBLACK;
 | 
					    M_BRUSHDATA->m_colour = *wxBLACK;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    M_BRUSHDATA->m_stipple = stippleBitmap;
 | 
					    M_BRUSHDATA->m_stipple = stippleBitmap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (M_BRUSHDATA->m_stipple.GetMask())
 | 
					    if (M_BRUSHDATA->m_stipple.GetMask())
 | 
				
			||||||
    {
 | 
							M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
 | 
				
			||||||
		   M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
 | 
						else
 | 
				
			||||||
	 }
 | 
							M_BRUSHDATA->m_style = wxSTIPPLE;
 | 
				
			||||||
	 else
 | 
					 | 
				
			||||||
	 {		
 | 
					 | 
				
			||||||
		   M_BRUSHDATA->m_style = wxSTIPPLE;
 | 
					 | 
				
			||||||
	 }		
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 | 
					    if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
// local defines
 | 
					// local defines
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define USE_PAINT_REGION 0
 | 
					#define USE_PAINT_REGION 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
// local data
 | 
					// local data
 | 
				
			||||||
@@ -110,6 +110,8 @@ void gdk_draw_bitmap     (GdkDrawable  *drawable,
 | 
				
			|||||||
// Implement Pool of Graphic contexts. Creating them takes too much time.
 | 
					// Implement Pool of Graphic contexts. Creating them takes too much time.
 | 
				
			||||||
//-----------------------------------------------------------------------------
 | 
					//-----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define GC_POOL_SIZE 200
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum wxPoolGCType
 | 
					enum wxPoolGCType
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   wxGC_ERROR = 0,
 | 
					   wxGC_ERROR = 0,
 | 
				
			||||||
@@ -130,16 +132,16 @@ struct wxGC
 | 
				
			|||||||
    bool          m_used;
 | 
					    bool          m_used;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static wxGC wxGCPool[200];
 | 
					static wxGC wxGCPool[GC_POOL_SIZE];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void wxInitGCPool()
 | 
					static void wxInitGCPool()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    memset( wxGCPool, 0, 200*sizeof(wxGC) );
 | 
					    memset( wxGCPool, 0, GC_POOL_SIZE*sizeof(wxGC) );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void wxCleanUpGCPool()
 | 
					static void wxCleanUpGCPool()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (wxGCPool[i].m_gc)
 | 
					        if (wxGCPool[i].m_gc)
 | 
				
			||||||
            gdk_gc_unref( wxGCPool[i].m_gc );
 | 
					            gdk_gc_unref( wxGCPool[i].m_gc );
 | 
				
			||||||
@@ -148,7 +150,7 @@ static void wxCleanUpGCPool()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
					static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (!wxGCPool[i].m_gc)
 | 
					        if (!wxGCPool[i].m_gc)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -171,7 +173,7 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void wxFreePoolGC( GdkGC *gc )
 | 
					static void wxFreePoolGC( GdkGC *gc )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (int i = 0; i < 200; i++)
 | 
					    for (int i = 0; i < GC_POOL_SIZE; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (wxGCPool[i].m_gc == gc)
 | 
					        if (wxGCPool[i].m_gc == gc)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -197,6 +199,7 @@ wxWindowDC::wxWindowDC()
 | 
				
			|||||||
    m_bgGC = (GdkGC *) NULL;
 | 
					    m_bgGC = (GdkGC *) NULL;
 | 
				
			||||||
    m_cmap = (GdkColormap *) NULL;
 | 
					    m_cmap = (GdkColormap *) NULL;
 | 
				
			||||||
    m_isMemDC = FALSE;
 | 
					    m_isMemDC = FALSE;
 | 
				
			||||||
 | 
					    m_isScreenDC = FALSE;
 | 
				
			||||||
    m_owner = (wxWindow *)NULL;
 | 
					    m_owner = (wxWindow *)NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -209,6 +212,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
 | 
				
			|||||||
    m_cmap = (GdkColormap *) NULL;
 | 
					    m_cmap = (GdkColormap *) NULL;
 | 
				
			||||||
    m_owner = (wxWindow *)NULL;
 | 
					    m_owner = (wxWindow *)NULL;
 | 
				
			||||||
    m_isMemDC = FALSE;
 | 
					    m_isMemDC = FALSE;
 | 
				
			||||||
 | 
					    m_isScreenDC = FALSE;
 | 
				
			||||||
    m_font = window->GetFont();
 | 
					    m_font = window->GetFont();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxASSERT_MSG( window, wxT("DC needs a window") );
 | 
					    wxASSERT_MSG( window, wxT("DC needs a window") );
 | 
				
			||||||
@@ -524,26 +528,42 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (m_window)
 | 
					    if (m_window)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					        if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
            gdk_draw_polygon (m_window, m_textGC, TRUE, gdkpoints, n);
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if ((m_brush.GetStyle() != wxTRANSPARENT))
 | 
					            if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
                gdk_draw_polygon (m_window, m_brushGC, TRUE, gdkpoints, n);
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 0, 0 );
 | 
				
			||||||
 | 
					            } else
 | 
				
			||||||
 | 
					            if (m_brush.GetStyle() == wxSTIPPLE)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // To do: Fillstyle
 | 
					        // To do: Fillstyle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
 | 
					        if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        for (i = 0 ; i < n ; i++)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_draw_line( m_window, m_penGC,
 | 
					            for (i = 0 ; i < n ; i++)
 | 
				
			||||||
                           gdkpoints[i%n].x,
 | 
					            {
 | 
				
			||||||
                           gdkpoints[i%n].y,
 | 
					                gdk_draw_line( m_window, m_penGC,
 | 
				
			||||||
                           gdkpoints[(i+1)%n].x,
 | 
					                               gdkpoints[i%n].x,
 | 
				
			||||||
                           gdkpoints[(i+1)%n].y);
 | 
					                               gdkpoints[i%n].y,
 | 
				
			||||||
 | 
					                               gdkpoints[(i+1)%n].x,
 | 
				
			||||||
 | 
					                               gdkpoints[(i+1)%n].y);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -568,19 +588,32 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (m_window)
 | 
					    if (m_window)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					        if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
 | 
					            if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
					            {
 | 
				
			||||||
        }
 | 
					                gdk_gc_set_ts_origin( m_textGC, 
 | 
				
			||||||
        else
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
        {
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
            if (m_brush.GetStyle() != wxTRANSPARENT)
 | 
					                gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_textGC, 0, 0 );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (m_brush.GetStyle() == wxSTIPPLE)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 
 | 
				
			||||||
 | 
					                                      m_deviceOriginX % m_brush.GetStipple()->GetWidth(), 
 | 
				
			||||||
 | 
					                                      m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
 | 
				
			||||||
                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
					                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
 | 
				
			||||||
            if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
					            }
 | 
				
			||||||
                gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (m_pen.GetStyle() != wxTRANSPARENT)
 | 
				
			||||||
 | 
					            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CalcBoundingBox( x, y );
 | 
					    CalcBoundingBox( x, y );
 | 
				
			||||||
@@ -717,7 +750,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
    int hh = YLOG2DEVREL(h);
 | 
					    int hh = YLOG2DEVREL(h);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* compare to current clipping region */
 | 
					    /* compare to current clipping region */
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxRegion tmp( xx,yy,ww,hh );
 | 
					        wxRegion tmp( xx,yy,ww,hh );
 | 
				
			||||||
        tmp.Intersect( m_currentClippingRegion );
 | 
					        tmp.Intersect( m_currentClippingRegion );
 | 
				
			||||||
@@ -748,7 +781,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
        if (useMask && mask)
 | 
					        if (useMask && mask)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
					            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                GdkColor col;
 | 
					                GdkColor col;
 | 
				
			||||||
                new_mask = gdk_pixmap_new( wxRootWindow->window, ww, hh, 1 );
 | 
					                new_mask = gdk_pixmap_new( wxRootWindow->window, ww, hh, 1 );
 | 
				
			||||||
@@ -810,14 +843,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
					            gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
				
			||||||
            gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
					            gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
					                gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
					            gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
				
			||||||
            gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
					            gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
					                gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -896,7 +929,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
    wxCoord hh = YLOG2DEVREL(height);
 | 
					    wxCoord hh = YLOG2DEVREL(height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* compare to current clipping region */
 | 
					    /* compare to current clipping region */
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxRegion tmp( xx,yy,ww,hh );
 | 
					        wxRegion tmp( xx,yy,ww,hh );
 | 
				
			||||||
        tmp.Intersect( m_currentClippingRegion );
 | 
					        tmp.Intersect( m_currentClippingRegion );
 | 
				
			||||||
@@ -941,7 +974,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
        if (useMask && mask)
 | 
					        if (useMask && mask)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
					            GdkBitmap *new_mask = (GdkBitmap*) NULL;
 | 
				
			||||||
            if (!m_currentClippingRegion.IsEmpty())
 | 
					            if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                GdkColor col;
 | 
					                GdkColor col;
 | 
				
			||||||
                new_mask = gdk_pixmap_new( wxRootWindow->window, bm_ww, bm_hh, 1 );
 | 
					                new_mask = gdk_pixmap_new( wxRootWindow->window, bm_ww, bm_hh, 1 );
 | 
				
			||||||
@@ -996,14 +1029,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
					                gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
 | 
				
			||||||
                gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
					                gdk_gc_set_clip_origin( m_textGC, 0, 0 );
 | 
				
			||||||
                if (!m_currentClippingRegion.IsEmpty())
 | 
					                if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                    gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
					                    gdk_gc_set_clip_region( m_textGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
					                gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
 | 
				
			||||||
                gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
					                gdk_gc_set_clip_origin( m_penGC, 0, 0 );
 | 
				
			||||||
                if (!m_currentClippingRegion.IsEmpty())
 | 
					                if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
                    gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
					                    gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -1027,18 +1060,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            wxBitmap bitmap( width, height );
 | 
					            wxBitmap bitmap( width, height );
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            /* We have to use the srcDC's GC as it might be a 
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
               wxScreenDC and we only have the GDK_INCLUDE_INFERIORS
 | 
					 | 
				
			||||||
               flag set there. */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gdk_window_copy_area( bitmap.GetPixmap(), srcDC->m_penGC, 0, 0,
 | 
					            gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
 | 
				
			||||||
                                  srcDC->GetWindow(),
 | 
					                                  srcDC->GetWindow(),
 | 
				
			||||||
                                  xsrc, ysrc, width, height );
 | 
					                                  xsrc, ysrc, width, height );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            /* scale image */
 | 
					            /* scale image */
 | 
				
			||||||
@@ -1059,14 +1088,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            /* No scaling and not a memory dc with a mask either */
 | 
					            /* No scaling and not a memory dc with a mask either */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gdk_window_copy_area( m_window, m_penGC, xx, yy,
 | 
					            gdk_window_copy_area( m_window, m_penGC, xx, yy,
 | 
				
			||||||
                                  srcDC->GetWindow(),
 | 
					                                  srcDC->GetWindow(),
 | 
				
			||||||
                                  xsrc, ysrc, width, height );
 | 
					                                  xsrc, ysrc, width, height );
 | 
				
			||||||
                                  
 | 
					                                  
 | 
				
			||||||
            if (srcDC->GetWindow() == GDK_ROOT_PARENT())
 | 
					            if (srcDC->m_isScreenDC)
 | 
				
			||||||
                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
					                gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -1474,8 +1503,8 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
					    if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
            gdk_gc_set_fill( m_textGC, GDK_OPAQUE_STIPPLED);
 | 
					        gdk_gc_set_fill( m_textGC, GDK_OPAQUE_STIPPLED);
 | 
				
			||||||
            gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
 | 
					        gdk_gc_set_stipple( m_textGC, m_brush.GetStipple()->GetMask()->GetBitmap() );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (IS_HATCH(m_brush.GetStyle()))
 | 
					    if (IS_HATCH(m_brush.GetStyle()))
 | 
				
			||||||
@@ -1650,13 +1679,13 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
 | 
				
			|||||||
    rect.width = XLOG2DEVREL(width);
 | 
					    rect.width = XLOG2DEVREL(width);
 | 
				
			||||||
    rect.height = YLOG2DEVREL(height);
 | 
					    rect.height = YLOG2DEVREL(height);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( rect );
 | 
					        m_currentClippingRegion.Intersect( rect );
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        m_currentClippingRegion.Union( rect );
 | 
					        m_currentClippingRegion.Union( rect );
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!m_paintClippingRegion.IsEmpty())
 | 
					    if (!m_paintClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
					        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1683,13 +1712,13 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion  )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (!m_window) return;
 | 
					    if (!m_window) return;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!m_currentClippingRegion.IsEmpty())
 | 
					    if (!m_currentClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( region );
 | 
					        m_currentClippingRegion.Intersect( region );
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        m_currentClippingRegion.Union( region );
 | 
					        m_currentClippingRegion.Union( region );
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!m_paintClippingRegion.IsEmpty())
 | 
					    if (!m_paintClippingRegion.IsNull())
 | 
				
			||||||
        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
					        m_currentClippingRegion.Intersect( m_paintClippingRegion );
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1960,16 +1989,13 @@ wxPaintDC::wxPaintDC( wxWindow *win )
 | 
				
			|||||||
  : wxWindowDC( win )
 | 
					  : wxWindowDC( win )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if USE_PAINT_REGION    
 | 
					#if USE_PAINT_REGION    
 | 
				
			||||||
    if (!win->GetUpdateRegion().IsEmpty())
 | 
					    m_paintClippingRegion = win->GetUpdateRegion();
 | 
				
			||||||
    {
 | 
					    m_currentClippingRegion.Union( m_paintClippingRegion );
 | 
				
			||||||
        m_paintClippingRegion = win->GetUpdateRegion();
 | 
					 | 
				
			||||||
        m_currentClippingRegion.Union( m_paintClippingRegion );
 | 
					 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        gdk_gc_set_clip_region( m_penGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_penGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_brushGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_brushGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
        gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
 | 
					    gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,8 @@ wxScreenDC::wxScreenDC()
 | 
				
			|||||||
    m_cmap = gdk_colormap_get_system();
 | 
					    m_cmap = gdk_colormap_get_system();
 | 
				
			||||||
    m_window = GDK_ROOT_PARENT();
 | 
					    m_window = GDK_ROOT_PARENT();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    m_isScreenDC = TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SetUpDC();
 | 
					    SetUpDC();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
					    gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -94,20 +94,11 @@ wxRegion::wxRegion( const wxRect& rect )
 | 
				
			|||||||
    g_rect.height = rect.height;
 | 
					    g_rect.height = rect.height;
 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
 | 
					    M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
 | 
				
			||||||
    gdk_region_destroy( reg );
 | 
					    gdk_region_destroy( reg );
 | 
				
			||||||
 | 
					    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(rect.x,rect.y,rect.width,rect.height) );
 | 
				
			||||||
    wxNode *node = M_REGIONDATA->m_rects.First();
 | 
					 | 
				
			||||||
    while (node)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        wxRect *r = (wxRect*)node->Data();
 | 
					 | 
				
			||||||
        M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(r->x,r->y,r->width,r->height) );
 | 
					 | 
				
			||||||
        node = node->Next();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegion::wxRegion()
 | 
					wxRegion::wxRegion()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    m_refData = new wxRegionRefData();
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_new();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegion::~wxRegion()
 | 
					wxRegion::~wxRegion()
 | 
				
			||||||
@@ -127,8 +118,6 @@ bool wxRegion::operator != ( const wxRegion& region )
 | 
				
			|||||||
void wxRegion::Clear()
 | 
					void wxRegion::Clear()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    UnRef();
 | 
					    UnRef();
 | 
				
			||||||
    m_refData = new wxRegionRefData();
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = gdk_region_new();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
@@ -138,29 +127,41 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
    rect.y = y;
 | 
					    rect.y = y;
 | 
				
			||||||
    rect.width = width;
 | 
					    rect.width = width;
 | 
				
			||||||
    rect.height = height;
 | 
					    rect.height = height;
 | 
				
			||||||
    GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
 | 
					    if (!m_refData)
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    {
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        GdkRegion *reg = gdk_region_new();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
 | 
				
			||||||
 | 
					        gdk_region_destroy( reg );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
 | 
				
			||||||
 | 
					        gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = reg;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(x,y,width,height) );
 | 
					    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(x,y,width,height) );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( const wxRect& rect )
 | 
					bool wxRegion::Union( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    GdkRectangle g_rect;
 | 
					    return Union( rect.x, rect.y, rect.width, rect.height );
 | 
				
			||||||
    g_rect.x = rect.x;
 | 
					 | 
				
			||||||
    g_rect.y = rect.y;
 | 
					 | 
				
			||||||
    g_rect.width = rect.width;
 | 
					 | 
				
			||||||
    g_rect.height = rect.height;
 | 
					 | 
				
			||||||
    GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &g_rect );
 | 
					 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					 | 
				
			||||||
    M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(rect.x,rect.y,rect.width,rect.height) );
 | 
					 | 
				
			||||||
    return TRUE;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Union( const wxRegion& region )
 | 
					bool wxRegion::Union( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_union( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_union( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -178,6 +179,12 @@ bool wxRegion::Union( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Intersect( reg );
 | 
					    Intersect( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -185,6 +192,12 @@ bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( const wxRect& rect )
 | 
					bool wxRegion::Intersect( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Intersect( reg );
 | 
					    Intersect( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -192,6 +205,16 @@ bool wxRegion::Intersect( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Intersect( const wxRegion& region )
 | 
					bool wxRegion::Intersect( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					        return TRUE;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_intersect( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_intersect( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -200,6 +223,12 @@ bool wxRegion::Intersect( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Subtract( reg );
 | 
					    Subtract( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -207,6 +236,12 @@ bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( const wxRect& rect )
 | 
					bool wxRegion::Subtract( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Subtract( reg );
 | 
					    Subtract( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -214,6 +249,15 @@ bool wxRegion::Subtract( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Subtract( const wxRegion& region )
 | 
					bool wxRegion::Subtract( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_subtract( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_subtract( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -222,6 +266,12 @@ bool wxRegion::Subtract( const wxRegion& region )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
					bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( x, y, width, height );
 | 
					    wxRegion reg( x, y, width, height );
 | 
				
			||||||
    Xor( reg );
 | 
					    Xor( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -229,6 +279,12 @@ bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( const wxRect& rect )
 | 
					bool wxRegion::Xor( const wxRect& rect )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxRegion reg( rect );
 | 
					    wxRegion reg( rect );
 | 
				
			||||||
    Xor( reg );
 | 
					    Xor( reg );
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
@@ -236,6 +292,15 @@ bool wxRegion::Xor( const wxRect& rect )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Xor( const wxRegion& region )
 | 
					bool wxRegion::Xor( const wxRegion& region )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (region.IsNull())
 | 
				
			||||||
 | 
					        return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        m_refData = new wxRegionRefData();
 | 
				
			||||||
 | 
					        M_REGIONDATA->m_region = gdk_region_new();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
 | 
					    GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
 | 
				
			||||||
    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
					    gdk_region_destroy( M_REGIONDATA->m_region );
 | 
				
			||||||
    M_REGIONDATA->m_region = reg;
 | 
					    M_REGIONDATA->m_region = reg;
 | 
				
			||||||
@@ -251,12 +316,15 @@ bool wxRegion::Xor( const wxRegion& region )
 | 
				
			|||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void wxRegion::GetBox( wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h ) const
 | 
					void wxRegion::GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    x = 0;
 | 
					    x = 0;
 | 
				
			||||||
    y = 0;
 | 
					    y = 0;
 | 
				
			||||||
    w = -1;
 | 
					    w = -1;
 | 
				
			||||||
    h = -1;
 | 
					    h = -1;
 | 
				
			||||||
 | 
					    if (m_refData)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRectangle rect;
 | 
					    GdkRectangle rect;
 | 
				
			||||||
    gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
 | 
					    gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
 | 
				
			||||||
    x = rect.x;
 | 
					    x = rect.x;
 | 
				
			||||||
@@ -277,11 +345,17 @@ wxRect wxRegion::GetBox() const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool wxRegion::Empty() const
 | 
					bool wxRegion::Empty() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return gdk_region_empty( M_REGIONDATA->m_region );
 | 
					    return gdk_region_empty( M_REGIONDATA->m_region );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
					wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return wxOutRegion;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (gdk_region_point_in( M_REGIONDATA->m_region, x, y ))
 | 
					    if (gdk_region_point_in( M_REGIONDATA->m_region, x, y ))
 | 
				
			||||||
        return wxInRegion;
 | 
					        return wxInRegion;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@@ -290,6 +364,9 @@ wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) const
 | 
					wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return wxOutRegion;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GdkRectangle rect;
 | 
					    GdkRectangle rect;
 | 
				
			||||||
    rect.x = x;
 | 
					    rect.x = x;
 | 
				
			||||||
    rect.y = y;
 | 
					    rect.y = y;
 | 
				
			||||||
@@ -317,11 +394,17 @@ wxRegionContain wxRegion::Contains(const wxRect& rect) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
GdkRegion *wxRegion::GetRegion() const
 | 
					GdkRegion *wxRegion::GetRegion() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return (GdkRegion*) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return M_REGIONDATA->m_region;
 | 
					    return M_REGIONDATA->m_region;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wxList *wxRegion::GetRectList() const
 | 
					wxList *wxRegion::GetRectList() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if (!m_refData)
 | 
				
			||||||
 | 
					        return (wxList*) NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return &(M_REGIONDATA->m_rects);
 | 
					    return &(M_REGIONDATA->m_rects);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user