summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-10-03 15:16:32 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-10-25 13:41:51 +0100
commitf88ff49c733392e66dd178928efa3d807f2cffca (patch)
treeaa710956cdbf536be2cbdffc8d4d4738cf5a24f9 /vcl/unx/generic
parenta4d7b25e7a006c3105a226343bfb52d9e1bc356a (diff)
generic: try to cleanup SalXLib cruft some more
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/app/saldata.cxx9
-rw-r--r--vcl/unx/generic/app/saldisp.cxx14
-rw-r--r--vcl/unx/generic/app/salinst.cxx15
-rw-r--r--vcl/unx/generic/app/saltimer.cxx6
4 files changed, 24 insertions, 20 deletions
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: */