summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-06 00:26:50 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-06 00:29:02 +0200
commit185b6251436ef03e314295e4fff8fcfae0d656b2 (patch)
tree7be253d9d95a78764d926fc4a03f895ca43db114
parentf7417d7aadba02caa96c0346996b4f2fff2ed2d3 (diff)
Add SvpSalInstance::PostedEventsInQueue()
Used by AndroidSalInstance::AnyInput(). Unfortunately there is no way to check for a specific type of input being queued as the AnyInput() API would want. That information is too hidden, sigh. Should fix that. Change-Id: I2d971a7da531bb00a80fd39311fb70ab29359b08
-rw-r--r--vcl/android/androidinst.cxx7
-rw-r--r--vcl/headless/svpinst.cxx11
-rw-r--r--vcl/inc/headless/svpinst.hxx2
3 files changed, 17 insertions, 3 deletions
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index dd49738fd4a8..85ae77c8aeca 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -659,9 +659,10 @@ bool AndroidSalInstance::AnyInput( sal_uInt16 nType )
{
if( (nType & VCL_INPUT_TIMER) != 0 )
return CheckTimeout( false );
- // FIXME: ideally we should check our input queue here ...
- LOGI("FIXME: AnyInput returns false");
- return false;
+
+ // Unfortunately there is no way to check for a specific type of
+ // input being queued. That information is too hidden, sigh.
+ return SvpSalInstance::s_pDefaultInstance->PostedEventsInQueue();
}
class AndroidSalSystem : public SvpSalSystem {
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 5d6d5b9aa8e3..6d1349072e10 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -118,6 +118,17 @@ void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16
Wakeup();
}
+bool SvpSalInstance::PostedEventsInQueue()
+{
+ bool result = false;
+ if( osl_acquireMutex( m_aEventGuard ) )
+ {
+ result = m_aUserEvents.size() > 0;
+ osl_releaseMutex( m_aEventGuard );
+ }
+ return result;
+}
+
void SvpSalInstance::deregisterFrame( SalFrame* pFrame )
{
m_aFrames.remove( pFrame );
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index 5b7536392b37..894f1941f296 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -96,6 +96,8 @@ public:
void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
+ bool PostedEventsInQueue();
+
void StartTimer( sal_uLong nMS );
void StopTimer();
void Wakeup();