diff options
author | Herbert Dürr <hdu@apache.org> | 2013-12-02 16:06:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-05 10:36:14 +0000 |
commit | 461e0f9eaf9895ecd0eba67b35a4d2cec8a5e5c5 (patch) | |
tree | 699e319ec551d6f70786f6806b9abb0743911fa3 /vcl/aqua/source/gdi | |
parent | 78ed89cebb2a8eaa9e9c480a92426c0070f4d3b6 (diff) |
Resolves: #i123795# variable names should not confuse vcl...
Window and cocoa NSWindow types
VCL's Window type and Cocoa's NSWindow type are quite different.
Naming variables as if they were the same introduces gratuitous
complexity especially when debugging stacks where both types are used.
The names of NSView type variables have been adjusted too.
(cherry picked from commit 5e6120c21a979c05bc6b9297035e31a47b98b785)
Conflicts:
vcl/aqua/source/app/vclnsapp.mm
vcl/aqua/source/gdi/salgdi.cxx
vcl/aqua/source/gdi/salgdiutils.cxx
vcl/aqua/source/window/salframe.cxx
vcl/aqua/source/window/salobj.cxx
vcl/inc/vcl/sysdata.hxx
vcl/source/window/syschild.cxx
vcl/source/window/window.cxx
Change-Id: Ic4143dfddfa9502a529c871ac4ce0bea413b6ce9
Diffstat (limited to 'vcl/aqua/source/gdi')
-rw-r--r-- | vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 38 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdicommon.cxx | 6 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdiutils.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salnativewidgets.cxx | 4 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salvd.cxx | 6 |
5 files changed, 20 insertions, 36 deletions
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index 0ba51e5bb115..5c6ea0e0162c 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -141,30 +141,14 @@ class ControllerProperties mnLastPageCount = nPages; if( mpState->bNeedRestart ) { - #if 0 // Warning: bad hack ahead // Apple does not give us a chance of changing the page count, // and they don't let us cancel the dialog either // hack: send a cancel message to the window displaying our views. // this is ugly. - for( std::vector< NSObject* >::iterator it = maViews.begin(); it != maViews.end(); ++it ) - { - if( [*it isKindOfClass: [NSView class]] ) - { - NSView* pView = (NSView*)*it; - NSWindow* pWindow = [pView window]; - if( pWindow ) - { - [pWindow cancelOperation: nil]; - break; - } - } - } - #else - NSWindow* pWindow = [NSApp modalWindow]; - if( pWindow ) - [pWindow cancelOperation: nil]; - #endif + NSWindow* pNSWindow = [NSApp modalWindow]; + if( pNSWindow ) + [pNSWindow cancelOperation: nil]; [[mpOp printInfo] setJobDisposition: NSPrintCancelJob]; } else @@ -593,7 +577,7 @@ struct ColumnItem } }; -static void adjustViewAndChildren( NSView* pView, NSSize& rMaxSize, +static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize, std::vector< ColumnItem >& rLeftColumn, std::vector< ColumnItem >& rRightColumn ) @@ -653,7 +637,7 @@ static void adjustViewAndChildren( NSView* pView, NSSize& rMaxSize, } } - NSArray* pSubViews = [pView subviews]; + NSArray* pSubViews = [pNSView subviews]; unsigned int nViews = [pSubViews count]; NSRect aUnion = { { 0, 0 }, { 0, 0 } }; @@ -676,7 +660,7 @@ static void adjustViewAndChildren( NSView* pView, NSSize& rMaxSize, // resize the view itself aUnion.size.height += 10; aUnion.size.width += 20; - [pView setFrameSize: aUnion.size]; + [pNSView setFrameSize: aUnion.size]; if( aUnion.size.width > rMaxSize.width ) rMaxSize.width = aUnion.size.width; @@ -692,15 +676,15 @@ static void adjustTabViews( NSTabView* pTabView, NSSize aTabSize ) for( int i = 0; i < nViews; i++ ) { NSTabViewItem* pItem = (NSTabViewItem*)[pTabbedViews objectAtIndex: i]; - NSView* pView = [pItem view]; - if( pView ) + NSView* pNSView = [pItem view]; + if( pNSView ) { - NSRect aRect = [pView frame]; + NSRect aRect = [pNSView frame]; double nDiff = aTabSize.height - aRect.size.height; aRect.size = aTabSize; - [pView setFrame: aRect]; + [pNSView setFrame: aRect]; - NSArray* pSubViews = [pView subviews]; + NSArray* pSubViews = [pNSView subviews]; unsigned int nSubViews = [pSubViews count]; // move everything up diff --git a/vcl/aqua/source/gdi/salgdicommon.cxx b/vcl/aqua/source/gdi/salgdicommon.cxx index a1691fefc327..f49ce9f65776 100644 --- a/vcl/aqua/source/gdi/salgdicommon.cxx +++ b/vcl/aqua/source/gdi/salgdicommon.cxx @@ -492,7 +492,7 @@ void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics ) { if( !rGraphics.mnRealDPIY && rGraphics.mbWindow && rGraphics.mpFrame ) { - rGraphics.initResolution( rGraphics.mpFrame->mpWindow ); + rGraphics.initResolution( rGraphics.mpFrame->getNSWindow() ); } mnRealDPIX = rGraphics.mnRealDPIX; mnRealDPIY = rGraphics.mnRealDPIY; @@ -1207,7 +1207,7 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) { if( !mnRealDPIY ) { - initResolution( (mbWindow && mpFrame) ? mpFrame->mpWindow : nil ); + initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil ); } rDPIX = static_cast<sal_Int32>(mfFakeDPIScale * mnRealDPIX); @@ -1594,7 +1594,7 @@ void AquaSalGraphics::updateResolution() { DBG_ASSERT( mbWindow, "updateResolution on inappropriate graphics" ); - initResolution( (mbWindow && mpFrame) ? mpFrame->mpWindow : nil ); + initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil ); } diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx index 0f7f79aa2c3c..c0a8d0d7ea6e 100644 --- a/vcl/aqua/source/gdi/salgdiutils.cxx +++ b/vcl/aqua/source/gdi/salgdiutils.cxx @@ -190,7 +190,7 @@ bool AquaSalGraphics::CheckContext() if( !mrContext ) { const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) }; - NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getWindow()]; + NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()]; CGContextRef xCGContext = reinterpret_cast<CGContextRef>([pNSGContext graphicsPort]); mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, NULL ); if( mxLayer ) diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index d9219cf5bd16..18ee1cc3ea2e 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -447,7 +447,7 @@ sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart n */ UInt32 AquaSalGraphics::getState( ControlState nState ) { - bool bDrawActive = mpFrame ? ([mpFrame->getWindow() isKeyWindow] ? true : false) : true; + const bool bDrawActive = mpFrame ? ([mpFrame->getNSWindow() isKeyWindow] ? true : false) : true; if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive ) { if( (nState & CTRL_STATE_HIDDEN) == 0 ) @@ -467,7 +467,7 @@ UInt32 AquaSalGraphics::getState( ControlState nState ) UInt32 AquaSalGraphics::getTrackState( ControlState nState ) { - bool bDrawActive = mpFrame ? ([mpFrame->getWindow() isKeyWindow] ? true : false) : true; + const bool bDrawActive = mpFrame ? ([mpFrame->getNSWindow() isKeyWindow] ? true : false) : true; if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive ) return kThemeTrackInactive; diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx index f58ce6fb4768..2be469c7ae2c 100644 --- a/vcl/aqua/source/gdi/salvd.cxx +++ b/vcl/aqua/source/gdi/salvd.cxx @@ -203,10 +203,10 @@ sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) if( pSalFrame ) { // #i91990# - NSWindow* pWindow = pSalFrame->getWindow(); - if ( pWindow ) + NSWindow* pNSWindow = pSalFrame->getNSWindow(); + if ( pNSWindow ) { - NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pWindow]; + NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pNSWindow]; if( pNSContext ) xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]); } |