[Libreoffice-commits] core.git: vcl/inc vcl/opengl vcl/unx

Stephan Bergmann sbergman at redhat.com
Thu Dec 4 09:29:56 PST 2014


 vcl/inc/generic/gendata.hxx              |    9 ++-------
 vcl/inc/unx/saldata.hxx                  |    4 +++-
 vcl/inc/unx/saldisp.hxx                  |   10 +++++++++-
 vcl/opengl/x11/salvd.cxx                 |    4 ++--
 vcl/unx/generic/app/i18n_ic.cxx          |   12 ++++++------
 vcl/unx/generic/app/i18n_status.cxx      |    6 +++---
 vcl/unx/generic/app/saldata.cxx          |    2 +-
 vcl/unx/generic/app/saldisp.cxx          |    6 +++---
 vcl/unx/generic/app/salinst.cxx          |    6 +++---
 vcl/unx/generic/app/sm.cxx               |    8 ++++----
 vcl/unx/generic/dtrans/X11_selection.cxx |    8 ++++----
 vcl/unx/generic/gdi/gcach_xpeer.cxx      |    2 +-
 vcl/unx/generic/gdi/salbmp.cxx           |   14 +++++++-------
 vcl/unx/generic/gdi/salgdi.cxx           |    4 ++--
 vcl/unx/generic/gdi/salgdi2.cxx          |    2 +-
 vcl/unx/generic/gdi/salvd.cxx            |    4 ++--
 vcl/unx/generic/gdi/xrender_peer.cxx     |    2 +-
 vcl/unx/generic/window/salframe.cxx      |    6 +++---
 vcl/unx/generic/window/salobj.cxx        |   10 +++++-----
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |    2 +-
 vcl/unx/gtk/window/gtkobject.cxx         |    2 +-
 vcl/unx/gtk/window/gtksalmenu.cxx        |    2 +-
 vcl/unx/x11/x11sys.cxx                   |   10 +++++-----
 23 files changed, 70 insertions(+), 65 deletions(-)

New commits:
commit 3042fa532a9b26203491b36f94d709c3b73e46ff
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 4 18:26:34 2014 +0100

    Move SalGenericData::GetSalDisplay() out of generic/gendata.hxx
    
    ...as it needs SalDisplay to be a complete type, but unx/saldisp.hxx depends on
    X11 headers and can thus e.g. not be included in generic/gendata.hxx on Android.
    
    Change-Id: Iec5f51408eef0d6eb7e2d04105a7408372b06079

diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx
index 6cd17b2..384c20a 100644
--- a/vcl/inc/generic/gendata.hxx
+++ b/vcl/inc/generic/gendata.hxx
@@ -12,12 +12,12 @@
 
 #include <osl/socket.hxx>
 
-#include <generic/gendisp.hxx>
 #include <saldatabasic.hxx>
-#include <unx/saldisp.hxx>
 
 // Not the prettiest - but helpful for migrating old code ...
 class GtkSalDisplay;
+class SalGenericDisplay;
+
 enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
                           SAL_DATA_TDE3, SAL_DATA_KDE3, SAL_DATA_KDE4,
                           SAL_DATA_UNX, SAL_DATA_SVP,
@@ -61,11 +61,6 @@ class VCL_DLLPUBLIC SalGenericData : public SalData
     virtual bool ErrorTrapPop( bool bIgnoreError = true ) = 0; // true on error
 
     // Not the prettiest - but helpful for migrating old code ...
-    inline SalDisplay *GetSalDisplay() const
-    {
-        OSL_ASSERT( m_eType != SAL_DATA_GTK3 );
-        return static_cast<SalDisplay *>(GetDisplay());
-    }
     inline GtkSalDisplay *GetGtkDisplay() const
     {
         return (GtkSalDisplay *)GetDisplay();
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index f2f7b1e..2c58231 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -23,6 +23,7 @@
 #include <prex.h>
 #include <postx.h>
 
+#include <unx/saldisp.hxx>
 #include <unx/salunx.h>
 #include <vcl/salgtype.hxx>
 #include <salframe.hxx>
@@ -68,7 +69,8 @@ public:
     virtual void            initNWF();
     virtual void            deInitNWF();
 
-    SalDisplay*             GetX11Display() const { return GetSalDisplay(); }
+    SalDisplay*             GetX11Display() const
+    { return vcl_sal::getSalDisplay(this); }
     void                    DeleteDisplay(); // for shutdown
 
     inline  SalXLib*        GetLib() const { return pXLib_; }
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 5f0e894..896ac52 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -36,6 +36,7 @@ class   SalXLib;
 #include <boost/unordered_map.hpp>
 #include <tools/gen.hxx>
 #include <salwtype.hxx>
+#include <generic/gendata.hxx>
 #include <generic/gendisp.hxx>
 
 #include <vclpluginapi.h>
@@ -404,11 +405,18 @@ public:
     void                SetupInput( SalI18N_InputMethod *pInputMethod );
 };
 
