summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-01-12 17:33:34 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-01-12 17:33:34 +0100
commitecb9166cbbbc7891b9a6f56a263502587a946dbd (patch)
tree68c0526e4b2c7b85753283a32c759213a1e9cfef /vcl/aqua
parent0a4c6941671d13891aafec23778baabc38980a70 (diff)
parentbfc17d4b7e7462dc228d683b2d6b1ba5ebcaa3d2 (diff)
rebase to DEV300_m97
Diffstat (limited to 'vcl/aqua')
-rw-r--r--vcl/aqua/inc/salobj.h1
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm73
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm3
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx2
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm4
-rw-r--r--vcl/aqua/source/window/salobj.cxx6
6 files changed, 32 insertions, 57 deletions
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h
index 0041b22c16a0..56b07cea4262 100644
--- a/vcl/aqua/inc/salobj.h
+++ b/vcl/aqua/inc/salobj.h
@@ -81,6 +81,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 06af0358c52b..5a476e0a54cc 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -360,68 +360,29 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
- YIELD_GUARD;
-
- SalData* pSalData = GetSalData();
- #if 1 // currently do some really bad hack
- if( ! pSalData->maFrames.empty() )
+ NSApplicationTerminateReply aReply = NSTerminateNow;
{
- /* #i92766# something really weird is going on with the retain count of
- our windows; sometimes we get a duplicate free before exit on one of our
- NSWindows. The reason is unclear; to avoid this currently we retain them once more
-
- FIXME: this is a really bad hack, relying on the system to catch the leaked
- resources. Find out what really goes on here and fix it !
- */
- std::vector< NSWindow* > aHackRetainedWindows;
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
- {
- #if OSL_DEBUG_LEVEL > 1
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, [(*it)->mpWindow retainCount],
- typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- #endif
- [(*it)->mpWindow retain];
- aHackRetainedWindows.push_back( (*it)->mpWindow );
- }
- if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) )
+ YIELD_GUARD;
+
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->maFrames.empty() )
{
- for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin();
- it != aHackRetainedWindows.end(); ++it )
- {
- // clean up the retaing count again from the shutdown workaround
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "releasing %p\n", (*it) );
- #endif
- [(*it) release];
- }
- return NSTerminateCancel;
+ // the following QueryExit will likely present a message box, activate application
+ [NSApp activateIgnoringOtherApps: YES];
+ aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
}
- #if OSL_DEBUG_LEVEL > 1
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
+
+ if( aReply == NSTerminateNow )
{
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
+ ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() );
+ GetpApp()->AppEvent( aEv );
+ ImplImageTreeSingletonRef()->shutDown();
+ // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
+ // can occur in Desktop::doShutdown for example
}
- #endif
}
- #else // the clean version follows
- return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
- #endif
- ImplImageTreeSingletonRef()->shutDown();
- return NSTerminateNow;
+
+ return aReply;
}
-(void)systemColorsChanged: (NSNotification*) pNotification
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index c6703b58be88..9afb5049e18b 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -322,6 +322,9 @@ class ControllerProperties
GDIMetaFile aMtf;
PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
VirtualDevice aDev;
+ if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
+ aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
// see salprn.cxx, currently we pretend to be a 720dpi device on printers
aDev.SetReferenceDevice( 720, 720 );
aDev.EnableOutput( TRUE );
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 9fcf3edcdddf..2ca77f095148 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -2349,8 +2349,10 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
const ImplFontCharMap* pMap = mpMacFontData->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no charmap" );
+ pMap->AddReference(); // TODO: add and use RAII object instead
// get unicode<->glyph encoding
+ // TODO? avoid sft mapping by using the pMap itself
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
for(; --nCharCount >= 0; nChar = pMap->GetNextChar( nChar ) )
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 240a915e4e12..bc87ea444710 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -154,7 +154,9 @@ static AquaSalFrame* getMouseContainerFrame()
NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
{ pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
pFrame->VCLToCocoa( aRect );
- return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
+ return pNSWindow;
}
-(AquaSalFrame*)getSalFrame
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 07d337dcc81a..f300929f04fe 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -237,3 +237,9 @@ const SystemEnvData* AquaSalObject::GetSystemData() const
return &maSysData;
}
+// -----------------------------------------------------------------------
+
+void AquaSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+