shutdownicon.cxx (d119d52d) shutdownicon.cxx (143238c7)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 176 unchanged lines hidden (view full) ---

185 *pInit = disabled_initSystray;
186 if ( !*pDeInit )
187 *pDeInit = disabled_deInitSystray;
188 }
189
190 return true;
191}
192
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 176 unchanged lines hidden (view full) ---

185 *pInit = disabled_initSystray;
186 if ( !*pDeInit )
187 *pDeInit = disabled_deInitSystray;
188 }
189
190 return true;
191}
192
193
194struct AsyncDesktopTerminationData
195{
196 Reference< XDesktop > mxDesktop;
197 AsyncDesktopTerminationData( const Reference< XDesktop > &xDesktop )
198 : mxDesktop( xDesktop ) {}
199};
200
201
193class IdleUnloader : Timer
194{
195 ::osl::Module *m_pModule;
196public:
197 IdleUnloader (::osl::Module **pModule) :
198 m_pModule (*pModule)
199 {
200 *pModule = NULL;

--- 378 unchanged lines hidden (view full) ---

579 pInst->m_bListenForTermination = true;
580 xDesktop->removeTerminateListener( pInst );
581
582 // terminate desktop only if no tasks exist
583 Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
584 if ( xSupplier.is() )
585 {
586 Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
202class IdleUnloader : Timer
203{
204 ::osl::Module *m_pModule;
205public:
206 IdleUnloader (::osl::Module **pModule) :
207 m_pModule (*pModule)
208 {
209 *pModule = NULL;

--- 378 unchanged lines hidden (view full) ---

588 pInst->m_bListenForTermination = true;
589 xDesktop->removeTerminateListener( pInst );
590
591 // terminate desktop only if no tasks exist
592 Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
593 if ( xSupplier.is() )
594 {
595 Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
587 if( xTasks.is() )
596 if( xTasks.is() && xTasks->getCount() < 1 )
588 {
597 {
589 if( xTasks->getCount() < 1 )
590 xDesktop->terminate();
598 AsyncDesktopTerminationData * pData = new AsyncDesktopTerminationData( xDesktop );
599 if ( !Application::PostUserEvent( STATIC_LINK( 0, ShutdownIcon, AsyncDesktopTermination ), pData ) )
600 delete pData;
591 }
592 }
593
594 // remove the instance pointer
595 ShutdownIcon::pShutdownIcon = 0;
596}
597
601 }
602 }
603
604 // remove the instance pointer
605 ShutdownIcon::pShutdownIcon = 0;
606}
607
608
609IMPL_STATIC_LINK_NOINSTANCE( ShutdownIcon, AsyncDesktopTermination, AsyncDesktopTerminationData*, pData )
610{
611 if ( pData && pData->mxDesktop.is() )
612 pData->mxDesktop->terminate();
613 delete pData;
614 return 0;
615}
616
617
618
598// ---------------------------------------------------------------------------
599
600ShutdownIcon* ShutdownIcon::getInstance()
601{
602 OSL_ASSERT( pShutdownIcon );
603 return pShutdownIcon;
604}
605

--- 364 unchanged lines hidden ---
619// ---------------------------------------------------------------------------
620
621ShutdownIcon* ShutdownIcon::getInstance()
622{
623 OSL_ASSERT( pShutdownIcon );
624 return pShutdownIcon;
625}
626

--- 364 unchanged lines hidden ---