-// get foreign key names
 namespace vcl_sal {
+    // get foreign key names
     OUString getKeysymReplacementName(
         const OUString& pLang,
         KeySym nSymbol );
+
+    inline SalDisplay *getSalDisplay(SalGenericData const * data)
+    {
+        assert(data != nullptr);
+        assert(data->GetType() != SAL_DATA_GTK3);
+        return static_cast<SalDisplay *>(data->GetDisplay());
+    }
 }
 
 #endif // INCLUDED_VCL_INC_UNX_SALDISP_HXX
diff --git a/vcl/opengl/x11/salvd.cxx b/vcl/opengl/x11/salvd.cxx
index 7996cff..a8b18f9 100644
--- a/vcl/opengl/x11/salvd.cxx
+++ b/vcl/opengl/x11/salvd.cxx
@@ -47,10 +47,10 @@ X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics,
     // TODO Check where a VirtualDevice is created from SystemGraphicsData
     assert( pData == NULL ); (void)pData;
 
-    mpDisplay  = GetGenericData()->GetSalDisplay();
+    mpDisplay  = vcl_sal::getSalDisplay(GetGenericData());
     mnDepth    = nBitCount;
     mnXScreen  = pGraphics ? static_cast<X11SalGraphics*>(pGraphics)->GetScreenNumber() :
-                             GetGenericData()->GetSalDisplay()->GetDefaultXScreen();
+                             vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen();
     mnWidth    = nDX;
     mnHeight   = nDY;
     mpGraphics = new X11SalGraphics();
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index fc219b7..449e94d 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -168,7 +168,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
     maClientData.aInputEv.mbOnlyCursor      = false;
 
     SalI18N_InputMethod *pInputMethod;
-    pInputMethod = GetGenericData()->GetSalDisplay()->GetInputMethod();
+    pInputMethod = vcl_sal::getSalDisplay(GetGenericData())->GetInputMethod();
 
     mnSupportedPreeditStyle =   XIMPreeditCallbacks | XIMPreeditPosition
         | XIMPreeditNothing   | XIMPreeditNone;
@@ -277,7 +277,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
                 // XCreateIC() fails on Redflag Linux 2.0 if there is no
                 // fontset though the data itself is not evaluated nor is
                 // it required according to the X specs.
-                Display* pDisplay = GetGenericData()->GetSalDisplay()->GetDisplay();
+                Display* pDisplay = vcl_sal::getSalDisplay(GetGenericData())->GetDisplay();
                 XFontSet pFontSet = get_font_set(pDisplay);
 
                 if (pFontSet != NULL)
