wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
: wxPaintDCImpl( owner )
-{
- Init();
+{
+ Init();
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
: wxPaintDCImpl( owner )
-{
- Init();
+{
+ Init();
DoSelect(bitmap);
}
-wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC * WXUNUSED(dc) )
: wxPaintDCImpl( owner )
{
Init();
{
public:
wxRegionRefData()
- {
- m_macRgn.reset( HIShapeCreateMutable() );
+ {
+ m_macRgn.reset( HIShapeCreateMutable() );
}
wxRegionRefData(HIShapeRef hRegion)
- {
- m_macRgn.reset( HIShapeCreateMutableCopy(hRegion) );
+ {
+ m_macRgn.reset( HIShapeCreateMutableCopy(hRegion) );
}
-
+
wxRegionRefData(long x, long y, long w, long h)
{
CGRect r = CGRectMake(x,y,w,h);
wxCFRef<HIShapeRef> rect(HIShapeCreateWithRect(&r));
- m_macRgn.reset( HIShapeCreateMutableCopy(rect) );
+ m_macRgn.reset( HIShapeCreateMutableCopy(rect) );
}
-
+
wxRegionRefData(const wxRegionRefData& data)
: wxGDIRefData()
{
}
virtual ~wxRegionRefData()
- {
+ {
}
wxCFRef<HIMutableShapeRef> m_macRgn;
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
{
- m_refData = new wxRegionRefData(topLeft.x , topLeft.y ,
- topLeft.x - bottomRight.x ,
+ m_refData = new wxRegionRefData(topLeft.x , topLeft.y ,
+ topLeft.x - bottomRight.x ,
topLeft.y - bottomRight.y);
}
wxRegion::wxRegion(size_t n, const wxPoint *points, int WXUNUSED(fillStyle))
{
- m_refData = new wxRegionRefData;
+ wxUnusedVar(n);
+ wxUnusedVar(points);
#if 0 // ndef __LP64__
+ m_refData = new wxRegionRefData;
+
// TODO : any APIs ?
// OS X somehow does not collect the region invisibly as before, so sometimes things
// get drawn on screen instead of just being combined into a region, therefore we allocate a temp gworld now
::SetGWorld( oldWorld, oldGDHandle );
}
+#else
+ wxFAIL_MSG( "not implemented" );
+ m_refData = NULL;
#endif
}
{
CGRect box ;
HIShapeGetBounds( M_REGION , &box ) ;
- x = box.origin.x ;
- y = box.origin.y ;
- w = box.size.width ;
- h = box.size.height ;
+ x = wx_static_cast(int, box.origin.x);
+ y = wx_static_cast(int, box.origin.y);
+ w = wx_static_cast(int, box.size.width);
+ h = wx_static_cast(int, box.size.height);
return true;
}
wxCFRef<HIShapeRef> intersect(HIShapeCreateIntersection(rectshape,M_REGION));
CGRect bounds;
HIShapeGetBounds(intersect, &bounds);
-
+
if ( HIShapeIsRectangular(intersect) && CGRectEqualToRect(rect,bounds) )
return wxInRegion;
else if ( HIShapeIsEmpty( intersect ) )
m_numRects = 1;
m_rects = new wxRect[m_numRects];
m_rects[0] = m_region.GetBox();
-
+
#else
RegionToRectsUPP proc = (RegionToRectsUPP) wxMacRegionToRectsCounterCallback;
OSStatus err = noErr;
RgnHandle rgn = NewRgn();
HIShapeGetAsQDRgn(OTHER_M_REGION(region), rgn);
-
+
err = QDRegionToRects (rgn, kQDParseRegionFromTopLeft, proc, (void*)&m_numRects);
if (err == noErr)
{
return theDepth;
#else
- return 32; // TODO
+ return 32; // TODO
#endif
}
*height = bounds.size.height;
#else
int w, h;
- wxDisplaySize(&w,&h);
+ wxDisplaySize(&w,&h);
if ( x )
*x = 0;
if ( y )
IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
-wxMacControl::wxMacControl()
+wxMacControl::wxMacControl()
{
Init();
}
flush = kHIThemeTextHorizontalFlushRight;
HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.MacGetCTFont() );
HIViewSetTextHorizontalFlush( m_controlRef, part, flush );
-
+
if ( foreground != *wxBLACK )
{
ControlFontStyleRec fontStyle;
fontStyle.flags = kControlUseForeColorMask;
::SetControlFontStyle( m_controlRef , &fontStyle );
}
-
+
}
#endif
#if wxMAC_USE_ATSU_TEXT
void wxMacControl::GetRectInWindowCoords( Rect *r )
{
GetControlBounds( m_controlRef , r ) ;
-
+
WindowRef tlwref = GetControlOwner( m_controlRef ) ;
-
+
wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
if ( tlwwx != NULL )
{
UInt32 linebottom = linetop + height;
Rect rect ;
GetRect( &rect );
-
+
if ( linetop < top || linebottom > (top + rect.bottom - rect.top ) )
SetScrollPosition( wxMax( n-2, 0 ) * ((UInt32)height) , left ) ;
return genericRGBColorSpace;
}
-CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
+CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
{
CGColorRef color ;
HIThemeBrushCreateCGColor( brush, &color );
#if wxMAC_USE_QUICKDRAW
+static inline void PointFromHIPoint(const HIPoint& p, Point *pt)
+{
+ pt->h = wx_static_cast(short, p.x);
+ pt->v = wx_static_cast(short, p.y);
+}
+
void wxMacGlobalToLocal( WindowRef window , Point*pt )
{
HIPoint p = CGPointMake( pt->h, pt->v );
// TODO check toolbar offset
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
HIPointConvert( &p, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, contentView );
- pt->h = p.x;
- pt->v = p.y;
+ PointFromHIPoint(p, pt);
}
void wxMacLocalToGlobal( WindowRef window , Point*pt )
// TODO check toolbar offset
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
HIPointConvert( &p, kHICoordSpaceView, contentView, kHICoordSpace72DPIGlobal, NULL );
- pt->h = p.x;
- pt->v = p.y;
+ PointFromHIPoint(p, pt);
}
-#endif
+
+#endif // wxMAC_USE_QUICKDRAW
#endif // wxUSE_GUI