unused parameters and float/double->int conversion warning fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,18 +25,18 @@ IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl,wxPaintDCImpl)
|
|||||||
|
|
||||||
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
|
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
|
||||||
: wxPaintDCImpl( owner )
|
: wxPaintDCImpl( owner )
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
|
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
|
||||||
: wxPaintDCImpl( owner )
|
: wxPaintDCImpl( owner )
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
DoSelect(bitmap);
|
DoSelect(bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
|
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC * WXUNUSED(dc) )
|
||||||
: wxPaintDCImpl( owner )
|
: wxPaintDCImpl( owner )
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
@@ -29,22 +29,22 @@ class WXDLLEXPORT wxRegionRefData : public wxGDIRefData
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRegionRefData()
|
wxRegionRefData()
|
||||||
{
|
{
|
||||||
m_macRgn.reset( HIShapeCreateMutable() );
|
m_macRgn.reset( HIShapeCreateMutable() );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRegionRefData(HIShapeRef hRegion)
|
wxRegionRefData(HIShapeRef hRegion)
|
||||||
{
|
{
|
||||||
m_macRgn.reset( HIShapeCreateMutableCopy(hRegion) );
|
m_macRgn.reset( HIShapeCreateMutableCopy(hRegion) );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRegionRefData(long x, long y, long w, long h)
|
wxRegionRefData(long x, long y, long w, long h)
|
||||||
{
|
{
|
||||||
CGRect r = CGRectMake(x,y,w,h);
|
CGRect r = CGRectMake(x,y,w,h);
|
||||||
wxCFRef<HIShapeRef> rect(HIShapeCreateWithRect(&r));
|
wxCFRef<HIShapeRef> rect(HIShapeCreateWithRect(&r));
|
||||||
m_macRgn.reset( HIShapeCreateMutableCopy(rect) );
|
m_macRgn.reset( HIShapeCreateMutableCopy(rect) );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRegionRefData(const wxRegionRefData& data)
|
wxRegionRefData(const wxRegionRefData& data)
|
||||||
: wxGDIRefData()
|
: wxGDIRefData()
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual ~wxRegionRefData()
|
virtual ~wxRegionRefData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCFRef<HIMutableShapeRef> m_macRgn;
|
wxCFRef<HIMutableShapeRef> m_macRgn;
|
||||||
@@ -85,8 +85,8 @@ wxRegion::wxRegion(long x, long y, long w, long h)
|
|||||||
|
|
||||||
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
|
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData(topLeft.x , topLeft.y ,
|
m_refData = new wxRegionRefData(topLeft.x , topLeft.y ,
|
||||||
topLeft.x - bottomRight.x ,
|
topLeft.x - bottomRight.x ,
|
||||||
topLeft.y - bottomRight.y);
|
topLeft.y - bottomRight.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,9 +97,12 @@ wxRegion::wxRegion(const wxRect& rect)
|
|||||||
|
|
||||||
wxRegion::wxRegion(size_t n, const wxPoint *points, int WXUNUSED(fillStyle))
|
wxRegion::wxRegion(size_t n, const wxPoint *points, int WXUNUSED(fillStyle))
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData;
|
wxUnusedVar(n);
|
||||||
|
wxUnusedVar(points);
|
||||||
|
|
||||||
#if 0 // ndef __LP64__
|
#if 0 // ndef __LP64__
|
||||||
|
m_refData = new wxRegionRefData;
|
||||||
|
|
||||||
// TODO : any APIs ?
|
// TODO : any APIs ?
|
||||||
// OS X somehow does not collect the region invisibly as before, so sometimes things
|
// 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
|
// get drawn on screen instead of just being combined into a region, therefore we allocate a temp gworld now
|
||||||
@@ -138,6 +141,9 @@ wxRegion::wxRegion(size_t n, const wxPoint *points, int WXUNUSED(fillStyle))
|
|||||||
|
|
||||||
::SetGWorld( oldWorld, oldGDHandle );
|
::SetGWorld( oldWorld, oldGDHandle );
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxFAIL_MSG( "not implemented" );
|
||||||
|
m_refData = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,10 +244,10 @@ bool wxRegion::DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const
|
|||||||
{
|
{
|
||||||
CGRect box ;
|
CGRect box ;
|
||||||
HIShapeGetBounds( M_REGION , &box ) ;
|
HIShapeGetBounds( M_REGION , &box ) ;
|
||||||
x = box.origin.x ;
|
x = wx_static_cast(int, box.origin.x);
|
||||||
y = box.origin.y ;
|
y = wx_static_cast(int, box.origin.y);
|
||||||
w = box.size.width ;
|
w = wx_static_cast(int, box.size.width);
|
||||||
h = box.size.height ;
|
h = wx_static_cast(int, box.size.height);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -295,7 +301,7 @@ wxRegionContain wxRegion::DoContainsRect(const wxRect& r) const
|
|||||||
wxCFRef<HIShapeRef> intersect(HIShapeCreateIntersection(rectshape,M_REGION));
|
wxCFRef<HIShapeRef> intersect(HIShapeCreateIntersection(rectshape,M_REGION));
|
||||||
CGRect bounds;
|
CGRect bounds;
|
||||||
HIShapeGetBounds(intersect, &bounds);
|
HIShapeGetBounds(intersect, &bounds);
|
||||||
|
|
||||||
if ( HIShapeIsRectangular(intersect) && CGRectEqualToRect(rect,bounds) )
|
if ( HIShapeIsRectangular(intersect) && CGRectEqualToRect(rect,bounds) )
|
||||||
return wxInRegion;
|
return wxInRegion;
|
||||||
else if ( HIShapeIsEmpty( intersect ) )
|
else if ( HIShapeIsEmpty( intersect ) )
|
||||||
@@ -440,14 +446,14 @@ void wxRegionIterator::Reset(const wxRegion& region)
|
|||||||
m_numRects = 1;
|
m_numRects = 1;
|
||||||
m_rects = new wxRect[m_numRects];
|
m_rects = new wxRect[m_numRects];
|
||||||
m_rects[0] = m_region.GetBox();
|
m_rects[0] = m_region.GetBox();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
RegionToRectsUPP proc = (RegionToRectsUPP) wxMacRegionToRectsCounterCallback;
|
RegionToRectsUPP proc = (RegionToRectsUPP) wxMacRegionToRectsCounterCallback;
|
||||||
|
|
||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
RgnHandle rgn = NewRgn();
|
RgnHandle rgn = NewRgn();
|
||||||
HIShapeGetAsQDRgn(OTHER_M_REGION(region), rgn);
|
HIShapeGetAsQDRgn(OTHER_M_REGION(region), rgn);
|
||||||
|
|
||||||
err = QDRegionToRects (rgn, kQDParseRegionFromTopLeft, proc, (void*)&m_numRects);
|
err = QDRegionToRects (rgn, kQDParseRegionFromTopLeft, proc, (void*)&m_numRects);
|
||||||
if (err == noErr)
|
if (err == noErr)
|
||||||
{
|
{
|
||||||
|
@@ -220,7 +220,7 @@ int wxDisplayDepth()
|
|||||||
|
|
||||||
return theDepth;
|
return theDepth;
|
||||||
#else
|
#else
|
||||||
return 32; // TODO
|
return 32; // TODO
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
|
|||||||
*height = bounds.size.height;
|
*height = bounds.size.height;
|
||||||
#else
|
#else
|
||||||
int w, h;
|
int w, h;
|
||||||
wxDisplaySize(&w,&h);
|
wxDisplaySize(&w,&h);
|
||||||
if ( x )
|
if ( x )
|
||||||
*x = 0;
|
*x = 0;
|
||||||
if ( y )
|
if ( y )
|
||||||
@@ -469,7 +469,7 @@ OSStatus wxMacCarbonEvent::SetParameter(EventParamName inName, EventParamType in
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
|
IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
|
||||||
|
|
||||||
wxMacControl::wxMacControl()
|
wxMacControl::wxMacControl()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@@ -654,7 +654,7 @@ void wxMacControl::SetFont( const wxFont & font , const wxColour& foreground , l
|
|||||||
flush = kHIThemeTextHorizontalFlushRight;
|
flush = kHIThemeTextHorizontalFlushRight;
|
||||||
HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.MacGetCTFont() );
|
HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.MacGetCTFont() );
|
||||||
HIViewSetTextHorizontalFlush( m_controlRef, part, flush );
|
HIViewSetTextHorizontalFlush( m_controlRef, part, flush );
|
||||||
|
|
||||||
if ( foreground != *wxBLACK )
|
if ( foreground != *wxBLACK )
|
||||||
{
|
{
|
||||||
ControlFontStyleRec fontStyle;
|
ControlFontStyleRec fontStyle;
|
||||||
@@ -662,7 +662,7 @@ void wxMacControl::SetFont( const wxFont & font , const wxColour& foreground , l
|
|||||||
fontStyle.flags = kControlUseForeColorMask;
|
fontStyle.flags = kControlUseForeColorMask;
|
||||||
::SetControlFontStyle( m_controlRef , &fontStyle );
|
::SetControlFontStyle( m_controlRef , &fontStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if wxMAC_USE_ATSU_TEXT
|
#if wxMAC_USE_ATSU_TEXT
|
||||||
@@ -845,9 +845,9 @@ void wxMacControl::GetRect( Rect *r )
|
|||||||
void wxMacControl::GetRectInWindowCoords( Rect *r )
|
void wxMacControl::GetRectInWindowCoords( Rect *r )
|
||||||
{
|
{
|
||||||
GetControlBounds( m_controlRef , r ) ;
|
GetControlBounds( m_controlRef , r ) ;
|
||||||
|
|
||||||
WindowRef tlwref = GetControlOwner( m_controlRef ) ;
|
WindowRef tlwref = GetControlOwner( m_controlRef ) ;
|
||||||
|
|
||||||
wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
|
wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
|
||||||
if ( tlwwx != NULL )
|
if ( tlwwx != NULL )
|
||||||
{
|
{
|
||||||
@@ -1908,7 +1908,7 @@ void wxMacDataItemBrowserControl::MacScrollTo( unsigned int n )
|
|||||||
UInt32 linebottom = linetop + height;
|
UInt32 linebottom = linetop + height;
|
||||||
Rect rect ;
|
Rect rect ;
|
||||||
GetRect( &rect );
|
GetRect( &rect );
|
||||||
|
|
||||||
if ( linetop < top || linebottom > (top + rect.bottom - rect.top ) )
|
if ( linetop < top || linebottom > (top + rect.bottom - rect.top ) )
|
||||||
SetScrollPosition( wxMax( n-2, 0 ) * ((UInt32)height) , left ) ;
|
SetScrollPosition( wxMax( n-2, 0 ) * ((UInt32)height) , left ) ;
|
||||||
|
|
||||||
@@ -1954,7 +1954,7 @@ CGColorSpaceRef wxMacGetGenericRGBColorSpace()
|
|||||||
return genericRGBColorSpace;
|
return genericRGBColorSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
|
CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
|
||||||
{
|
{
|
||||||
CGColorRef color ;
|
CGColorRef color ;
|
||||||
HIThemeBrushCreateCGColor( brush, &color );
|
HIThemeBrushCreateCGColor( brush, &color );
|
||||||
@@ -1963,6 +1963,12 @@ CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush )
|
|||||||
|
|
||||||
#if wxMAC_USE_QUICKDRAW
|
#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 )
|
void wxMacGlobalToLocal( WindowRef window , Point*pt )
|
||||||
{
|
{
|
||||||
HIPoint p = CGPointMake( pt->h, pt->v );
|
HIPoint p = CGPointMake( pt->h, pt->v );
|
||||||
@@ -1970,8 +1976,7 @@ void wxMacGlobalToLocal( WindowRef window , Point*pt )
|
|||||||
// TODO check toolbar offset
|
// TODO check toolbar offset
|
||||||
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
|
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
|
||||||
HIPointConvert( &p, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, contentView );
|
HIPointConvert( &p, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, contentView );
|
||||||
pt->h = p.x;
|
PointFromHIPoint(p, pt);
|
||||||
pt->v = p.y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacLocalToGlobal( WindowRef window , Point*pt )
|
void wxMacLocalToGlobal( WindowRef window , Point*pt )
|
||||||
@@ -1981,10 +1986,10 @@ void wxMacLocalToGlobal( WindowRef window , Point*pt )
|
|||||||
// TODO check toolbar offset
|
// TODO check toolbar offset
|
||||||
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
|
HIViewFindByID( HIViewGetRoot( window ), kHIViewWindowContentID , &contentView) ;
|
||||||
HIPointConvert( &p, kHICoordSpaceView, contentView, kHICoordSpace72DPIGlobal, NULL );
|
HIPointConvert( &p, kHICoordSpaceView, contentView, kHICoordSpace72DPIGlobal, NULL );
|
||||||
pt->h = p.x;
|
PointFromHIPoint(p, pt);
|
||||||
pt->v = p.y;
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif // wxMAC_USE_QUICKDRAW
|
||||||
|
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user