@@ -394,7 +394,7 @@ SalI18N_InputContext::Map( SalFrame *pFrame )
             if ( maContext == NULL )
             {
                 SalI18N_InputMethod *pInputMethod;
-                pInputMethod = GetGenericData()->GetSalDisplay()->GetInputMethod();
+                pInputMethod = vcl_sal::getSalDisplay(GetGenericData())->GetInputMethod();
 
                 maContext = XCreateIC( pInputMethod->GetMethod(),
                                        XNVaNestedList, mpAttributes,
@@ -599,7 +599,7 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame )
         {
             sendEmptyCommit(pFocusFrame);
             // begin preedit again
-            GetGenericData()->GetSalDisplay()->SendInternalEvent( pFocusFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+            vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( pFocusFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
         }
 
         XSetICFocus( maContext );
@@ -616,7 +616,7 @@ SalI18N_InputContext::UnsetICFocus( SalFrame* pFrame )
     if ( mbUseable && (maContext != NULL) )
     {
         // cancel an eventual event posted to begin preedit again
-        GetGenericData()->GetSalDisplay()->CancelInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+        vcl_sal::getSalDisplay(GetGenericData())->CancelInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
         maClientData.pFrame = NULL;
         XUnsetICFocus( maContext );
     }
@@ -646,7 +646,7 @@ SalI18N_InputContext::EndExtTextInput( sal_uInt16 /*nFlags*/ )
             if( static_cast<X11SalFrame*>(maClientData.pFrame)->hasFocus() )
             {
                 // begin preedit again
-                GetGenericData()->GetSalDisplay()->SendInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+                vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
             }
         }
     }
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 2291f6b..dad1fcc 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -169,7 +169,7 @@ bool XIMStatusWindow::checkLastParent() const
 {
     if( m_pLastParent )
     {
-        const std::list< SalFrame* >& rFrames = GetGenericData()->GetSalDisplay()->getFrames();
+        const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
         for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
         {
             if( *it == m_pLastParent )
@@ -198,7 +198,7 @@ Point XIMStatusWindow::updatePosition()
         ::Window aChild;
         XTranslateCoordinates( (Display*)pParentEnvData->pDisplay,
                                (::Window)pParentEnvData->aShellWindow,
-                               GetGenericData()->GetSalDisplay()->GetRootWindow( GetGenericData()->GetSalDisplay()->GetDefaultXScreen() ),
+                               vcl_sal::getSalDisplay(GetGenericData())->GetRootWindow( vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen() ),
                                0, 0,
                                &x, &y,
                                &aChild );
@@ -432,7 +432,7 @@ void IIIMPStatusWindow::GetFocus()
          *  since reset focus really is an internal hack there should
          *  not be a method to be called in SalFrame destructor
          */
-        const std::list< SalFrame* >& rFrames = GetGenericData()->GetSalDisplay()->getFrames();
+        const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
         std::list< SalFrame* >::const_iterator it;
         for( it = rFrames.begin(); it != rFrames.end() && *it != m_pResetFocus; ++it )
             ;
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 7b10ee6..317c16e 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -544,7 +544,7 @@ void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent )
             )
             return;
 
-        if( pDisplay != GetGenericData()->GetSalDisplay()->GetDisplay() )
+        if( pDisplay != vcl_sal::getSalDisplay(GetGenericData())->GetDisplay() )
             return;
 
         PrintXError( pDisplay, pEvent );
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 779453e..643415c 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2559,7 +2559,7 @@ SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap,
 
 // MonoChrome
 SalColormap::SalColormap()
-    : m_pDisplay( GetGenericData()->GetSalDisplay() ),
+    : m_pDisplay( vcl_sal::getSalDisplay(GetGenericData()) ),
       m_hColormap( None ),
       m_nWhitePixel( 1 ),
       m_nBlackPixel( 0 ),
@@ -2574,12 +2574,12 @@ SalColormap::SalColormap()
 
 // TrueColor
 SalColormap::SalColormap( sal_uInt16 nDepth )
-    : m_pDisplay( GetGenericData()->GetSalDisplay() ),
+    : m_pDisplay( vcl_sal::getSalDisplay(GetGenericData()) ),
       m_hColormap( None ),
       m_nWhitePixel( (1 << nDepth) - 1 ),
       m_nBlackPixel( 0x00000000 ),
       m_nUsed( 1 << nDepth ),
-      m_nXScreen( GetGenericData()->GetSalDisplay()->GetDefaultXScreen() )
+      m_nXScreen( vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen() )
 {
     const SalVisual *pVisual = &m_pDisplay->GetVisual( m_nXScreen );
 
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 0845ddc..0b43371 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -127,7 +127,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
 bool X11SalInstance::AnyInput(sal_uInt16 nType)
 {
     SalGenericData *pData = GetGenericData();
-    Display *pDisplay  = pData->GetSalDisplay()->GetDisplay();
+    Display *pDisplay  = vcl_sal::getSalDisplay(pData)->GetDisplay();
     bool bRet = false;
 
     if( (nType & VCL_INPUT_TIMER) && (mpXLib && mpXLib->CheckTimeout(false)) )
@@ -234,7 +234,7 @@ static void getServerDirectories( std::list< OString >& o_rFontPaths )
 
 void X11SalInstance::FillFontPathList( std::list< OString >& o_rFontPaths )
 {
-    Display *pDisplay = GetGenericData()->GetSalDisplay()->GetDisplay();
+    Display *pDisplay = vcl_sal::getSalDisplay(GetGenericData())->GetDisplay();
 
     DBG_ASSERT( pDisplay, "No Display !" );
     if( pDisplay )
@@ -324,7 +324,7 @@ void X11SalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
 
 void X11SalInstance::PostPrintersChanged()
 {
-    SalDisplay* pDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pDisp = vcl_sal::getSalDisplay(GetGenericData());
     const std::list< SalFrame* >& rList = pDisp->getFrames();
     for( std::list< SalFrame* >::const_iterator it = rList.begin();
          it != rList.end(); ++it )
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 13962d6..146768b 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -260,7 +260,7 @@ IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, SaveYourselfHdl, void*, pStat
           task of the quick-starter)
         */
         *pSmRestartHint = SmRestartNever;
-        const std::list< SalFrame* >& rFrames = GetGenericData()->GetSalDisplay()->getFrames();
+        const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
         for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
         {
             vcl::Window *pWindow = (*it)->GetWindow();
@@ -353,7 +353,7 @@ IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, ShutDownHdl, void*, EMPTYARG
         m_pSession->CallCallback( &aEvent );
     }
 
-    const std::list< SalFrame* >& rFrames = GetGenericData()->GetSalDisplay()->getFrames();
+    const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
     SAL_INFO("vcl.sm", (rFrames.begin() != rFrames.end() ? "shutdown on first frame" : "shutdown event but no frame"));
     if( rFrames.begin() != rFrames.end() )
         rFrames.front()->CallCallback( SALEVENT_SHUTDOWN, 0 );
@@ -460,7 +460,7 @@ void SessionManagerClient::open(SalSession * pSession)
             pClientID = NULL;
         }
 
-        SalDisplay* pDisp = GetGenericData()->GetSalDisplay();
+        SalDisplay* pDisp = vcl_sal::getSalDisplay(GetGenericData());
         if( pDisp->GetDrawable(pDisp->GetDefaultXScreen()) && !m_aClientID.isEmpty() )
         {
             XChangeProperty( pDisp->GetDisplay(),
@@ -756,7 +756,7 @@ void ICEWatchProc(
         }
     }
     SAL_INFO( "vcl.sm", "ICE connection on " << IceConnectionNumber( ice_conn ) << " " << (opening ? "inserted" : "removed"));
-    SAL_INFO( "vcl.sm", "Display connection is " << ConnectionNumber( GetGenericData()->GetSalDisplay()->GetDisplay() ) );
+    SAL_INFO( "vcl.sm", "Display connection is " << ConnectionNumber( vcl_sal::getSalDisplay(GetGenericData())->GetDisplay() ) );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 08c138d..d2f648a 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -3230,10 +3230,10 @@ void SelectionManager::startDrag(
             comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
             if( rSolarMutex.tryToAcquire() )
             {
-                pCaptureFrame = GetGenericData()->GetSalDisplay()->GetCaptureFrame();
+                pCaptureFrame = vcl_sal::getSalDisplay(GetGenericData())->GetCaptureFrame();
                 if( pCaptureFrame )
                 {
-                    GetGenericData()->GetSalDisplay()->CaptureMouse( NULL );
+                    vcl_sal::getSalDisplay(GetGenericData())->CaptureMouse( NULL );
                     nPointerGrabSuccess =
                                 XGrabPointer( m_pDisplay, it->second.m_aRootWindow, True,
                                               DRAG_EVENT_MASK,
@@ -3270,7 +3270,7 @@ void SelectionManager::startDrag(
             {
                 comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
                 if( rSolarMutex.tryToAcquire() )
-                    GetGenericData()->GetSalDisplay()->CaptureMouse( pCaptureFrame );
+                    vcl_sal::getSalDisplay(GetGenericData())->CaptureMouse( pCaptureFrame );
 #if OSL_DEBUG_LEVEL > 0
                 else
                     OSL_FAIL( "failed to acquire SolarMutex to reset capture frame" );
@@ -3359,7 +3359,7 @@ void SelectionManager::startDrag(
         {
             comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
             if( rSolarMutex.tryToAcquire() )
-                GetGenericData()->GetSalDisplay()->CaptureMouse( pCaptureFrame );
+                vcl_sal::getSalDisplay(GetGenericData())->CaptureMouse( pCaptureFrame );
 #if OSL_DEBUG_LEVEL > 0
             else
                 OSL_FAIL( "failed to acquire SolarMutex to reset capture frame" );
diff --git a/vcl/unx/generic/gdi/gcach_xpeer.cxx b/vcl/unx/generic/gdi/gcach_xpeer.cxx
index 6148912..26bd47f 100644
--- a/vcl/unx/generic/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/generic/gdi/gcach_xpeer.cxx
@@ -38,7 +38,7 @@ X11GlyphPeer::~X11GlyphPeer()
         return;
 
     //Why do this here, move into dtor/shutdown of display?
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     Display* const pX11Disp = pSalDisp->GetDisplay();
     int nMaxScreens = pSalDisp->GetXScreenCount();
     XRenderPeer& rRenderPeer = XRenderPeer::GetInstance();
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 3495ede..e4437a7 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -218,7 +218,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
 
     if( aDrawable && nWidth && nHeight && nDrawableDepth )
     {
-        SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+        SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
         Display*    pXDisp = pSalDisp->GetDisplay();
 
         // do not die on XError here
@@ -647,7 +647,7 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB(
             }
         }
 
-        XImage* pImage = ImplCreateXImage( GetGenericData()->GetSalDisplay(), nXScreen,
+        XImage* pImage = ImplCreateXImage( vcl_sal::getSalDisplay(GetGenericData()), nXScreen,
                                            nDrawableDepth, aTwoRect );
 
         if( pImage )
@@ -763,7 +763,7 @@ bool X11SalBitmap::Create(
                                 );
                 bool bFreePixmap = false;
                 if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap )
-                    XFreePixmap( GetGenericData()->GetSalDisplay()->GetDisplay(), pixmapHandle );
+                    XFreePixmap( vcl_sal::getSalDisplay(GetGenericData())->GetDisplay(), pixmapHandle );
 
                 return bSuccess;
             }
@@ -889,7 +889,7 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable,
     , mnDepth     ( pImage->depth )
     , mnXScreen   ( nXScreen )
 {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     Display*    pXDisp = pSalDisp->GetDisplay();
 
     if( (maPixmap = limitXCreatePixmap( pXDisp, aDrawable, ImplGetWidth(), ImplGetHeight(), ImplGetDepth() )) )
@@ -924,7 +924,7 @@ ImplSalDDB::ImplSalDDB(
     , mnDepth( nDrawableDepth )
     , mnXScreen( nXScreen )
 {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     Display*    pXDisp = pSalDisp->GetDisplay();
 
     if( (maPixmap = limitXCreatePixmap( pXDisp, aDrawable, nWidth, nHeight, nDrawableDepth )) )
@@ -956,7 +956,7 @@ ImplSalDDB::ImplSalDDB(
 ImplSalDDB::~ImplSalDDB()
 {
     if( maPixmap && ImplGetSVData() )
-        XFreePixmap( GetGenericData()->GetSalDisplay()->GetDisplay(), maPixmap );
+        XFreePixmap( vcl_sal::getSalDisplay(GetGenericData())->GetDisplay(), maPixmap );
 }
 
 bool ImplSalDDB::ImplMatches( SalX11Screen nXScreen, long nDepth, const SalTwoRect& rTwoRect ) const
@@ -1019,7 +1019,7 @@ void ImplSalDDB::ImplDraw(
     long nDestY,
     const GC& rGC
 ) {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     Display*    pXDisp = pSalDisp->GetDisplay();
 
     if( 1 == nSrcDrawableDepth )
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 7772972..673e5cf 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -137,7 +137,7 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, SalX11Screen nXScreen )
     if( nXScreen != m_nXScreen )
     {
         freeResources();
-        m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap( nXScreen );
+        m_pColormap = &vcl_sal::getSalDisplay(GetGenericData())->GetColormap( nXScreen );
         m_nXScreen = nXScreen;
     }
 
@@ -155,7 +155,7 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, SalX11Screen nXScreen )
 void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget,
                            SalX11Screen nXScreen )
 {
-    m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap(nXScreen);
+    m_pColormap = &vcl_sal::getSalDisplay(GetGenericData())->GetColormap(nXScreen);
     m_nXScreen  = nXScreen;
 
     m_pFrame    = pFrame;
diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx
index e88a18a..bd92380 100644
--- a/vcl/unx/generic/gdi/salgdi2.cxx
+++ b/vcl/unx/generic/gdi/salgdi2.cxx
@@ -113,7 +113,7 @@ void X11SalGraphics::YieldGraphicsExpose()
     ::Window aWindow = GetDrawable();
     if( ! pFrame )
     {
-        const std::list< SalFrame* >& rFrames = GetGenericData()->GetSalDisplay()->getFrames();
+        const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
         for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end() && ! pFrame; ++it )
         {
             const SystemEnvData* pEnvData = (*it)->GetSystemData();
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index b4bcfa1..3ec516b 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -94,7 +94,7 @@ X11SalVirtualDevice::X11SalVirtualDevice( SalGraphics* pGraphics,
     if( !nBitCount && pGraphics )
         nBitCount = pGraphics->GetBitCount();
 
-    pDisplay_               = GetGenericData()->GetSalDisplay();
+    pDisplay_               = vcl_sal::getSalDisplay(GetGenericData());
     pGraphics_              = new X11SalGraphics();
     nDepth_                 = nBitCount;
 
@@ -124,7 +124,7 @@ X11SalVirtualDevice::X11SalVirtualDevice( SalGraphics* pGraphics,
         nDX_ = nDX;
         nDY_ = nDY;
         m_nXScreen = pGraphics ? static_cast<X11SalGraphics*>(pGraphics)->GetScreenNumber() :
-                                 GetGenericData()->GetSalDisplay()->GetDefaultXScreen();
+                                 vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen();
         hDrawable_ = limitXCreatePixmap( GetXDisplay(),
                                          pDisplay_->GetDrawable( m_nXScreen ),
                                          nDX_, nDY_,
diff --git a/vcl/unx/generic/gdi/xrender_peer.cxx b/vcl/unx/generic/gdi/xrender_peer.cxx
index d576301..b7c5d76 100644
--- a/vcl/unx/generic/gdi/xrender_peer.cxx
+++ b/vcl/unx/generic/gdi/xrender_peer.cxx
@@ -27,7 +27,7 @@
 #include <xrender_peer.hxx>
 
 XRenderPeer::XRenderPeer()
-    : mpDisplay( GetGenericData()->GetSalDisplay()->GetDisplay() )
+    : mpDisplay( vcl_sal::getSalDisplay(GetGenericData())->GetDisplay() )
     , mpStandardFormatA8( NULL )
 {
     InitRenderLib();
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 6f8af22..4d3c244 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -759,7 +759,7 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle,
 
     mbTransientForRoot          = false;
 
-    pDisplay_                   = pData->GetSalDisplay();
+    pDisplay_                   = vcl_sal::getSalDisplay(pData);
     // insert frame in framelist
     pDisplay_->registerFrame( this );
 
@@ -2700,13 +2700,13 @@ SalFrame::SalPointerState X11SalFrame::GetPointerState()
 SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
 {
     SalIndicatorState aState;
-    aState.mnState = GetGenericData()->GetSalDisplay()->GetIndicatorState();
+    aState.mnState = vcl_sal::getSalDisplay(GetGenericData())->GetIndicatorState();
     return aState;
 }
 
 void X11SalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
 {
-    GetGenericData()->GetSalDisplay()->SimulateKeyPress(nKeyCode);
+    vcl_sal::getSalDisplay(GetGenericData())->SimulateKeyPress(nKeyCode);
 }
 
 long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 4b53995..cfb983d 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -59,7 +59,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
 
     pObject->mpParent = pParent;
 
-    SalDisplay* pSalDisp        = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp        = vcl_sal::getSalDisplay(GetGenericData());
     const SystemEnvData* pEnv   = pParent->GetSystemData();
     Display* pDisp              = pSalDisp->GetDisplay();
     ::Window aObjectParent      = (::Window)pEnv->aWindow;
@@ -228,7 +228,7 @@ X11SalObject::X11SalObject()
     , mbVisible(false)
 {
     maSystemChildData.nSize     = sizeof( SystemEnvData );
-    maSystemChildData.pDisplay  = GetGenericData()->GetSalDisplay()->GetDisplay();
+    maSystemChildData.pDisplay  = vcl_sal::getSalDisplay(GetGenericData())->GetDisplay();
     maSystemChildData.aWindow       = None;
     maSystemChildData.pSalFrame = 0;
     maSystemChildData.pWidget       = 0;
@@ -239,13 +239,13 @@ X11SalObject::X11SalObject()
     maSystemChildData.aShellWindow  = 0;
     maSystemChildData.pShellWidget  = NULL;
 
-    std::list< SalObject* >& rObjects = GetGenericData()->GetSalDisplay()->getSalObjects();
+    std::list< SalObject* >& rObjects = vcl_sal::getSalDisplay(GetGenericData())->getSalObjects();
     rObjects.push_back( this );
 }
 
 X11SalObject::~X11SalObject()
 {
-    std::list< SalObject* >& rObjects = GetGenericData()->GetSalDisplay()->getSalObjects();
+    std::list< SalObject* >& rObjects = vcl_sal::getSalDisplay(GetGenericData())->getSalObjects();
     rObjects.remove( this );
 
     GetGenericData()->ErrorTrapPush();
@@ -419,7 +419,7 @@ static sal_uInt16 sal_GetCode( int state )
 
 bool X11SalObject::Dispatch( XEvent* pEvent )
 {
-    std::list< SalObject* >& rObjects = GetGenericData()->GetSalDisplay()->getSalObjects();
+    std::list< SalObject* >& rObjects = vcl_sal::getSalDisplay(GetGenericData())->getSalObjects();
 
     for( std::list< SalObject* >::iterator it = rObjects.begin(); it != rObjects.end(); ++it )
     {
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index f3b1ecf6..3fad10e 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -4230,7 +4230,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
 GdkX11Pixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect, int nBgColor )
 {
     GdkX11Pixmap* pPixmap;
-    int nDepth = GetGenericData()->GetSalDisplay()->GetVisual( m_nXScreen ).GetDepth();
+    int nDepth = vcl_sal::getSalDisplay(GetGenericData())->GetVisual( m_nXScreen ).GetDepth();
 ;
 
     pPixmap = new GdkX11Pixmap( srcRect.GetWidth(), srcRect.GetHeight(), nDepth );
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index a8fe4ab..0299d68 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -50,7 +50,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow )
         gtk_widget_set_app_paintable( m_pSocket, TRUE );
 
         // system data
-        SalDisplay* pDisp = GetGenericData()->GetSalDisplay();
+        SalDisplay* pDisp = vcl_sal::getSalDisplay(GetGenericData());
         m_aSystemData.nSize         = sizeof( SystemEnvData );
         m_aSystemData.pDisplay      = pDisp->GetDisplay();
         m_aSystemData.aWindow       = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket));
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 456c2db..3409ae7 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -459,7 +459,7 @@ static gboolean RefreshMenusUnity(gpointer)
 {
     SolarMutexGuard g;
 
-    SalDisplay* pSalDisplay = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisplay = vcl_sal::getSalDisplay(GetGenericData());
     std::list< SalFrame* >::const_iterator pSalFrame = pSalDisplay->getFrames().begin();
     std::list< SalFrame* >::const_iterator pEndSalFrame = pSalDisplay->getFrames().end();
     for(; pSalFrame != pEndSalFrame; ++pSalFrame) {
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 9749cfc..5882fdb 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -43,28 +43,28 @@ X11SalSystem::~X11SalSystem()
 // for the moment only handle xinerama case
 unsigned int X11SalSystem::GetDisplayScreenCount()
 {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     return pSalDisp->IsXinerama() ? pSalDisp->GetXineramaScreens().size() :
            pSalDisp->GetXScreenCount();
 }
 
 bool X11SalSystem::IsUnifiedDisplay()
 {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     unsigned int nScreenCount = pSalDisp->GetXScreenCount();
     return pSalDisp->IsXinerama() || (nScreenCount == 1);
 }
 
 unsigned int X11SalSystem::GetDisplayBuiltInScreen()
 {
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     return pSalDisp->GetDefaultXScreen().getXScreen();
 }
 
 Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
 {
     Rectangle aRet;
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     if( pSalDisp->IsXinerama() )
     {
         const std::vector< Rectangle >& rScreens = pSalDisp->GetXineramaScreens();
@@ -88,7 +88,7 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
 OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen )
 {
     OUString aScreenName;
-    SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
+    SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
     if( pSalDisp->IsXinerama() )
     {
         const std::vector< Rectangle >& rScreens = pSalDisp->GetXineramaScreens();


More information about the Libreoffice-commits mailing list