diff options
author | Kurt Zenker <kz@openoffice.org> | 2003-11-18 13:51:01 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2003-11-18 13:51:01 +0000 |
commit | ebfcc0f34bc89e581d5f699d789e839a491dad56 (patch) | |
tree | fb795c1de0c56ba0b6dc5f7333ba645d73cd57f4 /vcl | |
parent | f3d5aa2b26d698561e18786343484892a73c864a (diff) |
INTEGRATION: CWS vclplug (1.2.134); FILE MERGED
2003/10/29 18:29:28 pl 1.2.134.2: #i21232# timer must run in main thread
2003/10/24 13:35:12 pl 1.2.134.1: #21232# win port of virtualiing sal part
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/app/saltimer.cxx | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx index 553e358dee6b..1a61dbb43be5 100644 --- a/vcl/win/source/app/saltimer.cxx +++ b/vcl/win/source/app/saltimer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: saltimer.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2003-05-28 12:35:28 $ + * last change: $Author: kz $ $Date: 2003-11-18 14:51:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,8 +68,11 @@ #ifndef _SV_SALDATA_HXX #include <saldata.hxx> #endif -#ifndef _SV_SALTIMER_HXX -#include <saltimer.hxx> +#ifndef _SV_SALTIMER_H +#include <saltimer.h> +#endif +#ifndef _SV_SALINST_H +#include <salinst.h> #endif // ======================================================================= @@ -102,7 +105,26 @@ void ImplSalStartTimer( ULONG nMS, BOOL bMutex ) // ----------------------------------------------------------------------- -void SalTimer::Stop() +WinSalTimer::~WinSalTimer() +{ +} + +void WinSalTimer::Start( ULONG nMS ) +{ + // switch to main thread + SalData* pSalData = GetSalData(); + if ( pSalData->mpFirstInstance ) + { + if ( pSalData->mnAppThreadId != GetCurrentThreadId() ) + ImplPostMessage( pSalData->mpFirstInstance->mhComWnd, SAL_MSG_STARTTIMER, 0, (LPARAM)nMS ); + else + ImplSendMessage( pSalData->mpFirstInstance->mhComWnd, SAL_MSG_STARTTIMER, 0, (LPARAM)nMS ); + } + else + ImplSalStartTimer( nMS, FALSE ); +} + +void WinSalTimer::Stop() { SalData* pSalData = GetSalData(); @@ -116,29 +138,22 @@ void SalTimer::Stop() // ----------------------------------------------------------------------- -void SalTimer::SetCallback( SALTIMERPROC pProc ) -{ - SalData* pSalData = GetSalData(); - pSalData->mpTimerProc = pProc; -} - -// ----------------------------------------------------------------------- - void CALLBACK SalTimerProc( HWND, UINT, UINT, DWORD ) { SalData* pSalData = GetSalData(); + ImplSVData* pSVData = ImplGetSVData(); // Test for MouseLeave SalTestMouseLeave(); - if ( pSalData->mpTimerProc ) + if ( pSVData->mpSalTimer ) { // Try to aquire the mutex. If we don't get the mutex then we // try this a short time later again. if ( ImplSalYieldMutexTryToAcquire() ) { pSalData->mbInTimerProc = TRUE; - pSalData->mpTimerProc(); + pSVData->mpSalTimer->CallCallback(); pSalData->mbInTimerProc = FALSE; ImplSalYieldMutexRelease(); |