[Libreoffice-commits] core.git: vcl/android vcl/headless vcl/inc

Tor Lillqvist tml at iki.fi
Tue Mar 5 14:29:35 PST 2013


 vcl/android/androidinst.cxx  |    7 ++++---
 vcl/headless/svpinst.cxx     |   11 +++++++++++
 vcl/inc/headless/svpinst.hxx |    2 ++
 3 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 185b6251436ef03e314295e4fff8fcfae0d656b2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Mar 6 00:26:50 2013 +0200

    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

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index dd49738..85ae77c 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 5d6d5b9..6d13490 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 5b75363..894f194 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();


More information about the Libreoffice-commits mailing list