diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/saldata.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/saltimer.h | 8 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldata.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/generic/app/salinst.cxx | 15 | ||||
-rw-r--r-- | vcl/unx/generic/app/saltimer.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/kde4/KDEXLib.cxx | 3 |
9 files changed, 35 insertions, 31 deletions
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx index 59a61f1cc923..30573b00132c 100644 --- a/vcl/inc/unx/saldata.hxx +++ b/vcl/inc/unx/saldata.hxx @@ -85,10 +85,6 @@ public: static int XIOErrorHdl( Display* ); }; -inline X11SalData* GetX11SalData() -{ return (X11SalData*)ImplGetSVData()->mpSalData; } - - #ifdef _SV_SALDISP_HXX inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const { pXLib_->XError( pDisplay, pEvent ); } diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 2a0a1e830080..20a1abc457a6 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -200,7 +200,7 @@ class VCLPLUG_GEN_PUBLIC SalXLib { protected: timeval m_aTimeout; - sal_uLong m_nTimeoutMS; + sal_uLong m_nTimeoutMS; int m_pTimeoutFDS[2]; bool m_bHaveSystemChildFrames; @@ -210,7 +210,6 @@ protected: fd_set aExceptionFDS_; YieldEntry *pYieldEntries_; - struct XErrorStackEntry { bool m_bIgnore; diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index 9b9a150deaab..e89efd8b17e2 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -39,10 +39,11 @@ // -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalXLib; class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance { protected: - + SalXLib *mpXLib; public: X11SalInstance( SalYieldMutex* pMutex ) : SalGenericInstance( pMutex ) {} virtual ~X11SalInstance(); @@ -71,6 +72,7 @@ public: virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); + void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; } // dtrans implementation virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > diff --git a/vcl/inc/unx/saltimer.h b/vcl/inc/unx/saltimer.h index f5c889cabe6e..a61887fdb8fe 100644 --- a/vcl/inc/unx/saltimer.h +++ b/vcl/inc/unx/saltimer.h @@ -31,15 +31,17 @@ #include <saltimer.hxx> +class SalXLib; class X11SalTimer : public SalTimer { + SalXLib *mpXLib; public: - X11SalTimer() {} + X11SalTimer( SalXLib *pXLib ) : mpXLib( pXLib ) {} virtual ~X11SalTimer(); // overload all pure virtual methods - void Start( sal_uIntPtr nMS ); - void Stop(); + void Start( sal_uIntPtr nMS ); + void Stop(); }; #endif diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 99136ad76d75..940dc22b0517 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -91,6 +91,11 @@ #endif #endif +inline X11SalData* GetX11SalData() +{ + return (X11SalData*)ImplGetSVData()->mpSalData; +} + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= static const struct timeval noyield__ = { 0, 0 }; static const struct timeval yield__ = { 0, 10000 }; @@ -232,7 +237,7 @@ static const char* XRequest[] = { int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent *pEvent ) { - OSL_ASSERT( GetX11SalData()->GetType() == SAL_DATA_UNX ); + OSL_ASSERT( GetX11SalData()->GetType() != SAL_DATA_GTK ); GetX11SalData()->XError( pDisplay, pEvent ); return 0; @@ -240,7 +245,7 @@ int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent *pEvent ) int X11SalData::XIOErrorHdl( Display * ) { - OSL_ASSERT( GetX11SalData()->GetType() == SAL_DATA_UNX ); + OSL_ASSERT( GetX11SalData()->GetType() != SAL_DATA_GTK ); /* #106197# hack: until a real shutdown procedure exists * _exit ASAP diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 4e30e1afe4ed..c0ca7fe1eb22 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -494,12 +494,12 @@ SalDisplay::SalDisplay( Display *display ) : #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "SalDisplay::SalDisplay()\n" ); #endif - X11SalData *pSalData = GetX11SalData(); + SalGenericData *pData = GetGenericData(); - DBG_ASSERT( ! pSalData->GetDisplay(), "Second SalDisplay created !!!\n" ); - pSalData->SetDisplay( this ); + DBG_ASSERT( ! pData->GetDisplay(), "Second SalDisplay created !!!\n" ); + pData->SetDisplay( this ); - pXLib_ = pSalData->GetLib(); + pXLib_ = ((X11SalData *)ImplGetSVData()->mpSalData)->GetLib(); m_nDefaultScreen = DefaultScreen( pDisp_ ); } @@ -524,7 +524,7 @@ SalDisplay::~SalDisplay( ) void SalDisplay::doDestruct() { - X11SalData *pSalData = GetX11SalData(); + SalGenericData *pData = GetGenericData(); delete m_pWMAdaptor; m_pWMAdaptor = NULL; @@ -565,8 +565,8 @@ void SalDisplay::doDestruct() pXLib_->Remove( ConnectionNumber( pDisp_ ) ); } - if( pSalData->GetDisplay() == this ) - pSalData->SetDisplay( NULL ); + if( pData->GetDisplay() == static_cast<const SalGenericDisplay *>( this ) ) + pData->SetDisplay( NULL ); } static int DisplayHasEvent( int fd, SalX11Display *pDisplay ) diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 7e70faae177f..caac06931ba3 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -77,6 +77,7 @@ extern "C" SetSalData( pSalData ); pSalData->m_pInstance = pInstance; pSalData->Init(); + pInstance->SetLib( pSalData->GetLib() ); return pInstance; } @@ -145,14 +146,11 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) bool X11SalInstance::AnyInput(sal_uInt16 nType) { - X11SalData *pSalData = GetX11SalData(); - SalGenericData *pData = GetGenericData(); Display *pDisplay = pData->GetSalDisplay()->GetDisplay(); sal_Bool bRet = sal_False; - if( (nType & INPUT_TIMER) && - pSalData->GetSalDisplay()->GetXLib()->CheckTimeout( false ) ) + if( (nType & INPUT_TIMER) && mpXLib->CheckTimeout( false ) ) { bRet = sal_True; } @@ -172,12 +170,13 @@ bool X11SalInstance::AnyInput(sal_uInt16 nType) return bRet; } -// ----------------------------------------------------------------------- - void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) -{ GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); } +{ + mpXLib->Yield( bWait, bHandleAllCurrentEvents ); +} -void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) +void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, + int& rReturnedBytes ) { static const char* pDisplay = getenv( "DISPLAY" ); rReturnedType = AsciiCString; diff --git a/vcl/unx/generic/app/saltimer.cxx b/vcl/unx/generic/app/saltimer.cxx index 98d6ccde5943..8ed841f6ce3a 100644 --- a/vcl/unx/generic/app/saltimer.cxx +++ b/vcl/unx/generic/app/saltimer.cxx @@ -78,7 +78,7 @@ void SalXLib::StartTimer( sal_uLong nMS ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SalTimer* X11SalInstance::CreateSalTimer() { - return new X11SalTimer(); + return new X11SalTimer( mpXLib ); } X11SalTimer::~X11SalTimer() @@ -87,12 +87,12 @@ X11SalTimer::~X11SalTimer() void X11SalTimer::Stop() { - GetX11SalData()->GetLib()->StopTimer(); + mpXLib->StopTimer(); } void X11SalTimer::Start( sal_uLong nMS ) { - GetX11SalData()->GetLib()->StartTimer( nMS ); + mpXLib->StartTimer( nMS ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 5515354b486d..ad46e61f4c44 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -370,7 +370,8 @@ void KDEXLib::StopTimer() void KDEXLib::timeoutActivated() { - GetX11SalData()->Timeout(); + X11SalData *pData = (X11SalData*)ImplGetSVData()->mpSalData; + pData->Timeout(); // QTimer is not single shot, so will be restarted immediatelly } |