fix warnings (double to int conversions and unused variables); removed hard TABs and extra spaces

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-10-20 23:59:55 +00:00
parent 513b47e9b7
commit a2d6d21099
4 changed files with 155 additions and 157 deletions

View File

@@ -1028,10 +1028,10 @@ void wxGCDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
if ( m_logicalFunction != wxCOPY )
return;
wxCoord xx = LogicalToDeviceX(x);
wxCoord yy = LogicalToDeviceY(y);
wxDouble xx = LogicalToDeviceX(x);
wxDouble yy = LogicalToDeviceY(y);
wxDouble ww = m_signX * LogicalToDeviceXRel(width);
wxCoord hh = m_signY * LogicalToDeviceYRel(height);
wxDouble hh = m_signY * LogicalToDeviceYRel(height);
// CMB: draw nothing if transformed w or h is 0
if (ww == 0 || hh == 0)
@@ -1187,13 +1187,13 @@ void wxGCDC::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *heig
m_graphicContext->GetTextExtent( str, &w, &h, &d, &e );
if ( height )
*height = DeviceToLogicalYRel( h );
*height = DeviceToLogicalYRel((wxCoord)h);
if ( descent )
*descent =DeviceToLogicalYRel( d);
*descent = DeviceToLogicalYRel((wxCoord)d);
if ( externalLeading )
*externalLeading = DeviceToLogicalYRel( e);
*externalLeading = DeviceToLogicalYRel((wxCoord)e);
if ( width )
*width = DeviceToLogicalXRel( w );
*width = DeviceToLogicalXRel((wxCoord)w);
if ( theFont )
{
@@ -1213,7 +1213,7 @@ bool wxGCDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) c
m_graphicContext->GetPartialTextExtents( text, widthsD );
for ( size_t i = 0; i < widths.GetCount(); ++i )
widths[i] = DeviceToLogicalXRel( widthsD[i] + 0.5 ) ;
widths[i] = DeviceToLogicalXRel((wxCoord)(widthsD[i] + 0.5));
return true;
}
@@ -1289,10 +1289,10 @@ void wxGCDC::DoGradientFillLinear(const wxRect& rect,
LogicalToDeviceX(start.x),LogicalToDeviceY(start.y),
LogicalToDeviceX(end.x),LogicalToDeviceY(end.y), initialColour, destColour);
wxCoord xx = LogicalToDeviceX(rect.x);
wxCoord yy = LogicalToDeviceY(rect.y);
wxDouble xx = LogicalToDeviceX(rect.x);
wxDouble yy = LogicalToDeviceY(rect.y);
wxDouble ww = m_signX * LogicalToDeviceXRel(rect.width);
wxCoord hh = m_signY * LogicalToDeviceYRel(rect.height);
wxDouble hh = m_signY * LogicalToDeviceYRel(rect.height);
if (ww == 0 || hh == 0)
return;
@@ -1327,10 +1327,10 @@ void wxGCDC::DoGradientFillConcentric(const wxRect& rect,
else
nRadius = cy;
wxCoord xx = LogicalToDeviceX(rect.x);
wxCoord yy = LogicalToDeviceY(rect.y);
wxDouble xx = LogicalToDeviceX(rect.x);
wxDouble yy = LogicalToDeviceY(rect.y);
wxDouble ww = m_signX * LogicalToDeviceXRel(rect.width);
wxCoord hh = m_signY * LogicalToDeviceYRel(rect.height);
wxDouble hh = m_signY * LogicalToDeviceYRel(rect.height);
if (ww == 0 || hh == 0)
return;

View File

@@ -119,7 +119,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
if (!rootwindow)
return;
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
int x , y ;
x = y = 0 ;
window->MacWindowToRootWindow( &x , &y ) ;
@@ -151,7 +150,7 @@ wxWindowDC::wxWindowDC(wxWindow *window)
#else
m_macLocalOrigin.x = x ;
m_macLocalOrigin.y = y ;
m_macPort = UMAGetWindowPort( windowref ) ;
m_macPort = UMAGetWindowPort( (WindowRef) rootwindow->MacGetWindowRef() ) ;
CopyRgn( (RgnHandle) window->MacGetVisibleRegion(true).GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ;
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;

View File

@@ -24,16 +24,16 @@ wxScreenDC::wxScreenDC()
CGRect cgbounds ;
cgbounds = CGDisplayBounds(CGMainDisplayID());
Rect bounds;
bounds.top = cgbounds.origin.y;
bounds.left = cgbounds.origin.x;
bounds.bottom = bounds.top + cgbounds.size.height;
bounds.right = bounds.left + cgbounds.size.width;
bounds.top = (short)cgbounds.origin.y;
bounds.left = (short)cgbounds.origin.x;
bounds.bottom = bounds.top + (short)cgbounds.size.height;
bounds.right = bounds.left + (short)cgbounds.size.width;
WindowAttributes overlayAttributes = kWindowIgnoreClicksAttribute;
OSStatus err = CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );
CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );
ShowWindow((WindowRef)m_overlayWindow);
SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) );
m_width = cgbounds.size.width;
m_height = cgbounds.size.height;
m_width = (wxCoord)cgbounds.size.width;
m_height = (wxCoord)cgbounds.size.height;
#else
m_macPort = CreateNewPort() ;
GrafPtr port ;

View File

@@ -569,13 +569,12 @@ int wxDisplayDepth()
void wxDisplaySize(int *width, int *height)
{
#if wxMAC_USE_CORE_GRAPHICS
CGRect bounds ;
// TODO adapt for multi-displays
bounds = CGDisplayBounds(CGMainDisplayID());
CGRect bounds = CGDisplayBounds(CGMainDisplayID());
if ( width )
*width = bounds.size.width ;
*width = (int)bounds.size.width ;
if ( height )
*height = bounds.size.height;
*height = (int)bounds.size.height;
#else
BitMap screenBits;
GetQDGlobalsScreenBits( &screenBits );