// Create mask
if ( image.HasMask() ) {
- SetMask(new wxMask( maskBitmap ));
+// SetMask(new wxMask( maskBitmap ));
}
UnlockPixels( GetGWorldPixMap(GetHBITMAP()) );
// Create mask
if ( image.HasMask() ) {
- SetMask(new wxMask( maskBitmap ));
+// SetMask(new wxMask( maskBitmap ));
}
UnlockPixels( GetGWorldPixMap(GetHBITMAP()) );
{
// help->Setup( m_macPort ) ;
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
- ::ClipRect(&m_macClipRect);
+ if ( m_clipping )
+ {
+ long x1 = XLOG2DEV(m_clipX1);
+ long y1 = YLOG2DEV(m_clipY1);
+ long x2 = XLOG2DEV(m_clipX2);
+ long y2 = YLOG2DEV(m_clipY2);
+
+ Rect clip = { y1 , x1 , y2 , x2 } ;
+ ::SectRect( &clip , &m_macClipRect , &clip ) ;
+ ::ClipRect( &clip ) ;
+ }
+ else
+ {
+ ::ClipRect(&m_macClipRect);
+ }
+
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
- wxMacPortSetter helper(this) ;
if( m_clipping )
{
m_clipX1 = wxMax( m_clipX1 , x ) ;
m_clipX2 = x + width;
m_clipY2 = y + height;
}
-
- long x1 = XLOG2DEV(m_clipX1);
- long y1 = YLOG2DEV(m_clipY1);
- long x2 = XLOG2DEV(m_clipX2);
- long y2 = YLOG2DEV(m_clipY2);
-
- Rect clip = { y1 , x1 , y2 , x2 } ;
-
- ::ClipRect( &clip ) ;
-
-};
+ };
void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
{
wxMacPortSetter helper(this) ;
m_clipping = FALSE;
-// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
- ::ClipRect(&m_macClipRect);
};
void wxDC::DoGetSize( int* width, int* height ) const
#if !TARGET_CARBON
#define GetControlOwner( control ) (**control).contrlOwner
+// since we always call this in the right context we don't have to set and reset the port
+#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
#endif
static bool sUMAHasAppearance = false ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+
}
void UMADeactivateControl( ControlHandle inControl )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
}
}
-
void UMAHiliteControl (ControlHandle inControl,
ControlPartCode hiliteState)
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
::HiliteControl( inControl , hiliteState ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
::ShowControl( inControl ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( inWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( inWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
// help->Setup( m_macPort ) ;
::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
- ::ClipRect(&m_macClipRect);
+ if ( m_clipping )
+ {
+ long x1 = XLOG2DEV(m_clipX1);
+ long y1 = YLOG2DEV(m_clipY1);
+ long x2 = XLOG2DEV(m_clipX2);
+ long y2 = YLOG2DEV(m_clipY2);
+
+ Rect clip = { y1 , x1 , y2 , x2 } ;
+ ::SectRect( &clip , &m_macClipRect , &clip ) ;
+ ::ClipRect( &clip ) ;
+ }
+ else
+ {
+ ::ClipRect(&m_macClipRect);
+ }
+
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
- wxMacPortSetter helper(this) ;
if( m_clipping )
{
m_clipX1 = wxMax( m_clipX1 , x ) ;
m_clipX2 = x + width;
m_clipY2 = y + height;
}
-
- long x1 = XLOG2DEV(m_clipX1);
- long y1 = YLOG2DEV(m_clipY1);
- long x2 = XLOG2DEV(m_clipX2);
- long y2 = YLOG2DEV(m_clipY2);
-
- Rect clip = { y1 , x1 , y2 , x2 } ;
-
- ::ClipRect( &clip ) ;
-
-};
+ };
void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
{
wxMacPortSetter helper(this) ;
m_clipping = FALSE;
-// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
- ::ClipRect(&m_macClipRect);
};
void wxDC::DoGetSize( int* width, int* height ) const
#if !TARGET_CARBON
#define GetControlOwner( control ) (**control).contrlOwner
+// since we always call this in the right context we don't have to set and reset the port
+#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
#endif
static bool sUMAHasAppearance = false ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
#endif
+
}
void UMADeactivateControl( ControlHandle inControl )
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
}
}
-
void UMAHiliteControl (ControlHandle inControl,
ControlPartCode hiliteState)
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
::HiliteControl( inControl , hiliteState ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
{
WindowRef theWindow = GetControlOwner(inControl) ;
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( theWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( theWindow , updateRgn ) ;
{
::ShowControl( inControl ) ;
}
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( theWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
RgnHandle updateRgn = NewRgn() ;
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn ) ;
#else
GetWindowUpdateRgn( inWindow , updateRgn ) ;
{
}
#endif
-#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
+#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0332)
InvalWindowRgn( inWindow, updateRgn) ;
#else
InvalRgn( updateRgn ) ;