changed port handling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -48,6 +48,15 @@ extern int wxPageNumber;
|
|||||||
// wxDC
|
// wxDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxMacPortSetter
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
wxMacPortSetter( wxDC* dc ) ;
|
||||||
|
~wxMacPortSetter() ;
|
||||||
|
private :
|
||||||
|
AGAPortHelper m_ph ;
|
||||||
|
} ;
|
||||||
|
|
||||||
class WXDLLEXPORT wxDC: public wxDCBase
|
class WXDLLEXPORT wxDC: public wxDCBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
DECLARE_DYNAMIC_CLASS(wxDC)
|
||||||
@@ -255,15 +264,9 @@ protected:
|
|||||||
mutable bool m_macPenInstalled ;
|
mutable bool m_macPenInstalled ;
|
||||||
mutable bool m_macBrushInstalled ;
|
mutable bool m_macBrushInstalled ;
|
||||||
|
|
||||||
mutable long m_macPortId ;
|
|
||||||
GrafPtr m_macOrigPort ;
|
|
||||||
Rect m_macClipRect ;
|
Rect m_macClipRect ;
|
||||||
Point m_macLocalOrigin ;
|
Point m_macLocalOrigin ;
|
||||||
mutable AGAPortHelper m_macPortHelper ;
|
void MacSetupPort( AGAPortHelper* ph ) const ;
|
||||||
void MacSetupPort() const ;
|
|
||||||
void MacVerifySetup() const { if ( m_macPortId != m_macCurrentPortId ) MacSetupPort() ; }
|
|
||||||
static void MacInvalidateSetup() { m_macCurrentPortId++ ; }
|
|
||||||
static long m_macCurrentPortId ;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -2620,7 +2620,6 @@ AGAPortHelper::~AGAPortHelper()
|
|||||||
TextMode( mode );
|
TextMode( mode );
|
||||||
SetOrigin( 0 , 0 ) ;
|
SetOrigin( 0 , 0 ) ;
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2620,7 +2620,6 @@ AGAPortHelper::~AGAPortHelper()
|
|||||||
TextMode( mode );
|
TextMode( mode );
|
||||||
SetOrigin( 0 , 0 ) ;
|
SetOrigin( 0 , 0 ) ;
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -646,7 +646,6 @@ void wxControl::MacRedrawControl()
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,7 +687,6 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
|||||||
#define mm2pt 2.83464566929
|
#define mm2pt 2.83464566929
|
||||||
#define pt2mm 0.352777777778
|
#define pt2mm 0.352777777778
|
||||||
|
|
||||||
long wxDC::m_macCurrentPortId = 1 ;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDC
|
// wxDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -76,47 +74,36 @@ wxDC::wxDC()
|
|||||||
m_macBrushInstalled = false ;
|
m_macBrushInstalled = false ;
|
||||||
m_macPenInstalled = false ;
|
m_macPenInstalled = false ;
|
||||||
|
|
||||||
m_macPortId = 0 ;
|
|
||||||
m_macLocalOrigin.h = m_macLocalOrigin.v = 0 ;
|
m_macLocalOrigin.h = m_macLocalOrigin.v = 0 ;
|
||||||
m_macClipRect.left = -32000 ;
|
m_macClipRect.left = -32000 ;
|
||||||
m_macClipRect.top = -32000 ;
|
m_macClipRect.top = -32000 ;
|
||||||
m_macClipRect.right = 32000 ;
|
m_macClipRect.right = 32000 ;
|
||||||
m_macClipRect.bottom = 32000 ;
|
m_macClipRect.bottom = 32000 ;
|
||||||
::GetPort( &m_macOrigPort ) ;
|
|
||||||
|
|
||||||
m_pen = *wxBLACK_PEN;
|
m_pen = *wxBLACK_PEN;
|
||||||
m_font = *wxNORMAL_FONT;
|
m_font = *wxNORMAL_FONT;
|
||||||
m_brush = *wxWHITE_BRUSH;
|
m_brush = *wxWHITE_BRUSH;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wxMacPortSetter::wxMacPortSetter( wxDC* dc ) :
|
||||||
|
m_ph( dc->m_macPort )
|
||||||
|
{
|
||||||
|
wxASSERT( dc->Ok() ) ;
|
||||||
|
|
||||||
|
dc->MacSetupPort(&m_ph) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMacPortSetter::~wxMacPortSetter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
wxDC::~wxDC(void)
|
wxDC::~wxDC(void)
|
||||||
{
|
{
|
||||||
if ( !m_macPortHelper.IsCleared() )
|
|
||||||
{
|
|
||||||
GrafPtr port ;
|
|
||||||
GetPort( &port ) ;
|
|
||||||
SetPort( m_macPortHelper.GetCurrentPort() ) ;
|
|
||||||
SetOrigin( 0 , 0 ) ;
|
|
||||||
SetPort( port ) ;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if ( m_macPort )
|
|
||||||
{
|
|
||||||
::SetPort( m_macPort ) ;
|
|
||||||
::SetOrigin( 0 , 0 ) ;
|
|
||||||
::ClipRect( &m_macPort->portRect ) ;
|
|
||||||
::PenNormal() ;
|
|
||||||
::SetPort( m_macOrigPort ) ;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
++m_macCurrentPortId ;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDC::MacSetupPort() const
|
void wxDC::MacSetupPort(AGAPortHelper* help) const
|
||||||
{
|
{
|
||||||
AGAPortHelper* help = (AGAPortHelper*) &m_macPortHelper ;
|
|
||||||
help->Setup( m_macPort ) ;
|
help->Setup( m_macPort ) ;
|
||||||
m_macPortId = ++m_macCurrentPortId ;
|
|
||||||
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
||||||
::ClipRect(&m_macClipRect);
|
::ClipRect(&m_macClipRect);
|
||||||
|
|
||||||
@@ -131,7 +118,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
|
|||||||
|
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x);
|
long xx1 = XLOG2DEV(x);
|
||||||
long yy1 = YLOG2DEV(y);
|
long yy1 = YLOG2DEV(y);
|
||||||
@@ -200,7 +187,7 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x);
|
long xx1 = XLOG2DEV(x);
|
||||||
long yy1 = YLOG2DEV(y);
|
long yy1 = YLOG2DEV(y);
|
||||||
@@ -219,7 +206,7 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
|||||||
|
|
||||||
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
if( m_clipping )
|
if( m_clipping )
|
||||||
{
|
{
|
||||||
m_clipX1 = wxMax( m_clipX1 , x ) ;
|
m_clipX1 = wxMax( m_clipX1 , x ) ;
|
||||||
@@ -252,7 +239,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
if (region.Empty())
|
if (region.Empty())
|
||||||
{
|
{
|
||||||
DestroyClippingRegion();
|
DestroyClippingRegion();
|
||||||
@@ -266,7 +253,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
|||||||
|
|
||||||
void wxDC::DestroyClippingRegion(void)
|
void wxDC::DestroyClippingRegion(void)
|
||||||
{
|
{
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
m_clipping = FALSE;
|
m_clipping = FALSE;
|
||||||
// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
||||||
::ClipRect(&m_macClipRect);
|
::ClipRect(&m_macClipRect);
|
||||||
@@ -436,7 +423,7 @@ void wxDC::SetFont( const wxFont &font )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
m_font = font;
|
m_font = font;
|
||||||
m_macFontInstalled = false ;
|
m_macFontInstalled = false ;
|
||||||
@@ -447,7 +434,7 @@ void wxDC::SetPen( const wxPen &pen )
|
|||||||
if (!Ok() )
|
if (!Ok() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if ( m_pen == pen )
|
if ( m_pen == pen )
|
||||||
return ;
|
return ;
|
||||||
@@ -464,7 +451,7 @@ void wxDC::SetBrush( const wxBrush &brush )
|
|||||||
{
|
{
|
||||||
if (!Ok() )
|
if (!Ok() )
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_brush == brush)
|
if (m_brush == brush)
|
||||||
return;
|
return;
|
||||||
@@ -477,7 +464,7 @@ void wxDC::SetBackground( const wxBrush &brush )
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_backgroundBrush == brush)
|
if (m_backgroundBrush == brush)
|
||||||
return;
|
return;
|
||||||
@@ -515,7 +502,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -551,7 +538,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -569,7 +556,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() == wxTRANSPARENT)
|
if (m_pen.GetStyle() == wxTRANSPARENT)
|
||||||
return;
|
return;
|
||||||
@@ -596,7 +583,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
PolyHandle polygon = OpenPoly() ;
|
PolyHandle polygon = OpenPoly() ;
|
||||||
long x1, x2 , y1 , y2 ;
|
long x1, x2 , y1 , y2 ;
|
||||||
@@ -630,7 +617,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -675,7 +662,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (radius < 0.0)
|
if (radius < 0.0)
|
||||||
radius = - radius * ((width < height) ? width : height);
|
radius = - radius * ((width < height) ? width : height);
|
||||||
@@ -721,7 +708,7 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -772,7 +759,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask )
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask )
|
||||||
{
|
{
|
||||||
if (!Ok()) return FALSE;
|
if (!Ok()) return FALSE;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
||||||
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
||||||
@@ -843,7 +830,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -923,7 +910,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
wxFont formerFont = m_font ;
|
wxFont formerFont = m_font ;
|
||||||
|
|
||||||
@@ -1005,7 +992,7 @@ wxCoord wxDC::GetCharWidth(void) const
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1020,7 +1007,7 @@ wxCoord wxDC::GetCharHeight(void) const
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1034,7 +1021,7 @@ void wxDC::Clear(void)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
|
Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
|
||||||
|
|
||||||
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
||||||
@@ -1048,10 +1035,9 @@ void wxDC::MacInstallFont() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
|
|
||||||
if ( m_macFontInstalled )
|
// if ( m_macFontInstalled )
|
||||||
return ;
|
// return ;
|
||||||
Pattern blackColor ;
|
Pattern blackColor ;
|
||||||
|
|
||||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||||
@@ -1170,12 +1156,11 @@ void wxDC::MacInstallPen() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
|
|
||||||
Pattern blackColor;
|
Pattern blackColor;
|
||||||
|
|
||||||
if ( m_macPenInstalled )
|
// if ( m_macPenInstalled )
|
||||||
return ;
|
// return ;
|
||||||
|
|
||||||
RGBColor forecolor = m_pen.GetColour().GetPixel();
|
RGBColor forecolor = m_pen.GetColour().GetPixel();
|
||||||
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
|
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
|
||||||
@@ -1257,10 +1242,10 @@ void wxDC::MacInstallBrush() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
Pattern blackColor, whiteColor ;
|
Pattern blackColor, whiteColor ;
|
||||||
if ( m_macBrushInstalled )
|
// if ( m_macBrushInstalled )
|
||||||
return ;
|
// return ;
|
||||||
|
|
||||||
// foreground
|
// foreground
|
||||||
|
|
||||||
|
@@ -59,7 +59,6 @@ wxWindowDC::wxWindowDC(wxWindow *the_canvas)
|
|||||||
m_maxX = size.x ;
|
m_maxX = size.x ;
|
||||||
m_maxY = size.y ;
|
m_maxY = size.y ;
|
||||||
|
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
|
SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
|
||||||
}
|
}
|
||||||
@@ -83,7 +82,6 @@ wxClientDC::wxClientDC(wxWindow *window)
|
|||||||
|
|
||||||
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
||||||
m_macPort = UMAGetWindowPort( windowref ) ;
|
m_macPort = UMAGetWindowPort( windowref ) ;
|
||||||
MacSetupPort() ;
|
|
||||||
m_minY = m_minX = 0;
|
m_minY = m_minX = 0;
|
||||||
wxSize size = window->GetSize() ;
|
wxSize size = window->GetSize() ;
|
||||||
m_maxX = size.x ;
|
m_maxX = size.x ;
|
||||||
@@ -113,7 +111,6 @@ wxPaintDC::wxPaintDC(wxWindow *window)
|
|||||||
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
||||||
|
|
||||||
m_macPort = UMAGetWindowPort( windowref ) ;
|
m_macPort = UMAGetWindowPort( windowref ) ;
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
wxCoord x , y ,w , h ;
|
wxCoord x , y ,w , h ;
|
||||||
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
|
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
|
||||||
|
@@ -68,7 +68,6 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
|||||||
{
|
{
|
||||||
m_macMask = mask->GetMaskBitmap() ;
|
m_macMask = mask->GetMaskBitmap() ;
|
||||||
}
|
}
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
// SetBackground(wxBrush(*wxWHITE, wxSOLID));
|
// SetBackground(wxBrush(*wxWHITE, wxSOLID));
|
||||||
}
|
}
|
||||||
|
@@ -125,7 +125,6 @@ wxPrinterDC::~wxPrinterDC(void)
|
|||||||
::UMAPrClose() ;
|
::UMAPrClose() ;
|
||||||
// ::SetPort( macPrintFormerPort ) ;
|
// ::SetPort( macPrintFormerPort ) ;
|
||||||
::SetPort( LMGetWMgrPort() ) ;
|
::SetPort( LMGetWMgrPort() ) ;
|
||||||
m_macPortHelper.Clear() ;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if ( m_ok )
|
if ( m_ok )
|
||||||
|
@@ -28,7 +28,6 @@ wxScreenDC::wxScreenDC()
|
|||||||
#else
|
#else
|
||||||
m_macPort = LMGetWMgrPort() ;
|
m_macPort = LMGetWMgrPort() ;
|
||||||
#endif
|
#endif
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
BitMap screenBits;
|
BitMap screenBits;
|
||||||
GetQDGlobalsScreenBits( &screenBits );
|
GetQDGlobalsScreenBits( &screenBits );
|
||||||
|
@@ -115,23 +115,11 @@ bool wxMetaFile::Play(wxDC *dc)
|
|||||||
if (!dc->Ok() )
|
if (!dc->Ok() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
dc->MacVerifySetup() ;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
wxMacPortSetter helper( dc ) ;
|
||||||
PicHandle pict = GetHMETAFILE() ;
|
PicHandle pict = GetHMETAFILE() ;
|
||||||
DrawPicture( pict , &(**pict).picFrame ) ;
|
DrawPicture( pict , &(**pict).picFrame ) ;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (!m_refData)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
dc->BeginDrawing();
|
|
||||||
|
|
||||||
if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
|
|
||||||
PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile);
|
|
||||||
|
|
||||||
dc->EndDrawing();
|
|
||||||
*/
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -194,7 +194,6 @@ void wxTextCtrl::SetValue(const wxString& st)
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,7 +282,6 @@ void wxTextCtrl::Paste()
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -550,7 +550,6 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -295,9 +295,7 @@ void wxMacToolTip::Draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
::TextMode( srcOr ) ;
|
::TextMode( srcOr ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
|
|
||||||
// DrawText( m_label , 0 , m_label.Length() ) ;
|
// DrawText( m_label , 0 , m_label.Length() ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,7 +329,6 @@ void wxMacToolTip::Clear()
|
|||||||
DrawPicture(m_backpict, &m_rect);
|
DrawPicture(m_backpict, &m_rect);
|
||||||
KillPicture(m_backpict);
|
KillPicture(m_backpict);
|
||||||
m_backpict = NULL ;
|
m_backpict = NULL ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -835,7 +835,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
return err ;
|
return err ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1379,7 +1378,6 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
|
|||||||
UMADeactivateControl( control ) ;
|
UMADeactivateControl( control ) ;
|
||||||
}
|
}
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
||||||
|
@@ -2353,7 +2353,6 @@ wxMacDrawingHelper::~wxMacDrawingHelper()
|
|||||||
Rect portRect ;
|
Rect portRect ;
|
||||||
GetPortBounds( m_currentPort , &portRect ) ;
|
GetPortBounds( m_currentPort , &portRect ) ;
|
||||||
ClipRect( &portRect ) ;
|
ClipRect( &portRect ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_formerPort != m_currentPort )
|
if ( m_formerPort != m_currentPort )
|
||||||
|
@@ -646,7 +646,6 @@ void wxControl::MacRedrawControl()
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,7 +687,6 @@ void wxControl::OnPaint(wxPaintEvent& event)
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
|||||||
#define mm2pt 2.83464566929
|
#define mm2pt 2.83464566929
|
||||||
#define pt2mm 0.352777777778
|
#define pt2mm 0.352777777778
|
||||||
|
|
||||||
long wxDC::m_macCurrentPortId = 1 ;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDC
|
// wxDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -76,47 +74,36 @@ wxDC::wxDC()
|
|||||||
m_macBrushInstalled = false ;
|
m_macBrushInstalled = false ;
|
||||||
m_macPenInstalled = false ;
|
m_macPenInstalled = false ;
|
||||||
|
|
||||||
m_macPortId = 0 ;
|
|
||||||
m_macLocalOrigin.h = m_macLocalOrigin.v = 0 ;
|
m_macLocalOrigin.h = m_macLocalOrigin.v = 0 ;
|
||||||
m_macClipRect.left = -32000 ;
|
m_macClipRect.left = -32000 ;
|
||||||
m_macClipRect.top = -32000 ;
|
m_macClipRect.top = -32000 ;
|
||||||
m_macClipRect.right = 32000 ;
|
m_macClipRect.right = 32000 ;
|
||||||
m_macClipRect.bottom = 32000 ;
|
m_macClipRect.bottom = 32000 ;
|
||||||
::GetPort( &m_macOrigPort ) ;
|
|
||||||
|
|
||||||
m_pen = *wxBLACK_PEN;
|
m_pen = *wxBLACK_PEN;
|
||||||
m_font = *wxNORMAL_FONT;
|
m_font = *wxNORMAL_FONT;
|
||||||
m_brush = *wxWHITE_BRUSH;
|
m_brush = *wxWHITE_BRUSH;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wxMacPortSetter::wxMacPortSetter( wxDC* dc ) :
|
||||||
|
m_ph( dc->m_macPort )
|
||||||
|
{
|
||||||
|
wxASSERT( dc->Ok() ) ;
|
||||||
|
|
||||||
|
dc->MacSetupPort(&m_ph) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMacPortSetter::~wxMacPortSetter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
wxDC::~wxDC(void)
|
wxDC::~wxDC(void)
|
||||||
{
|
{
|
||||||
if ( !m_macPortHelper.IsCleared() )
|
|
||||||
{
|
|
||||||
GrafPtr port ;
|
|
||||||
GetPort( &port ) ;
|
|
||||||
SetPort( m_macPortHelper.GetCurrentPort() ) ;
|
|
||||||
SetOrigin( 0 , 0 ) ;
|
|
||||||
SetPort( port ) ;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if ( m_macPort )
|
|
||||||
{
|
|
||||||
::SetPort( m_macPort ) ;
|
|
||||||
::SetOrigin( 0 , 0 ) ;
|
|
||||||
::ClipRect( &m_macPort->portRect ) ;
|
|
||||||
::PenNormal() ;
|
|
||||||
::SetPort( m_macOrigPort ) ;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
++m_macCurrentPortId ;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDC::MacSetupPort() const
|
void wxDC::MacSetupPort(AGAPortHelper* help) const
|
||||||
{
|
{
|
||||||
AGAPortHelper* help = (AGAPortHelper*) &m_macPortHelper ;
|
|
||||||
help->Setup( m_macPort ) ;
|
help->Setup( m_macPort ) ;
|
||||||
m_macPortId = ++m_macCurrentPortId ;
|
|
||||||
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
|
||||||
::ClipRect(&m_macClipRect);
|
::ClipRect(&m_macClipRect);
|
||||||
|
|
||||||
@@ -131,7 +118,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
|
|||||||
|
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x);
|
long xx1 = XLOG2DEV(x);
|
||||||
long yy1 = YLOG2DEV(y);
|
long yy1 = YLOG2DEV(y);
|
||||||
@@ -200,7 +187,7 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x);
|
long xx1 = XLOG2DEV(x);
|
||||||
long yy1 = YLOG2DEV(y);
|
long yy1 = YLOG2DEV(y);
|
||||||
@@ -219,7 +206,7 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
|||||||
|
|
||||||
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
if( m_clipping )
|
if( m_clipping )
|
||||||
{
|
{
|
||||||
m_clipX1 = wxMax( m_clipX1 , x ) ;
|
m_clipX1 = wxMax( m_clipX1 , x ) ;
|
||||||
@@ -252,7 +239,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
if (region.Empty())
|
if (region.Empty())
|
||||||
{
|
{
|
||||||
DestroyClippingRegion();
|
DestroyClippingRegion();
|
||||||
@@ -266,7 +253,7 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
|||||||
|
|
||||||
void wxDC::DestroyClippingRegion(void)
|
void wxDC::DestroyClippingRegion(void)
|
||||||
{
|
{
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
m_clipping = FALSE;
|
m_clipping = FALSE;
|
||||||
// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
|
||||||
::ClipRect(&m_macClipRect);
|
::ClipRect(&m_macClipRect);
|
||||||
@@ -436,7 +423,7 @@ void wxDC::SetFont( const wxFont &font )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
m_font = font;
|
m_font = font;
|
||||||
m_macFontInstalled = false ;
|
m_macFontInstalled = false ;
|
||||||
@@ -447,7 +434,7 @@ void wxDC::SetPen( const wxPen &pen )
|
|||||||
if (!Ok() )
|
if (!Ok() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if ( m_pen == pen )
|
if ( m_pen == pen )
|
||||||
return ;
|
return ;
|
||||||
@@ -464,7 +451,7 @@ void wxDC::SetBrush( const wxBrush &brush )
|
|||||||
{
|
{
|
||||||
if (!Ok() )
|
if (!Ok() )
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_brush == brush)
|
if (m_brush == brush)
|
||||||
return;
|
return;
|
||||||
@@ -477,7 +464,7 @@ void wxDC::SetBackground( const wxBrush &brush )
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
// wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_backgroundBrush == brush)
|
if (m_backgroundBrush == brush)
|
||||||
return;
|
return;
|
||||||
@@ -515,7 +502,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -551,7 +538,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -569,7 +556,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (m_pen.GetStyle() == wxTRANSPARENT)
|
if (m_pen.GetStyle() == wxTRANSPARENT)
|
||||||
return;
|
return;
|
||||||
@@ -596,7 +583,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
PolyHandle polygon = OpenPoly() ;
|
PolyHandle polygon = OpenPoly() ;
|
||||||
long x1, x2 , y1 , y2 ;
|
long x1, x2 , y1 , y2 ;
|
||||||
@@ -630,7 +617,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -675,7 +662,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
if (radius < 0.0)
|
if (radius < 0.0)
|
||||||
radius = - radius * ((width < height) ? width : height);
|
radius = - radius * ((width < height) ? width : height);
|
||||||
@@ -721,7 +708,7 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -772,7 +759,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask )
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask )
|
||||||
{
|
{
|
||||||
if (!Ok()) return FALSE;
|
if (!Ok()) return FALSE;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
|
||||||
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
|
||||||
@@ -843,7 +830,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
long xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
long yy = YLOG2DEV(y);
|
||||||
@@ -923,7 +910,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
wxFont formerFont = m_font ;
|
wxFont formerFont = m_font ;
|
||||||
|
|
||||||
@@ -1005,7 +992,7 @@ wxCoord wxDC::GetCharWidth(void) const
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1020,7 +1007,7 @@ wxCoord wxDC::GetCharHeight(void) const
|
|||||||
if (!Ok())
|
if (!Ok())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
|
|
||||||
MacInstallFont() ;
|
MacInstallFont() ;
|
||||||
|
|
||||||
@@ -1034,7 +1021,7 @@ void wxDC::Clear(void)
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
wxMacPortSetter helper(this) ;
|
||||||
Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
|
Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
|
||||||
|
|
||||||
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
|
||||||
@@ -1048,10 +1035,9 @@ void wxDC::MacInstallFont() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
|
|
||||||
if ( m_macFontInstalled )
|
// if ( m_macFontInstalled )
|
||||||
return ;
|
// return ;
|
||||||
Pattern blackColor ;
|
Pattern blackColor ;
|
||||||
|
|
||||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||||
@@ -1170,12 +1156,11 @@ void wxDC::MacInstallPen() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
|
|
||||||
Pattern blackColor;
|
Pattern blackColor;
|
||||||
|
|
||||||
if ( m_macPenInstalled )
|
// if ( m_macPenInstalled )
|
||||||
return ;
|
// return ;
|
||||||
|
|
||||||
RGBColor forecolor = m_pen.GetColour().GetPixel();
|
RGBColor forecolor = m_pen.GetColour().GetPixel();
|
||||||
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
|
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
|
||||||
@@ -1257,10 +1242,10 @@ void wxDC::MacInstallBrush() const
|
|||||||
{
|
{
|
||||||
if (!Ok())
|
if (!Ok())
|
||||||
return;
|
return;
|
||||||
MacVerifySetup() ;
|
|
||||||
Pattern blackColor, whiteColor ;
|
Pattern blackColor, whiteColor ;
|
||||||
if ( m_macBrushInstalled )
|
// if ( m_macBrushInstalled )
|
||||||
return ;
|
// return ;
|
||||||
|
|
||||||
// foreground
|
// foreground
|
||||||
|
|
||||||
|
@@ -59,7 +59,6 @@ wxWindowDC::wxWindowDC(wxWindow *the_canvas)
|
|||||||
m_maxX = size.x ;
|
m_maxX = size.x ;
|
||||||
m_maxY = size.y ;
|
m_maxY = size.y ;
|
||||||
|
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
|
SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
|
||||||
}
|
}
|
||||||
@@ -83,7 +82,6 @@ wxClientDC::wxClientDC(wxWindow *window)
|
|||||||
|
|
||||||
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
||||||
m_macPort = UMAGetWindowPort( windowref ) ;
|
m_macPort = UMAGetWindowPort( windowref ) ;
|
||||||
MacSetupPort() ;
|
|
||||||
m_minY = m_minX = 0;
|
m_minY = m_minX = 0;
|
||||||
wxSize size = window->GetSize() ;
|
wxSize size = window->GetSize() ;
|
||||||
m_maxX = size.x ;
|
m_maxX = size.x ;
|
||||||
@@ -113,7 +111,6 @@ wxPaintDC::wxPaintDC(wxWindow *window)
|
|||||||
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
|
||||||
|
|
||||||
m_macPort = UMAGetWindowPort( windowref ) ;
|
m_macPort = UMAGetWindowPort( windowref ) ;
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
wxCoord x , y ,w , h ;
|
wxCoord x , y ,w , h ;
|
||||||
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
|
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
|
||||||
|
@@ -68,7 +68,6 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
|||||||
{
|
{
|
||||||
m_macMask = mask->GetMaskBitmap() ;
|
m_macMask = mask->GetMaskBitmap() ;
|
||||||
}
|
}
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
// SetBackground(wxBrush(*wxWHITE, wxSOLID));
|
// SetBackground(wxBrush(*wxWHITE, wxSOLID));
|
||||||
}
|
}
|
||||||
|
@@ -125,7 +125,6 @@ wxPrinterDC::~wxPrinterDC(void)
|
|||||||
::UMAPrClose() ;
|
::UMAPrClose() ;
|
||||||
// ::SetPort( macPrintFormerPort ) ;
|
// ::SetPort( macPrintFormerPort ) ;
|
||||||
::SetPort( LMGetWMgrPort() ) ;
|
::SetPort( LMGetWMgrPort() ) ;
|
||||||
m_macPortHelper.Clear() ;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if ( m_ok )
|
if ( m_ok )
|
||||||
|
@@ -28,7 +28,6 @@ wxScreenDC::wxScreenDC()
|
|||||||
#else
|
#else
|
||||||
m_macPort = LMGetWMgrPort() ;
|
m_macPort = LMGetWMgrPort() ;
|
||||||
#endif
|
#endif
|
||||||
MacSetupPort() ;
|
|
||||||
m_ok = TRUE ;
|
m_ok = TRUE ;
|
||||||
BitMap screenBits;
|
BitMap screenBits;
|
||||||
GetQDGlobalsScreenBits( &screenBits );
|
GetQDGlobalsScreenBits( &screenBits );
|
||||||
|
@@ -115,23 +115,11 @@ bool wxMetaFile::Play(wxDC *dc)
|
|||||||
if (!dc->Ok() )
|
if (!dc->Ok() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
dc->MacVerifySetup() ;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
wxMacPortSetter helper( dc ) ;
|
||||||
PicHandle pict = GetHMETAFILE() ;
|
PicHandle pict = GetHMETAFILE() ;
|
||||||
DrawPicture( pict , &(**pict).picFrame ) ;
|
DrawPicture( pict , &(**pict).picFrame ) ;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (!m_refData)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
dc->BeginDrawing();
|
|
||||||
|
|
||||||
if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
|
|
||||||
PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile);
|
|
||||||
|
|
||||||
dc->EndDrawing();
|
|
||||||
*/
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -194,7 +194,6 @@ void wxTextCtrl::SetValue(const wxString& st)
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,7 +282,6 @@ void wxTextCtrl::Paste()
|
|||||||
|
|
||||||
UMADrawControl( m_macControl ) ;
|
UMADrawControl( m_macControl ) ;
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -550,7 +550,6 @@ void wxToolBar::OnPaint(wxPaintEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -295,9 +295,7 @@ void wxMacToolTip::Draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
::DrawText( text , laststop , i - laststop ) ;
|
::DrawText( text , laststop , i - laststop ) ;
|
||||||
::TextMode( srcOr ) ;
|
::TextMode( srcOr ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
|
|
||||||
// DrawText( m_label , 0 , m_label.Length() ) ;
|
// DrawText( m_label , 0 , m_label.Length() ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,7 +329,6 @@ void wxMacToolTip::Clear()
|
|||||||
DrawPicture(m_backpict, &m_rect);
|
DrawPicture(m_backpict, &m_rect);
|
||||||
KillPicture(m_backpict);
|
KillPicture(m_backpict);
|
||||||
m_backpict = NULL ;
|
m_backpict = NULL ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -835,7 +835,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
return err ;
|
return err ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1379,7 +1378,6 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
|
|||||||
UMADeactivateControl( control ) ;
|
UMADeactivateControl( control ) ;
|
||||||
}
|
}
|
||||||
SetPort( port ) ;
|
SetPort( port ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
||||||
|
@@ -2353,7 +2353,6 @@ wxMacDrawingHelper::~wxMacDrawingHelper()
|
|||||||
Rect portRect ;
|
Rect portRect ;
|
||||||
GetPortBounds( m_currentPort , &portRect ) ;
|
GetPortBounds( m_currentPort , &portRect ) ;
|
||||||
ClipRect( &portRect ) ;
|
ClipRect( &portRect ) ;
|
||||||
wxDC::MacInvalidateSetup() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_formerPort != m_currentPort )
|
if ( m_formerPort != m_currentPort )
|
||||||
|
Reference in New Issue
Block a user