summaryrefslogtreecommitdiff
path: root/vcl/unx/source/app/salinst.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/source/app/salinst.cxx')
-rw-r--r--vcl/unx/source/app/salinst.cxx47
1 files changed, 32 insertions, 15 deletions
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 57f8d891a8a6..9b83ceb45413 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -46,7 +46,7 @@
#include "sm.hxx"
#include "vcl/salwtype.hxx"
-#include "vcl/salatype.hxx"
+#include "vcl/apptypes.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
#include "osl/mutex.hxx"
@@ -151,8 +151,8 @@ X11SalInstance::~X11SalInstance()
struct PredicateReturn
{
- USHORT nType;
- BOOL bRet;
+ sal_uInt16 nType;
+ sal_Bool bRet;
};
extern "C" {
@@ -163,7 +163,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
if ( pPre->bRet )
return False;
- USHORT nType;
+ sal_uInt16 nType;
switch( pEvent->type )
{
@@ -189,29 +189,29 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
}
if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) )
- pPre->bRet = TRUE;
+ pPre->bRet = sal_True;
return False;
}
}
-bool X11SalInstance::AnyInput(USHORT nType)
+bool X11SalInstance::AnyInput(sal_uInt16 nType)
{
X11SalData *pSalData = GetX11SalData();
Display *pDisplay = pSalData->GetDisplay()->GetDisplay();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( (nType & INPUT_TIMER) &&
pSalData->GetDisplay()->GetXLib()->CheckTimeout( false ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
else if (XPending(pDisplay) )
{
PredicateReturn aInput;
XEvent aEvent;
- aInput.bRet = FALSE;
+ aInput.bRet = sal_False;
aInput.nType = nType;
XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent,
@@ -229,14 +229,14 @@ osl::SolarMutex* X11SalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG X11SalInstance::ReleaseYieldMutex()
+sal_uLong X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = pYieldMutex->GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -251,7 +251,7 @@ ULONG X11SalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void X11SalInstance::AcquireYieldMutex( ULONG nCount )
+void X11SalInstance::AcquireYieldMutex( sal_uLong nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -261,6 +261,23 @@ void X11SalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+// -----------------------------------------------------------------------
+
+bool X11SalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{ GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); }
@@ -272,14 +289,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
return pDisplay ? (void*)pDisplay : (void*)"";
}
-SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, ULONG nSalFrameStyle )
+SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle )
{
SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle );
return pFrame;
}
-SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, ULONG nStyle )
+SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong nStyle )
{
SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData );