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:
@@ -1028,10 +1028,10 @@ void wxGCDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
|||||||
if ( m_logicalFunction != wxCOPY )
|
if ( m_logicalFunction != wxCOPY )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxCoord xx = LogicalToDeviceX(x);
|
wxDouble xx = LogicalToDeviceX(x);
|
||||||
wxCoord yy = LogicalToDeviceY(y);
|
wxDouble yy = LogicalToDeviceY(y);
|
||||||
wxDouble ww = m_signX * LogicalToDeviceXRel(width);
|
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
|
// CMB: draw nothing if transformed w or h is 0
|
||||||
if (ww == 0 || hh == 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 );
|
m_graphicContext->GetTextExtent( str, &w, &h, &d, &e );
|
||||||
|
|
||||||
if ( height )
|
if ( height )
|
||||||
*height = DeviceToLogicalYRel( h );
|
*height = DeviceToLogicalYRel((wxCoord)h);
|
||||||
if ( descent )
|
if ( descent )
|
||||||
*descent =DeviceToLogicalYRel( d);
|
*descent = DeviceToLogicalYRel((wxCoord)d);
|
||||||
if ( externalLeading )
|
if ( externalLeading )
|
||||||
*externalLeading = DeviceToLogicalYRel( e);
|
*externalLeading = DeviceToLogicalYRel((wxCoord)e);
|
||||||
if ( width )
|
if ( width )
|
||||||
*width = DeviceToLogicalXRel( w );
|
*width = DeviceToLogicalXRel((wxCoord)w);
|
||||||
|
|
||||||
if ( theFont )
|
if ( theFont )
|
||||||
{
|
{
|
||||||
@@ -1213,7 +1213,7 @@ bool wxGCDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) c
|
|||||||
|
|
||||||
m_graphicContext->GetPartialTextExtents( text, widthsD );
|
m_graphicContext->GetPartialTextExtents( text, widthsD );
|
||||||
for ( size_t i = 0; i < widths.GetCount(); ++i )
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1289,10 +1289,10 @@ void wxGCDC::DoGradientFillLinear(const wxRect& rect,
|
|||||||
LogicalToDeviceX(start.x),LogicalToDeviceY(start.y),
|
LogicalToDeviceX(start.x),LogicalToDeviceY(start.y),
|
||||||
LogicalToDeviceX(end.x),LogicalToDeviceY(end.y), initialColour, destColour);
|
LogicalToDeviceX(end.x),LogicalToDeviceY(end.y), initialColour, destColour);
|
||||||
|
|
||||||
wxCoord xx = LogicalToDeviceX(rect.x);
|
wxDouble xx = LogicalToDeviceX(rect.x);
|
||||||
wxCoord yy = LogicalToDeviceY(rect.y);
|
wxDouble yy = LogicalToDeviceY(rect.y);
|
||||||
wxDouble ww = m_signX * LogicalToDeviceXRel(rect.width);
|
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)
|
if (ww == 0 || hh == 0)
|
||||||
return;
|
return;
|
||||||
@@ -1327,10 +1327,10 @@ void wxGCDC::DoGradientFillConcentric(const wxRect& rect,
|
|||||||
else
|
else
|
||||||
nRadius = cy;
|
nRadius = cy;
|
||||||
|
|
||||||
wxCoord xx = LogicalToDeviceX(rect.x);
|
wxDouble xx = LogicalToDeviceX(rect.x);
|
||||||
wxCoord yy = LogicalToDeviceY(rect.y);
|
wxDouble yy = LogicalToDeviceY(rect.y);
|
||||||
wxDouble ww = m_signX * LogicalToDeviceXRel(rect.width);
|
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)
|
if (ww == 0 || hh == 0)
|
||||||
return;
|
return;
|
||||||
|
@@ -119,7 +119,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
|
|||||||
if (!rootwindow)
|
if (!rootwindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
|
|
||||||
int x , y ;
|
int x , y ;
|
||||||
x = y = 0 ;
|
x = y = 0 ;
|
||||||
window->MacWindowToRootWindow( &x , &y ) ;
|
window->MacWindowToRootWindow( &x , &y ) ;
|
||||||
@@ -151,7 +150,7 @@ wxWindowDC::wxWindowDC(wxWindow *window)
|
|||||||
#else
|
#else
|
||||||
m_macLocalOrigin.x = x ;
|
m_macLocalOrigin.x = x ;
|
||||||
m_macLocalOrigin.y = y ;
|
m_macLocalOrigin.y = y ;
|
||||||
m_macPort = UMAGetWindowPort( windowref ) ;
|
m_macPort = UMAGetWindowPort( (WindowRef) rootwindow->MacGetWindowRef() ) ;
|
||||||
|
|
||||||
CopyRgn( (RgnHandle) window->MacGetVisibleRegion(true).GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ;
|
CopyRgn( (RgnHandle) window->MacGetVisibleRegion(true).GetWXHRGN() , (RgnHandle) m_macBoundaryClipRgn ) ;
|
||||||
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
|
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
|
||||||
|
@@ -24,16 +24,16 @@ wxScreenDC::wxScreenDC()
|
|||||||
CGRect cgbounds ;
|
CGRect cgbounds ;
|
||||||
cgbounds = CGDisplayBounds(CGMainDisplayID());
|
cgbounds = CGDisplayBounds(CGMainDisplayID());
|
||||||
Rect bounds;
|
Rect bounds;
|
||||||
bounds.top = cgbounds.origin.y;
|
bounds.top = (short)cgbounds.origin.y;
|
||||||
bounds.left = cgbounds.origin.x;
|
bounds.left = (short)cgbounds.origin.x;
|
||||||
bounds.bottom = bounds.top + cgbounds.size.height;
|
bounds.bottom = bounds.top + (short)cgbounds.size.height;
|
||||||
bounds.right = bounds.left + cgbounds.size.width;
|
bounds.right = bounds.left + (short)cgbounds.size.width;
|
||||||
WindowAttributes overlayAttributes = kWindowIgnoreClicksAttribute;
|
WindowAttributes overlayAttributes = kWindowIgnoreClicksAttribute;
|
||||||
OSStatus err = CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );
|
CreateNewWindow( kOverlayWindowClass, overlayAttributes, &bounds, (WindowRef*) &m_overlayWindow );
|
||||||
ShowWindow((WindowRef)m_overlayWindow);
|
ShowWindow((WindowRef)m_overlayWindow);
|
||||||
SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) );
|
SetGraphicsContext( wxGraphicsContext::CreateFromNativeWindow( m_overlayWindow ) );
|
||||||
m_width = cgbounds.size.width;
|
m_width = (wxCoord)cgbounds.size.width;
|
||||||
m_height = cgbounds.size.height;
|
m_height = (wxCoord)cgbounds.size.height;
|
||||||
#else
|
#else
|
||||||
m_macPort = CreateNewPort() ;
|
m_macPort = CreateNewPort() ;
|
||||||
GrafPtr port ;
|
GrafPtr port ;
|
||||||
|
@@ -569,13 +569,12 @@ int wxDisplayDepth()
|
|||||||
void wxDisplaySize(int *width, int *height)
|
void wxDisplaySize(int *width, int *height)
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
CGRect bounds ;
|
|
||||||
// TODO adapt for multi-displays
|
// TODO adapt for multi-displays
|
||||||
bounds = CGDisplayBounds(CGMainDisplayID());
|
CGRect bounds = CGDisplayBounds(CGMainDisplayID());
|
||||||
if ( width )
|
if ( width )
|
||||||
*width = bounds.size.width ;
|
*width = (int)bounds.size.width ;
|
||||||
if ( height )
|
if ( height )
|
||||||
*height = bounds.size.height;
|
*height = (int)bounds.size.height;
|
||||||
#else
|
#else
|
||||||
BitMap screenBits;
|
BitMap screenBits;
|
||||||
GetQDGlobalsScreenBits( &screenBits );
|
GetQDGlobalsScreenBits( &screenBits );
|
||||||
|
Reference in New Issue
Block a user