summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-10-16 03:20:00 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-25 19:55:38 -0500
commitd88b292704957818eff9a348a524b5c90b40031b (patch)
treeeabf039491304b2c13f3bd77ca0b6d58c3dba1b8 /vcl
parent98b2c08dff4d00b3e7a2e001c326ebe27dae4549 (diff)
merge vosremoval-mutex.diff
In practice the changeset is 'inspired' by vosremoval-mutex.diff but was essentially redone manually
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salinst.h8
-rw-r--r--vcl/aqua/source/app/salinst.cxx9
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx2
-rw-r--r--vcl/inc/vcl/salinst.hxx4
-rw-r--r--vcl/inc/vcl/solarmutex.hxx76
-rw-r--r--vcl/inc/vcl/svapp.hxx8
-rw-r--r--vcl/os2/inc/salinst.h5
-rw-r--r--vcl/os2/source/app/salinst.cxx20
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/app/dbggui.cxx2
-rw-r--r--vcl/source/app/makefile.mk1
-rw-r--r--vcl/source/app/solarmutex.cxx57
-rw-r--r--vcl/source/app/svapp.cxx5
-rw-r--r--vcl/source/app/svdata.cxx2
-rw-r--r--vcl/source/components/dtranscomp.cxx2
-rw-r--r--vcl/source/control/edit.cxx2
-rw-r--r--vcl/source/gdi/bmpconv.cxx2
-rw-r--r--vcl/source/helper/canvasbitmap.cxx2
-rw-r--r--vcl/source/window/dndevdis.cxx25
-rw-r--r--vcl/test/dndtest.cxx1
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx34
-rw-r--r--vcl/unx/headless/svpinst.cxx9
-rw-r--r--vcl/unx/headless/svpinst.hxx8
-rw-r--r--vcl/unx/inc/salinst.h10
-rw-r--r--vcl/unx/inc/salsys.h2
-rw-r--r--vcl/unx/kde/kdedata.cxx2
-rw-r--r--vcl/unx/source/app/saldata.cxx2
-rw-r--r--vcl/unx/source/app/saldisp.cxx27
-rw-r--r--vcl/unx/source/app/salinst.cxx10
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx91
-rw-r--r--vcl/win/inc/salinst.h6
-rw-r--r--vcl/win/source/app/salinst.cxx6
33 files changed, 288 insertions, 155 deletions
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index 1a4ad9425113..b82f4ff3eb82 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -29,7 +29,7 @@
#define _SV_SALINST_H
#include "vcl/sv.h"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "osl/thread.hxx"
#include "vcl/salinst.hxx"
#include "osl/conditn.h"
@@ -46,7 +46,7 @@ class Image;
// - SalYieldMutex -
// -----------------
-class SalYieldMutex : public vos::OMutex
+class SalYieldMutex : public vcl::SolarMutexObject
{
ULONG mnCount;
oslThreadIdentifier mnThreadId;
@@ -60,7 +60,7 @@ public:
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
-#define YIELD_GUARD vos::OGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
+//#define YIELD_GUARD vos::OGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
// -------------------
@@ -131,7 +131,7 @@ public:
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
- virtual vos::IMutex* GetYieldMutex();
+ virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index c8461c39db60..bf8c79d8cea9 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -41,6 +41,7 @@
#include "vcl/window.hxx"
#include "vcl/timer.hxx"
#include "vcl/impbmp.hxx"
+#include "vcl/solarmutex.hxx"
#include "saldata.hxx"
#include "salinst.h"
@@ -371,7 +372,7 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
@@ -384,12 +385,12 @@ void SalYieldMutex::release()
mnThreadId = 0;
mnCount--;
}
- OMutex::release();
+ SolarMutexObject::release();
}
sal_Bool SalYieldMutex::tryToAcquire()
{
- if ( OMutex::tryToAcquire() )
+ if ( SolarMutexObject::tryToAcquire() )
{
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
@@ -526,7 +527,7 @@ void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* p
// -----------------------------------------------------------------------
-vos::IMutex* AquaSalInstance::GetYieldMutex()
+osl::SolarMutex* AquaSalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 5dfb9e359c3e..5061a90d41e2 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -46,7 +46,7 @@
#include "osl/file.hxx"
#include "osl/process.h"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "rtl/bootstrap.h"
#include "rtl/strbuf.hxx"
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index 5863fb824313..30187dde2108 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -62,8 +62,6 @@ class SalSession;
struct SystemGraphicsData;
struct SystemWindowData;
-namespace vos { class IMutex; }
-
// ---------------
// - SalInstance -
// ---------------
@@ -131,7 +129,7 @@ public:
virtual SalBitmap* CreateSalBitmap() = 0;
// YieldMutex
- virtual vos::IMutex* GetYieldMutex() = 0;
+ virtual osl::SolarMutex* GetYieldMutex() = 0;
virtual ULONG ReleaseYieldMutex() = 0;
virtual void AcquireYieldMutex( ULONG nCount ) = 0;
diff --git a/vcl/inc/vcl/solarmutex.hxx b/vcl/inc/vcl/solarmutex.hxx
new file mode 100644
index 000000000000..c4fa5d6de2e6
--- /dev/null
+++ b/vcl/inc/vcl/solarmutex.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _VCL_SOLARMUTEX_HXX_
+#define _VCL_SOLARMUTEX_HXX_
+
+#include <osl/mutex.hxx>
+#include <vcl/dllapi.h>
+
+namespace vcl
+{
+
+/** Implementation of the SolarMutex interface.
+ */
+class VCL_DLLPUBLIC SolarMutexObject : public osl::SolarMutex
+{
+public:
+ //static SolarMutex& SAL_CALL getGlobalMutex();
+
+ /** Creates mutex
+ */
+ SolarMutexObject();
+
+ /** Implicitly destroys mutex
+ */
+ virtual ~SolarMutexObject();
+
+ /** Blocks if Mutex is already in use
+ */
+ virtual void SAL_CALL acquire();
+
+ /** Tries to get the mutex without blocking.
+ @return True if mutex could be obtained, otherwise False
+ */
+ virtual sal_Bool SAL_CALL tryToAcquire();
+
+ /** Releases the mutex.
+ */
+ virtual void SAL_CALL release();
+
+protected:
+ oslMutex m_solarMutex;
+
+private:
+ /* Disable copy/assignment
+ */
+ SolarMutexObject( const SolarMutexObject& );
+ SolarMutexObject& SAL_CALL operator=( const SolarMutexObject& );
+};
+
+}
+
+#endif // _VCL_SOLARMUTEX_HXX_
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 55c424d050c2..e608b61d0b7f 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -30,7 +30,7 @@
#define _SV_SVAPP_HXX
#include <osl/thread.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <tools/string.hxx>
#include <tools/link.hxx>
#include <tools/unqid.hxx>
@@ -279,7 +279,7 @@ public:
static void Reschedule( bool bAllEvents = false );
static void Yield( bool bAllEvents = false );
static void EndYield();
- static vos::IMutex& GetSolarMutex();
+ static osl::SolarMutex& GetSolarMutex();
static oslThreadIdentifier GetMainThreadIdentifier();
static ULONG ReleaseSolarMutex();
static void AcquireSolarMutex( ULONG nCount );
@@ -504,7 +504,7 @@ class VCL_DLLPUBLIC SolarMutexGuard
private:
SolarMutexGuard( const SolarMutexGuard& );
const SolarMutexGuard& operator = ( const SolarMutexGuard& );
- ::vos::IMutex& m_solarMutex;
+ ::osl::SolarMutex& m_solarMutex;
public:
@@ -557,7 +557,7 @@ public:
}
}
protected:
- vos::IMutex& m_solarMutex;
+ osl::SolarMutex& m_solarMutex;
};
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index 0948f605c286..ddb2050b33e3 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -30,6 +30,7 @@
#include <vcl/sv.h>
#include <vcl/salinst.hxx>
+#include <vcl/solarmutex.hxx>
namespace vos { class OMutex; }
@@ -52,7 +53,7 @@ public:
char** mpArgv; // commandline
HWND mhComWnd; // window, for communication (between threads and the main thread)
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
- vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex
+ osl::Mutex* mpSalWaitMutex; // Sal-Wait-Mutex
USHORT mnYieldWaitCount; // Wait-Count
public:
@@ -82,7 +83,7 @@ public:
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
- virtual vos::IMutex* GetYieldMutex();
+ virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
virtual void Yield( bool, bool );
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index e89c345edc9a..90483bdb3a9b 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -36,7 +36,7 @@
#define _SV_SALINST_CXX
-#include <vos/mutex.hxx>
+#include <vcl/solarmutex.hxx>
#include <tools/debug.hxx>
#include <salids.hrc>
@@ -82,7 +82,7 @@ MRESULT EXPENTRY SalComWndProc( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nMP2
// =======================================================================
-class SalYieldMutex : public vos::OMutex
+class SalYieldMutex : public vcl::SolarMutexObject
{
public:
Os2SalInstance* mpInstData;
@@ -112,7 +112,7 @@ SalYieldMutex::SalYieldMutex( Os2SalInstance* pInstData )
void SalYieldMutex::acquire()
{
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount++;
mnThreadId = GetCurrentThreadId();
}
@@ -123,7 +123,7 @@ void SalYieldMutex::release()
{
ULONG nThreadId = GetCurrentThreadId();
if ( mnThreadId != nThreadId )
- OMutex::release();
+ SolarMutexObject::release();
else
{
SalData* pSalData = GetSalData();
@@ -136,13 +136,13 @@ void SalYieldMutex::release()
WinPostMsg( mpInstData->mhComWnd, SAL_MSG_RELEASEWAITYIELD, 0, 0 );
mnThreadId = 0;
mnCount--;
- OMutex::release();
+ SolarMutexObject::release();
mpInstData->mpSalWaitMutex->release();
}
else
{
mnCount--;
- OMutex::release();
+ SolarMutexObject::release();
}
}
else
@@ -150,7 +150,7 @@ void SalYieldMutex::release()
if ( mnCount == 1 )
mnThreadId = 0;
mnCount--;
- OMutex::release();
+ SolarMutexObject::release();
}
}
}
@@ -159,7 +159,7 @@ void SalYieldMutex::release()
sal_Bool SalYieldMutex::tryToAcquire()
{
- if ( OMutex::tryToAcquire() )
+ if ( SolarMutexObject::tryToAcquire() )
{
mnCount++;
mnThreadId = GetCurrentThreadId();
@@ -493,7 +493,7 @@ Os2SalInstance::Os2SalInstance()
{
mhComWnd = 0;
mpSalYieldMutex = new SalYieldMutex( this );
- mpSalWaitMutex = new vos::OMutex;
+ mpSalWaitMutex = new osl::Mutex;
mnYieldWaitCount = 0;
mpSalYieldMutex->acquire();
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
@@ -512,7 +512,7 @@ Os2SalInstance::~Os2SalInstance()
// -----------------------------------------------------------------------
-vos::IMutex* Os2SalInstance::GetYieldMutex()
+osl::SolarMutex* Os2SalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 38c025b5a5af..b0e1aa2cd807 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -99,6 +99,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\settings.hxx %_DEST%\inc%_EXT%\vcl\settings.hxx
..\inc\vcl\slider.hxx %_DEST%\inc%_EXT%\vcl\slider.hxx
..\inc\vcl\sndstyle.hxx %_DEST%\inc%_EXT%\vcl\sndstyle.hxx
+..\inc\vcl\solarmutex.hxx %_DEST%\inc%_EXT%\vcl\solarmutex.hxx
..\inc\vcl\sound.hxx %_DEST%\inc%_EXT%\vcl\sound.hxx
..\inc\vcl\spin.h %_DEST%\inc%_EXT%\vcl\spin.h
..\inc\vcl\spin.hxx %_DEST%\inc%_EXT%\vcl\spin.hxx
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 65b7e2283361..cee78645b9f2 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -63,7 +63,7 @@
#include <vcl/unohelp.hxx>
#include <vcl/unohelp2.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <map>
#include <algorithm>
diff --git a/vcl/source/app/makefile.mk b/vcl/source/app/makefile.mk
index f0884a96a3ee..6e9c91f3c2e7 100644
--- a/vcl/source/app/makefile.mk
+++ b/vcl/source/app/makefile.mk
@@ -60,6 +60,7 @@ SLOFILES= $(SLO)$/dbggui.obj \
$(SLO)$/vclevent.obj \
$(SLO)$/i18nhelp.obj \
$(SLO)$/salvtables.obj \
+ $(SLO)$/solarmutex.obj \
$(SLO)$/session.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/app/solarmutex.cxx b/vcl/source/app/solarmutex.cxx
new file mode 100644
index 000000000000..6423a74e6c61
--- /dev/null
+++ b/vcl/source/app/solarmutex.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <vcl/solarmutex.hxx>
+
+using namespace vcl;
+
+SolarMutexObject::SolarMutexObject() : m_solarMutex( osl_createMutex() )
+{
+}
+
+SolarMutexObject::~SolarMutexObject()
+{
+ osl_destroyMutex( m_solarMutex );
+}
+
+void SolarMutexObject::acquire()
+{
+ osl_acquireMutex( m_solarMutex );
+}
+
+sal_Bool SolarMutexObject::tryToAcquire()
+{
+ return osl_tryToAcquireMutex( m_solarMutex );
+}
+
+void SolarMutexObject::release()
+{
+ osl_releaseMutex( m_solarMutex );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index cef68ca7ea1d..2bba83d0d287 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -34,7 +34,6 @@
#include "vcl/salframe.hxx"
#include "vcl/salsys.hxx"
#include "vos/process.hxx"
-#include "vos/mutex.hxx"
#include "tools/tools.h"
#include "tools/debug.hxx"
#include "tools/time.hxx"
@@ -67,7 +66,7 @@
#include "osl/module.h"
#include "osl/file.hxx"
-
+#include "osl/mutex.hxx"
#include "osl/thread.h"
#include "rtl/tencinfo.h"
#include "rtl/instance.hxx"
@@ -527,7 +526,7 @@ void Application::Quit()
// -----------------------------------------------------------------------
-vos::IMutex& Application::GetSolarMutex()
+osl::SolarMutex& Application::GetSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return *(pSVData->mpDefInst->GetYieldMutex());
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 771b1a8ba360..9fa919802728 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -34,7 +34,7 @@
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <osl/process.h>
#include <osl/file.hxx>
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index 84609aae7bbf..b46e33686b9b 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -45,7 +45,7 @@
#include "vcl/svapp.hxx"
#include "vcl/svdata.hxx"
#include "vcl/salinst.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "osl/mutex.hxx"
#include "cppuhelper/compbase1.hxx"
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 39d572c5f107..0ef45ccabd94 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -45,7 +45,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/window.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/i18n/XBreakIterator.hpp>
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index bd683ce62ee8..c47b3ca4908d 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -32,7 +32,7 @@
#include <vcl/bitmap.hxx>
#include <vcl/impbmpconv.hxx>
#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <tools/stream.hxx>
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/awt/XBitmap.hpp>
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index 3589bf6e9165..32f5ea768066 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/rendering/RenderingIntent.hpp>
#include <rtl/instance.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/canvasbitmap.hxx>
diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx
index 05ec366a509b..d9417e3bacf0 100644
--- a/vcl/source/window/dndevdis.cxx
+++ b/vcl/source/window/dndevdis.cxx
@@ -33,11 +33,9 @@
#include <vcl/dndlcon.hxx>
#include <vcl/window.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svdata.hxx>
-using namespace ::osl;
-using namespace ::vos;
using namespace ::cppu;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -91,7 +89,7 @@ Window* DNDEventDispatcher::findTopLevelWindow(Point location)
void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
@@ -131,7 +129,7 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtdee )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtdee.LocationX, dtdee.LocationY );
Window * pChildWindow = findTopLevelWindow(location);
@@ -159,7 +157,7 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
fireDragExitEvent( m_pCurrentWindow );
@@ -175,7 +173,7 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
@@ -216,7 +214,7 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& dtde )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
@@ -257,7 +255,8 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent& dge )
throw(RuntimeException)
-{ MutexGuard aImplGuard( m_aMutex );
+{
+ osl::MutexGuard aImplGuard( m_aMutex );
Point origin( dge.DragOriginX, dge.DragOriginY );
@@ -370,7 +369,7 @@ sal_Int32 DNDEventDispatcher::fireDragExitEvent( Window *pWindow ) throw(Runtime
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -401,7 +400,7 @@ sal_Int32 DNDEventDispatcher::fireDropActionChangedEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -434,7 +433,7 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -479,7 +478,7 @@ sal_Int32 DNDEventDispatcher::fireDragGestureEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDragGestureRecognizer > xDragGestureRecognizer = pWindow->GetDragGestureRecognizer();
diff --git a/vcl/test/dndtest.cxx b/vcl/test/dndtest.cxx
index ed55c84e5b1b..ecca58011c49 100644
--- a/vcl/test/dndtest.cxx
+++ b/vcl/test/dndtest.cxx
@@ -50,7 +50,6 @@
#include <stdio.h>
using namespace ::rtl;
-using namespace ::vos;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index d851a4da9565..9896456f91ec 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -44,7 +44,7 @@
#include <com/sun/star/accessibility/XAccessibleText.hpp>
// <--
#include <cppuhelper/implbase1.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index deb880c44bcc..159820ec3dbd 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -245,30 +245,30 @@ void GtkYieldMutex::acquire()
{
oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
if( mnCount > 0 && mnThreadId == aCurrentThread )
{
mnCount++;
- OMutex::release();
+ SolarMutexObject::release();
return;
}
- OMutex::release();
+ SolarMutexObject::release();
// obtain gdk mutex
gdk_threads_enter();
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = 1;
mnThreadId = aCurrentThread;
- OMutex::release();
+ SolarMutexObject::release();
}
void GtkYieldMutex::release()
{
oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
// strange things happen, do nothing if we don't own the mutex
if( mnThreadId == aCurrentThread )
{
@@ -279,29 +279,29 @@ void GtkYieldMutex::release()
mnThreadId = 0;
}
}
- OMutex::release();
+ SolarMutexObject::release();
}
sal_Bool GtkYieldMutex::tryToAcquire()
{
oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
if( mnCount > 0 )
{
if( mnThreadId == aCurrentThread )
{
mnCount++;
- OMutex::release();
+ SolarMutexObject::release();
return sal_True;
}
else
{
- OMutex::release();
+ SolarMutexObject::release();
return sal_False;
}
}
- OMutex::release();
+ SolarMutexObject::release();
// HACK: gdk_threads_mutex is private, we shouldn't use it.
// how to we do a try_lock without having a gdk_threads_try_enter ?
@@ -309,10 +309,10 @@ sal_Bool GtkYieldMutex::tryToAcquire()
return sal_False;
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = 1;
mnThreadId = aCurrentThread;
- OMutex::release();
+ SolarMutexObject::release();
return sal_True;
}
@@ -325,7 +325,7 @@ int GtkYieldMutex::Grab()
// is now locked again by gtk implicitly
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
int nRet = mnCount;
if( mnCount == 0 ) // recursive else
mnThreadId = osl::Thread::getCurrentIdentifier();
@@ -337,7 +337,7 @@ int GtkYieldMutex::Grab()
}
#endif
mnCount = 1;
- OMutex::release();
+ SolarMutexObject::release();
return nRet;
}
@@ -345,11 +345,11 @@ void GtkYieldMutex::Ungrab( int nGrabs )
{
// this MUST only be called when leaving the callback
// that locked the mutex with Grab()
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = nGrabs;
if( mnCount == 0 )
mnThreadId = 0;
- OMutex::release();
+ SolarMutexObject::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index a9b862bab609..10faf81434ba 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -41,6 +41,7 @@
#include <vcl/svdata.hxx>
#include <vcl/salatype.hxx>
#include <vcl/saldatabasic.hxx>
+#include <vcl/solarmutex.hxx>
#include <sal/types.h>
// plugin factory function
@@ -295,7 +296,7 @@ SalBitmap* SvpSalInstance::CreateSalBitmap()
return new SvpSalBitmap();
}
-vos::IMutex* SvpSalInstance::GetYieldMutex()
+osl::SolarMutex* SvpSalInstance::GetYieldMutex()
{
return &m_aYieldMutex;
}
@@ -464,7 +465,7 @@ SvpSalYieldMutex::SvpSalYieldMutex()
void SvpSalYieldMutex::acquire()
{
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
@@ -477,12 +478,12 @@ void SvpSalYieldMutex::release()
mnThreadId = 0;
mnCount--;
}
- OMutex::release();
+ SolarMutexObject::release();
}
sal_Bool SvpSalYieldMutex::tryToAcquire()
{
- if ( OMutex::tryToAcquire() )
+ if ( SolarMutexObject::tryToAcquire() )
{
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index 198cc9cb613c..ace3ac7c236c 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -32,7 +32,9 @@
#include <vcl/salinst.hxx>
#include <vcl/salwtype.hxx>
#include <vcl/saltimer.hxx>
-#include <vos/mutex.hxx>
+#include <vcl/solarmutex.hxx>
+
+#include <osl/mutex.hxx>
#include <osl/thread.hxx>
#include <list>
@@ -47,7 +49,7 @@
// SalYieldMutex
// -------------------------------------------------------------------------
-class SvpSalYieldMutex : public NAMESPACE_VOS(OMutex)
+class SvpSalYieldMutex : public ::vcl::SolarMutexObject
{
protected:
ULONG mnCount;
@@ -174,7 +176,7 @@ public:
virtual SalBitmap* CreateSalBitmap();
// YieldMutex
- virtual vos::IMutex* GetYieldMutex();
+ virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h
index e79648700272..6b578594e4a7 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -30,16 +30,12 @@
#define _SV_SALINST_H
#include <vcl/sv.h>
-#ifndef _VOS_MUTEX_HXX
-#include <vos/mutex.hxx>
-#endif
-#ifndef _THREAD_HXX_
#include <osl/thread.hxx>
-#endif
#include <vcl/dllapi.h>
#include <vcl/salinst.hxx>
+#include <vcl/solarmutex.hxx>
-class VCL_DLLPUBLIC SalYieldMutex : public NAMESPACE_VOS(OMutex)
+class VCL_DLLPUBLIC SalYieldMutex : public vcl::SolarMutexObject
{
protected:
ULONG mnCount;
@@ -99,7 +95,7 @@ public:
virtual SalBitmap* CreateSalBitmap();
virtual SalSession* CreateSalSession();
- virtual vos::IMutex* GetYieldMutex();
+ virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
diff --git a/vcl/unx/inc/salsys.h b/vcl/unx/inc/salsys.h
index 102c90182cea..c74d11306e01 100644
--- a/vcl/unx/inc/salsys.h
+++ b/vcl/unx/inc/salsys.h
@@ -31,7 +31,7 @@
#include <vcl/sv.h>
#ifndef _VOS_MUTEX_HXX
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#endif
#ifndef _THREAD_HXX_
#include <osl/thread.hxx>
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index b3a7c953ffa0..9c4f43fc9db7 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -55,7 +55,7 @@
#include "i18n_im.hxx"
#include "i18n_xkb.hxx"
#include <vos/process.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
/* #i59042# override KApplications method for session management
* since it will interfere badly with our own.
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index 9b685aa552f0..657bacb7bb03 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -58,7 +58,7 @@
#include <unistd.h>
#endif
#include <vos/process.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include "Xproto.h"
#include <saldisp.hxx>
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index e3a52772c3da..8a209d126a75 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -613,10 +613,12 @@ fd
if( ! pDisplay->IsDisplay() )
return 0;
- vos::IMutex* pSalInstYieldMutex =
- GetSalData()->m_pInstance->GetYieldMutex();
- ::vos::OGuard aGuard( *pSalInstYieldMutex );
- return pDisplay->IsEvent();
+ int result;
+
+ GetSalData()->m_pInstance->GetYieldMutex()->acquire();
+ result = pDisplay->IsEvent();
+ GetSalData()->m_pInstance->GetYieldMutex()->release();
+ return result;
}
static int DisplayQueue( int
#ifdef DBG_UTIL
@@ -626,11 +628,14 @@ fd
{
DBG_ASSERT( ConnectionNumber( pDisplay->GetDisplay() ) == fd,
"wrong fd in DisplayHasEvent" );
- vos::IMutex* pSalInstYieldMutex =
- GetSalData()->m_pInstance->GetYieldMutex();
- ::vos::OGuard aGuard( *pSalInstYieldMutex );
- return XEventsQueued( pDisplay->GetDisplay(),
+ int result;
+
+ GetSalData()->m_pInstance->GetYieldMutex()->acquire();
+ result = XEventsQueued( pDisplay->GetDisplay(),
QueuedAfterReading );
+ GetSalData()->m_pInstance->GetYieldMutex()->release();
+
+ return result;
}
static int DisplayYield( int
#ifdef DBG_UTIL
@@ -640,10 +645,10 @@ fd
{
DBG_ASSERT( ConnectionNumber( pDisplay->GetDisplay() ) == fd,
"wrong fd in DisplayHasEvent" );
- vos::IMutex* pSalInstYieldMutex =
- GetSalData()->m_pInstance->GetYieldMutex();
- ::vos::OGuard aGuard( *pSalInstYieldMutex );
+
+ GetSalData()->m_pInstance->GetYieldMutex()->acquire();
pDisplay->Yield();
+ GetSalData()->m_pInstance->GetYieldMutex()->release();
return TRUE;
}
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 20b23ae571b9..57f8d891a8a6 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -49,7 +49,7 @@
#include "vcl/salatype.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include <sal/macros.h>
// -------------------------------------------------------------------------
@@ -67,7 +67,7 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
@@ -80,12 +80,12 @@ void SalYieldMutex::release()
mnThreadId = 0;
mnCount--;
}
- OMutex::release();
+ SolarMutexObject::release();
}
sal_Bool SalYieldMutex::tryToAcquire()
{
- if ( OMutex::tryToAcquire() )
+ if ( SolarMutexObject::tryToAcquire() )
{
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
@@ -222,7 +222,7 @@ bool X11SalInstance::AnyInput(USHORT nType)
return bRet;
}
-vos::IMutex* X11SalInstance::GetYieldMutex()
+osl::SolarMutex* X11SalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index 707928c9c6a8..74d23b94f57f 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -74,7 +74,7 @@
#include <osl/process.h>
#include <comphelper/processfactory.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#define DRAG_EVENT_MASK ButtonPressMask |\
ButtonReleaseMask |\
@@ -89,7 +89,6 @@ using namespace com::sun::star::awt;
using namespace com::sun::star::uno;
using namespace com::sun::star::frame;
using namespace cppu;
-using namespace osl;
using namespace rtl;
using namespace x11;
@@ -326,7 +325,7 @@ XLIB_Cursor SelectionManager::createCursor( const char* pPointerData, const char
void SelectionManager::initialize( const Sequence< Any >& arguments ) throw (::com::sun::star::uno::Exception)
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
if( ! m_xDisplayConnection.is() )
{
@@ -478,7 +477,7 @@ SelectionManager::~SelectionManager()
fprintf( stderr, "SelectionManager::~SelectionManager (%s)\n", m_pDisplay ? DisplayString(m_pDisplay) : "no display" );
#endif
{
- MutexGuard aGuard( *Mutex::getGlobalMutex() );
+ osl::MutexGuard aGuard( *osl::Mutex::getGlobalMutex() );
::std::hash_map< OUString, SelectionManager*, OUStringHash >::iterator it;
for( it = getInstances().begin(); it != getInstances().end(); ++it )
@@ -504,7 +503,7 @@ SelectionManager::~SelectionManager()
// thread handle is freed in dragDoDispatch()
}
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "shutting down SelectionManager\n" );
@@ -554,7 +553,7 @@ SelectionAdaptor* SelectionManager::getAdaptor( Atom selection )
OUString SelectionManager::convertFromCompound( const char* pText, int nLen )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
OUString aRet;
if( nLen < 0 )
nLen = strlen( pText );
@@ -585,7 +584,7 @@ OUString SelectionManager::convertFromCompound( const char* pText, int nLen )
OString SelectionManager::convertToCompound( const OUString& rText )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
XTextProperty aProp;
aProp.value = NULL;
aProp.encoding = XA_STRING;
@@ -705,7 +704,7 @@ bool SelectionManager::convertData(
SelectionManager& SelectionManager::get( const OUString& rDisplayName )
{
- MutexGuard aGuard( *Mutex::getGlobalMutex() );
+ osl::MutexGuard aGuard( *osl::Mutex::getGlobalMutex() );
OUString aDisplayName( rDisplayName );
if( ! aDisplayName.getLength() )
@@ -724,7 +723,7 @@ SelectionManager& SelectionManager::get( const OUString& rDisplayName )
const OUString& SelectionManager::getString( Atom aAtom )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
::std::hash_map< Atom, OUString >::const_iterator it;
if( ( it = m_aAtomToString.find( aAtom ) ) == m_aAtomToString.end() )
@@ -745,7 +744,7 @@ const OUString& SelectionManager::getString( Atom aAtom )
Atom SelectionManager::getAtom( const OUString& rString )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
::std::hash_map< OUString, Atom, OUStringHash >::const_iterator it;
if( ( it = m_aStringToAtom.find( rString ) ) == m_aStringToAtom.end() )
@@ -765,7 +764,7 @@ bool SelectionManager::requestOwnership( Atom selection )
bool bSuccess = false;
if( m_pDisplay && m_aWindow )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
SelectionAdaptor* pAdaptor = getAdaptor( selection );
if( pAdaptor )
@@ -901,7 +900,7 @@ OUString SelectionManager::convertTypeFromNative( Atom nType, Atom selection, in
bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData )
{
- ResettableMutexGuard aGuard(m_aMutex);
+ osl::ResettableMutexGuard aGuard(m_aMutex);
::std::hash_map< Atom, Selection* >::iterator it;
bool bSuccess = false;
@@ -1045,7 +1044,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
::std::hash_map< Atom, Selection* >::iterator it;
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
it = m_aSelections.find( selection );
if( it == m_aSelections.end() )
@@ -1141,7 +1140,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
Atom pTypes[4] = { XA_PIXMAP, XA_PIXMAP,
XA_COLORMAP, XA_COLORMAP };
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
XChangeProperty( m_pDisplay,
m_aWindow,
@@ -1159,7 +1158,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
Atom* pReturnedTypes = (Atom*)aData.getArray();
if( pReturnedTypes[0] == XA_PIXMAP && pReturnedTypes[1] == XA_PIXMAP )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
Atom type = None;
int format = 0;
@@ -1207,7 +1206,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
// convert data if possible
if( aPixmap != None )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
sal_Int32 nOutSize = 0;
sal_uInt8* pBytes = X11_getBmpFromPixmap( m_pDisplay, aPixmap, aColormap, nOutSize );
@@ -1254,7 +1253,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
{
::std::hash_map< Atom, Selection* >::iterator it;
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
it = m_aSelections.find( selection );
if( it != m_aSelections.end() &&
@@ -1285,7 +1284,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
{
const unsigned int atomcount = 256;
// more than three types; look in property
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
Atom nType;
int nFormat;
@@ -1416,7 +1415,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
}
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
it = m_aSelections.find( selection );
if( it != m_aSelections.end() )
@@ -1478,7 +1477,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
Atom property,
Atom selection )
{
- ResettableMutexGuard aGuard( m_aMutex );
+ osl::ResettableMutexGuard aGuard( m_aMutex );
// handle targets related to image/bmp
if( target == XA_COLORMAP || target == XA_PIXMAP || target == XA_BITMAP || target == XA_VISUALID )
@@ -1638,7 +1637,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest )
{
- ResettableMutexGuard aGuard( m_aMutex );
+ osl::ResettableMutexGuard aGuard( m_aMutex );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "handleSelectionRequest for selection %s and target %s\n",
OUStringToOString( getString( rRequest.selection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
@@ -1846,7 +1845,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
bool SelectionManager::handleReceivePropertyNotify( XPropertyEvent& rNotify )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
// data we requested arrived
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "handleReceivePropertyNotify for property %s\n",
@@ -1965,7 +1964,7 @@ bool SelectionManager::handleReceivePropertyNotify( XPropertyEvent& rNotify )
bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
// ready for next part of a IncrementalTransfer
#if OSL_DEBUG_LEVEL > 1
@@ -2065,7 +2064,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify )
bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
bool bHandled = false;
@@ -2158,7 +2157,7 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify )
bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
{
- ResettableMutexGuard aGuard(m_aMutex);
+ osl::ResettableMutexGuard aGuard(m_aMutex);
// handle drop related events
XLIB_Window aSource = rMessage.data.l[0];
@@ -2340,7 +2339,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow, XLIB_Time )
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
if( aDropWindow == m_aCurrentDropWindow )
{
@@ -2408,7 +2407,7 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
void SelectionManager::sendDragStatus( Atom nDropAction )
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
if( m_xDragSourceListener.is() )
{
@@ -2537,7 +2536,7 @@ bool SelectionManager::updateDragAction( int modifierState )
void SelectionManager::sendDropPosition( bool bForce, XLIB_Time eventTime )
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
if( m_bDropSent )
return;
@@ -2600,7 +2599,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
if( ! m_xDragSourceListener.is() )
return false;
- ResettableMutexGuard aGuard(m_aMutex);
+ osl::ResettableMutexGuard aGuard(m_aMutex);
bool bHandled = false;
@@ -3057,7 +3056,7 @@ int SelectionManager::getXdndVersion( XLIB_Window aWindow, XLIB_Window& rProxy )
void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
- ResettableMutexGuard aGuard( m_aMutex );
+ osl::ResettableMutexGuard aGuard( m_aMutex );
Reference< XDragSourceListener > xListener( m_xDragSourceListener );
@@ -3252,7 +3251,7 @@ void SelectionManager::startDrag(
SalFrame* pCaptureFrame = NULL;
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
// first get the current pointer position and the window that
// the pointer is located in. since said window should be one
@@ -3328,7 +3327,7 @@ void SelectionManager::startDrag(
*/
if( nPointerGrabSuccess != GrabSuccess )
{
- vos::IMutex& rSolarMutex( Application::GetSolarMutex() );
+ osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
{
pCaptureFrame = GetX11SalData()->GetDisplay()->GetCaptureFrame();
@@ -3369,7 +3368,7 @@ void SelectionManager::startDrag(
listener->dragDropEnd( aDragFailedEvent );
if( pCaptureFrame )
{
- vos::IMutex& rSolarMutex( Application::GetSolarMutex() );
+ osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
@@ -3458,7 +3457,7 @@ void SelectionManager::startDrag(
if( pCaptureFrame )
{
- vos::IMutex& rSolarMutex( Application::GetSolarMutex() );
+ osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
@@ -3502,7 +3501,7 @@ void SelectionManager::dragDoDispatch()
fprintf( stderr, "end executeDrag dispatching\n" );
#endif
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
Reference< XDragSourceListener > xListener( m_xDragSourceListener );
Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
@@ -3562,7 +3561,7 @@ sal_Int32 SelectionManager::getCurrentCursor()
void SelectionManager::setCursor( sal_Int32 cursor, XLIB_Window aDropWindow, XLIB_Time )
{
- MutexGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
if( aDropWindow == m_aDropWindow && XLIB_Cursor(cursor) != m_aCurrentCursor )
{
if( m_xDragSourceListener.is() && ! m_bDropSent )
@@ -3584,7 +3583,7 @@ void SelectionManager::setImage( sal_Int32, XLIB_Window, XLIB_Time )
void SelectionManager::transferablesFlavorsChanged()
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
m_aDragFlavors = m_xDragSourceTransferable->getTransferDataFlavors();
int i;
@@ -3660,7 +3659,7 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
{
case SelectionClear:
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "SelectionClear for selection %s\n",
OUStringToOString( getString( rEvent.xselectionclear.selection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr()
@@ -3736,7 +3735,7 @@ void SelectionManager::dispatchEvent( int millisec )
{
// now acquire the mutex to prevent other threads
// from using the same X connection
- ResettableMutexGuard aGuard(m_aMutex);
+ osl::ResettableMutexGuard aGuard(m_aMutex);
// prevent that another thread already ate the input
// this can happen if e.g. another thread does
@@ -3792,7 +3791,7 @@ void SelectionManager::run( void* pThis )
if( (aNow.tv_sec - aLast.tv_sec) > 0 )
{
- ClearableMutexGuard aGuard(This->m_aMutex);
+ osl::ClearableMutexGuard aGuard(This->m_aMutex);
std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList;
for( std::hash_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
@@ -3825,7 +3824,7 @@ void SelectionManager::run( void* pThis )
void SelectionManager::shutdown() throw()
{
- ResettableMutexGuard aGuard(m_aMutex);
+ osl::ResettableMutexGuard aGuard(m_aMutex);
// stop dispatching
if( m_aThread )
{
@@ -3880,7 +3879,7 @@ sal_Bool SelectionManager::handleEvent( const Any& event ) throw()
if( nTimestamp != CurrentTime )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
m_nSelectionTimestamp = nTimestamp;
}
@@ -3928,7 +3927,7 @@ void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang:
void SelectionManager::registerHandler( Atom selection, SelectionAdaptor& rAdaptor )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
Selection* pNewSelection = new Selection();
pNewSelection->m_pAdaptor = &rAdaptor;
@@ -3940,7 +3939,7 @@ void SelectionManager::registerHandler( Atom selection, SelectionAdaptor& rAdapt
void SelectionManager::deregisterHandler( Atom selection )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
::std::hash_map< Atom, Selection* >::iterator it =
m_aSelections.find( selection );
@@ -3968,7 +3967,7 @@ extern "C"
void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTarget )
{
- MutexGuard aGuard(m_aMutex);
+ osl::MutexGuard aGuard(m_aMutex);
// sanity check
::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it =
@@ -4012,7 +4011,7 @@ void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTar
void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
{
- ClearableMutexGuard aGuard(m_aMutex);
+ osl::ClearableMutexGuard aGuard(m_aMutex);
m_aDropTargets.erase( aWindow );
if( aWindow == m_aDragSourceWindow && m_aDragRunning.check() )
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h
index f3005e3ad30b..1388763db726 100644
--- a/vcl/win/inc/salinst.h
+++ b/vcl/win/inc/salinst.h
@@ -31,8 +31,6 @@
#include <vcl/sv.h>
#include <vcl/salinst.hxx>
-namespace vos { class OMutex; }
-
// -------------------
// - SalInstanceData -
// -------------------
@@ -45,7 +43,7 @@ public:
HINSTANCE mhInst; // Instance Handle
HWND mhComWnd; // window, for communication (between threads and the main thread)
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
- vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex
+ osl::Mutex* mpSalWaitMutex; // Sal-Wait-Mutex
USHORT mnYieldWaitCount; // Wait-Count
public:
WinSalInstance();
@@ -74,7 +72,7 @@ public:
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
- virtual vos::IMutex* GetYieldMutex();
+ virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index eaa10b608269..ec8384cad451 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -38,7 +38,7 @@
#include <excpt.h>
#endif
#include <osl/file.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <wincomp.hxx>
#include <salids.hrc>
@@ -660,7 +660,7 @@ WinSalInstance::WinSalInstance()
{
mhComWnd = 0;
mpSalYieldMutex = new SalYieldMutex( this );
- mpSalWaitMutex = new vos::OMutex;
+ mpSalWaitMutex = new osl::Mutex;
mnYieldWaitCount = 0;
mpSalYieldMutex->acquire();
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
@@ -679,7 +679,7 @@ WinSalInstance::~WinSalInstance()
// -----------------------------------------------------------------------
-vos::IMutex* WinSalInstance::GetYieldMutex()
+osl::SolarMutex* WinSalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}