diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-01-14 23:25:55 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-01-16 09:28:29 +0000 |
commit | 8d151e0e55e1945bc5f633dc916372a3ea27a16d (patch) | |
tree | 96a6a50329fd6b6b57cc1e266d16b8464d4b8b2a /vcl | |
parent | a5247645b4d133056ded317b1ed0e9e590afcf4d (diff) |
vcl: introduce crystal clear separation between X11 Screens and DisplayScreens
A DisplayScreen is a screen index as used by the upper level abstractions,
an X11Screen is a wrapper around an integer X screen index.
Diffstat (limited to 'vcl')
37 files changed, 868 insertions, 752 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index ca1108c0b718..d90b46874f5f 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -1665,7 +1665,7 @@ void AquaSalFrame::UpdateFrameGeometry() maScreenRect = [pScreen frame]; NSArray* pScreens = [NSScreen screens]; if( pScreens ) - maGeometry.nScreenNumber = [pScreens indexOfObject: pScreen]; + maGeometry.nDisplayScreenNumber = [pScreens indexOfObject: pScreen]; } NSRect aFrameRect = [mpWindow frame]; diff --git a/vcl/inc/salgeom.hxx b/vcl/inc/salgeom.hxx index c512d0a195fa..045c659040c4 100644 --- a/vcl/inc/salgeom.hxx +++ b/vcl/inc/salgeom.hxx @@ -39,13 +39,13 @@ typedef struct _SalFrameGeometry { nTopDecoration, nRightDecoration, nBottomDecoration; - unsigned int nScreenNumber; + unsigned int nDisplayScreenNumber; _SalFrameGeometry() : nX( 0 ), nY( 0 ), nWidth( 1 ), nHeight( 1 ), nLeftDecoration( 0 ), nTopDecoration( 0 ), nRightDecoration( 0 ), nBottomDecoration( 0 ), - nScreenNumber( 0 ) + nDisplayScreenNumber( 0 ) {} } SalFrameGeometry; diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index ced4d165433f..21fb1e4b32bc 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -154,12 +154,16 @@ public: GdkCursor *getCursor( PointerStyle ePointerStyle ); virtual int CaptureMouse( SalFrame* pFrame ); + int GetDefaultScreen() { return m_pSys->GetDisplayDefaultScreen(); } + SalX11Screen GetDefaultXScreen() { return m_pSys->GetDisplayDefaultXScreen(); } + Size GetScreenSize( int nDisplayScreen ); + int GetXScreenCount() { return m_pSys->GetDisplayXScreenCount(); } #if GTK_CHECK_VERSION(3,0,0) - int GetDefaultScreenNumber() { return m_pSys->GetDisplayDefaultScreen(); } - int GetScreenCount() { return m_pSys->GetDisplayScreenCount(); } - Size GetScreenSize( int screen ); +// int GetScreenCount() { return m_pSys->GetDisplayScreenCount(); } +#endif +#if !GTK_CHECK_VERSION(3,0,0) + virtual ScreenData *initScreen( SalX11Screen nXScreen ) const; #endif - virtual void initScreen( int nScreen ) const; GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event, GdkEvent* event ); diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 1facf7e52d1f..f1d49aca1d97 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -42,6 +42,7 @@ #include <salframe.hxx> #include <vcl/sysdata.hxx> +#include <unx/saltype.h> #include "tools/link.hxx" @@ -176,7 +177,7 @@ class GtkSalFrame : public SalFrame }; friend struct IMHandler; - int m_nScreen; + SalX11Screen m_nXScreen; GtkWidget* m_pWindow; int m_nDuringRender; GdkWindow* m_pForeignParent; @@ -184,7 +185,7 @@ class GtkSalFrame : public SalFrame GdkWindow* m_pForeignTopLevel; GdkNativeWindow m_aForeignTopLevelWindow; Pixmap m_hBackgroundPixmap; - sal_uLong m_nStyle; + sal_uLong m_nStyle; SalExtStyle m_nExtStyle; GtkFixed* m_pFixedContainer; GtkSalFrame* m_pParent; @@ -192,7 +193,7 @@ class GtkSalFrame : public SalFrame GdkWindowState m_nState; SystemEnvData m_aSystemData; GraphicsHolder m_aGraphics[ nMaxGraphics ]; - sal_uInt16 m_nKeyModifiers; + sal_uInt16 m_nKeyModifiers; GdkCursor *m_pCurrentCursor; GdkVisibilityState m_nVisibility; PointerStyle m_ePointerStyle; @@ -205,7 +206,7 @@ class GtkSalFrame : public SalFrame bool m_bSendModChangeOnRelease; bool m_bWindowIsGtkPlug; bool m_bSetFocusOnMap; - rtl::OUString m_aTitle; + rtl::OUString m_aTitle; rtl::OUString m_sWMClass; IMHandler* m_pIMHandler; @@ -287,7 +288,7 @@ class GtkSalFrame : public SalFrame Size calcDefaultSize(); void setMinMaxSize(); - void createNewWindow( XLIB_Window aParent, bool bXEmbed, int nScreen ); + void createNewWindow( XLIB_Window aParent, bool bXEmbed, SalX11Screen nXScreen ); void askForXEmbedFocus( sal_Int32 nTimecode ); void AllocateFrame(); @@ -320,7 +321,8 @@ public: GdkVisibilityState getVisibilityState() const { return m_nVisibility; } Pixmap getBackgroundPixmap() const { return m_hBackgroundPixmap; } - int getScreenNumber() const { return m_nScreen; } + SalX11Screen getXScreenNumber() const { return m_nXScreen; } + int GetDisplayScreen() const { return maGeometry.nDisplayScreenNumber; } void updateScreenNumber(); // only for gtk3 ... diff --git a/vcl/inc/unx/gtk/gtksys.hxx b/vcl/inc/unx/gtk/gtksys.hxx index 784623b901fd..df9e79e1dcb2 100644 --- a/vcl/inc/unx/gtk/gtksys.hxx +++ b/vcl/inc/unx/gtk/gtksys.hxx @@ -32,6 +32,7 @@ #include "generic/gensys.h" #include <gtk/gtk.h> +#include <unx/saltype.h> class GtkSalSystem : public SalGenericSystem { @@ -51,7 +52,10 @@ public: const rtl::OUString& rMessage, const std::list< rtl::OUString >& rButtons, int nDefButton); - + SalX11Screen GetDisplayDefaultXScreen() + { return getXScreenFromDisplayScreen( GetDisplayDefaultScreen() ); } + int GetDisplayXScreenCount(); + SalX11Screen getXScreenFromDisplayScreen(unsigned int nDisplayScreen); // We have a 'screen' number that is combined from screen-idx + monitor-idx static int getScreenIdxFromPtr (GdkDisplay *pDisplay, GdkScreen *pScreen); static int getScreenMonitorIdx (GdkDisplay *pDisplay, GdkScreen *pScreen, int nX, int nY); diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 0fa69ae5a72f..a5f0bac27d3b 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -60,7 +60,7 @@ private: static BitmapBuffer* ImplCreateDIB( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, long nX, long nY, @@ -82,7 +82,7 @@ public: bool ImplCreateFromXImage( Display* pDisplay, XLIB_Window hWindow, - int nScreen, + SalX11Screen nXScreen, XImage* pImage ); private: @@ -95,7 +95,7 @@ public: SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, long nX, long nY, @@ -105,21 +105,21 @@ public: SAL_DLLPRIVATE XImage* ImplCreateXImage( SalDisplay* pSalDisp, - int nScreen, + SalX11Screen nXScreen, long nDepth, const SalTwoRect& rTwoRect ) const; SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( Drawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, const SalTwoRect& ) const; void ImplDraw( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC @@ -177,9 +177,9 @@ private: Pixmap maPixmap; SalTwoRect maTwoRect; long mnDepth; - int mnScreen; + SalX11Screen mnXScreen; - ImplSalDDB() {} + ImplSalDDB() : mnXScreen(0) {} static void ImplDraw( Drawable aSrcDrawable, @@ -200,13 +200,13 @@ public: ImplSalDDB( XImage* pImage, Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, const SalTwoRect& rTwoRect ); ImplSalDDB( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, long nX, long nY, @@ -217,7 +217,7 @@ public: ImplSalDDB( Display* pDisplay, XLIB_Window hWindow, - int nScreen, + SalX11Screen nXScreen, XImage* pImage ); @@ -231,9 +231,9 @@ public: { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } - int ImplGetScreen() const { return mnScreen; } + SalX11Screen ImplGetScreen() const { return mnXScreen; } - bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const; + bool ImplMatches( SalX11Screen nXScreen, long nDepth, const SalTwoRect& rTwoRect ) const; void ImplDraw( Drawable aDrawable, diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index b8d6cd38ac87..984726d91101 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -37,6 +37,7 @@ class SalXLib; // -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #include <unx/salunx.h> +#include <unx/saltype.h> #include <vcl/salgtype.hxx> #include <vcl/ptrstyle.hxx> #include <sal/types.h> @@ -155,15 +156,15 @@ class SalColormap Pixel m_nWhitePixel; Pixel m_nBlackPixel; Pixel m_nUsed; // Pseudocolor - int m_nScreen; + SalX11Screen m_nXScreen; void GetPalette(); void GetLookupTable(); public: SalColormap( const SalDisplay* pSalDisplay, Colormap hColormap, - int nScreen ); - SalColormap( sal_uInt16 nDepth ); + SalX11Screen nXScreen ); + SalColormap( sal_uInt16 nDepth ); SalColormap(); ~SalColormap(); @@ -176,16 +177,15 @@ public: inline Pixel GetBlackPixel() const { return m_nBlackPixel; } inline Pixel GetUsed() const { return m_nUsed; } inline int GetClass() const { return m_aVisual.GetClass(); } - inline int GetScreenNumber() const { return m_nScreen; } sal_Bool GetXPixels( XColor &rColor, - int r, - int g, - int b ) const; + int r, + int g, + int b ) const; inline sal_Bool GetXPixel( XColor &rColor, - int r, - int g, - int b ) const; + int r, + int g, + int b ) const; Pixel GetPixel( SalColor nColor ) const; SalColor GetColor( Pixel nPixel ) const; }; @@ -295,7 +295,8 @@ protected: AttributeProvider *mpFactory; Display *pDisp_; // X Display - int m_nDefaultScreen; // XDefaultScreen + + SalX11Screen m_nXDefaultScreen; std::vector< ScreenData > m_aScreens; ScreenData m_aInvalidScreenData; Pair aResolution_; // [dpi] @@ -367,67 +368,63 @@ public: Status *pStatus, XIC = NULL ) const; - XLIB_Cursor GetPointer( int ePointerStyle ); - virtual int CaptureMouse( SalFrame *pCapture ); - - void Remove( XEvent *pEvent ); + XLIB_Cursor GetPointer( int ePointerStyle ); + virtual int CaptureMouse( SalFrame *pCapture ); - virtual void initScreen( int nScreen ) const; - const ScreenData& getDataForScreen( int nScreen ) const + void Remove( XEvent *pEvent ); + virtual ScreenData *initScreen( SalX11Screen nXScreen ) const; + const ScreenData& getDataForScreen( SalX11Screen nXScreen ) const { - if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) ) + if( nXScreen.getXScreen() >= static_cast<int>(m_aScreens.size()) ) return m_aInvalidScreenData; - if( ! m_aScreens[nScreen].m_bInit ) - initScreen( nScreen ); - return m_aScreens[nScreen]; + if( ! m_aScreens[nXScreen.getXScreen()].m_bInit ) + initScreen( nXScreen ); + return m_aScreens[nXScreen.getXScreen()]; } - XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; } + XLIB_Window GetDrawable( SalX11Screen nXScreen ) const { return getDataForScreen( nXScreen ).m_aRefWindow; } Display *GetDisplay() const { return pDisp_; } - int GetDefaultScreenNumber() const { return m_nDefaultScreen; } - const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; } + SalX11Screen GetDefaultXScreen() const { return m_nXDefaultScreen; } + const Size& GetScreenSize( SalX11Screen nXScreen ) const { return getDataForScreen( nXScreen ).m_aSize; } srv_vendor_t GetServerVendor() const { return meServerVendor; } void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); } - sal_Bool IsDisplay() const { return !!pXLib_; } - GC GetMonoGC( int nScreen ) const { return getDataForScreen(nScreen).m_aMonoGC; } - GC GetCopyGC( int nScreen ) const { return getDataForScreen(nScreen).m_aCopyGC; } - GC GetAndInvertedGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndInvertedGC; } - GC GetAndGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndGC; } - GC GetOrGC( int nScreen ) const { return getDataForScreen(nScreen).m_aOrGC; } - GC GetStippleGC( int nScreen ) const { return getDataForScreen(nScreen).m_aStippleGC; } - GC GetGC( sal_uInt16 nDepth, int nScreen ) const; - Pixmap GetInvert50( int nScreen ) const { return getDataForScreen(nScreen).m_hInvert50; } - const SalColormap& GetColormap( int nScreen ) const { return getDataForScreen(nScreen).m_aColormap; } - const SalVisual& GetVisual( int nScreen ) const { return getDataForScreen(nScreen).m_aVisual; } - RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; } + sal_Bool IsDisplay() const { return !!pXLib_; } + GC GetMonoGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aMonoGC; } + GC GetCopyGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aCopyGC; } + GC GetAndInvertedGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aAndInvertedGC; } + GC GetAndGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aAndGC; } + GC GetOrGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aOrGC; } + GC GetStippleGC( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aStippleGC; } + GC GetGC( sal_uInt16 nDepth, SalX11Screen nXScreen ) const; + Pixmap GetInvert50( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_hInvert50; } + const SalColormap& GetColormap( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aColormap; } + const SalVisual& GetVisual( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aVisual; } + RenderEntryMap& GetRenderEntries( SalX11Screen nXScreen ) const { return getDataForScreen(nXScreen).m_aRenderData; } const Pair &GetResolution() const { return aResolution_; } bool GetExactResolution() const { return mbExactResolution; } - sal_uLong GetProperties() const { return PROPERTY_DEFAULT; } - sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; } + sal_uLong GetProperties() const { return PROPERTY_DEFAULT; } + sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; } XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const; bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const; - SalXLib* GetXLib() const { return pXLib_; } + SalXLib* GetXLib() const { return pXLib_; } - SalI18N_InputMethod* GetInputMethod() const { return mpInputMethod; } + SalI18N_InputMethod* GetInputMethod() const { return mpInputMethod; } SalI18N_KeyboardExtension* GetKbdExtension() const { return mpKbdExtension; } void SetInputMethod( SalI18N_InputMethod *pInputMethod ) { mpInputMethod = pInputMethod; } void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension) { mpKbdExtension = pKbdExtension; } - const char* GetKeyboardName( bool bRefresh = false ); + const char* GetKeyboardName( bool bRefresh = false ); ::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; } bool IsXinerama() const { return m_bXinerama; } const std::vector< Rectangle >& GetXineramaScreens() const { return m_aXineramaScreens; } - XLIB_Window GetRootWindow( int nScreen ) const - { return getDataForScreen( nScreen ).m_aRoot; } - const std::vector< ScreenData >& GetScreenData() - { return m_aScreens; } - int GetScreenCount() const { return static_cast<int>(m_aScreens.size()); } - - const std::list< SalFrame* >& getFrames() const - { return m_aFrames; } + XLIB_Window GetRootWindow( SalX11Screen nXScreen ) const + { return getDataForScreen( nXScreen ).m_aRoot; } + const std::vector< ScreenData >& GetScreenData() { return m_aScreens; } + unsigned int GetXScreenCount() const { return m_aScreens.size(); } + const std::list< SalFrame* >& getFrames() const { return m_aFrames; } sal_Bool IsNumLockFromXS() const { return bNumLockFromXS_; } std::list< SalObject* >& getSalObjects() { return m_aSalObjects; } @@ -437,11 +434,11 @@ public: // -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -inline GC SalDisplay::GetGC( sal_uInt16 nDepth, int nScreen ) const +inline GC SalDisplay::GetGC( sal_uInt16 nDepth, SalX11Screen nXScreen ) const { return 1 == nDepth - ? GetMonoGC( nScreen ) - : getDataForScreen(nScreen).m_aVisual.GetDepth() == nDepth - ? GetCopyGC( nScreen ) + ? GetMonoGC( nXScreen ) + : getDataForScreen(nXScreen).m_aVisual.GetDepth() == nDepth + ? GetCopyGC( nXScreen ) : None; } inline Display *SalColormap::GetXDisplay() const diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index 6343d44f2417..5c87692e75d1 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -31,6 +31,7 @@ // -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #include <unx/salstd.hxx> #include <unx/salunx.h> +#include <unx/saltype.h> #include <salframe.hxx> #include <salwtype.hxx> @@ -41,7 +42,6 @@ #include <vcl/timer.hxx> #include <vclpluginapi.h> - #include <list> // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -66,13 +66,13 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame static X11SalFrame* s_pSaveYourselfFrame; - X11SalFrame* mpParent; // pointer to parent frame - // which should never obscur this frame + X11SalFrame* mpParent; // pointer to parent frame + // which should never obscur this frame bool mbTransientForRoot; - std::list< X11SalFrame* > maChildren; // List of child frames + std::list< X11SalFrame* > maChildren; // List of child frames SalDisplay *pDisplay_; - int m_nScreen; + SalX11Screen m_nXScreen; XLIB_Window mhWindow; XLIB_Window mhShellWindow; XLIB_Window mhForeignParent; @@ -89,11 +89,11 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame X11SalGraphics *pFreeGraphics_; // first free frame graphics XLIB_Time nReleaseTime_; // timestamp of last key release - sal_uInt16 nKeyCode_; // last key code - sal_uInt16 nKeyState_; // last key state + sal_uInt16 nKeyCode_; // last key code + sal_uInt16 nKeyState_; // last key state int nCompose_; // compose state bool mbSendExtKeyModChange; - sal_uInt16 mnExtKeyMod; + sal_uInt16 mnExtKeyMod; int nShowState_; // show state int nWidth_; // client width @@ -169,7 +169,7 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame void passOnSaveYourSelf(); - void createNewWindow( XLIB_Window aParent, int nScreen = -1 ); + void createNewWindow( XLIB_Window aParent, SalX11Screen nXScreen = SalX11Screen( -1 ) ); void updateScreenNumber(); void setXEmbedInfo(); @@ -181,13 +181,13 @@ public: virtual ~X11SalFrame(); long Dispatch( XEvent *pEvent ); - void Init( sal_uIntPtr nSalFrameStyle, int nScreen = -1, + void Init( sal_uIntPtr nSalFrameStyle, SalX11Screen nScreen = SalX11Screen( -1 ), SystemParentData* pParentData = NULL, bool bUseGeometry = false ); SalDisplay* GetDisplay() const { return pDisplay_; } Display* GetXDisplay() const; XLIB_Window GetDrawable() const; - int GetScreenNumber() const { return m_nScreen; } + SalX11Screen GetScreenNumber() const { return m_nXScreen; } XLIB_Window GetWindow() const { return mhWindow; } XLIB_Window GetShellWindow() const { return mhShellWindow; } XLIB_Window GetForeignParent() const { return mhForeignParent; } diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 9ef77738d89a..fd0ffbec337f 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -105,7 +105,7 @@ protected: const SalColormap* m_pColormap; SalColormap *m_pDeleteColormap; Drawable hDrawable_; // use - int m_nScreen; + SalX11Screen m_nXScreen; mutable XRenderPictFormat* m_pXRenderFormat; XID m_aXRenderPicture; CairoFontsCache m_aCairoFontsCache; @@ -220,7 +220,7 @@ public: X11SalGraphics(); virtual ~X11SalGraphics(); - void Init( SalFrame *pFrame, Drawable aDrawable, int nScreen ); + void Init( SalFrame *pFrame, Drawable aDrawable, SalX11Screen nXScreen ); void Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = NULL, bool bDeleteColormap = false ); void Init( class ImplSalPrinterData *pPrinter ); void DeInit(); @@ -229,7 +229,7 @@ public: inline Display* GetXDisplay() const; inline const SalVisual& GetVisual() const; inline Drawable GetDrawable() const { return hDrawable_; } - void SetDrawable( Drawable d, int nScreen ); + void SetDrawable( Drawable d, SalX11Screen nXScreen ); XID GetXRenderPicture(); XRenderPictFormat* GetXRenderFormat() const; inline void SetXRenderFormat( XRenderPictFormat* pXRenderFormat ) { m_pXRenderFormat = pXRenderFormat; } @@ -237,7 +237,7 @@ public: using SalGraphics::GetPixel; inline Pixel GetPixel( SalColor nSalColor ) const; - int GetScreenNumber() const { return m_nScreen; } + SalX11Screen GetScreenNumber() const { return m_nXScreen; } // overload all pure virtual methods virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); @@ -368,8 +368,8 @@ public: // do XCopyArea or XGet/PutImage depending on screen numbers // signature is like XCopyArea with screen numbers added static void CopyScreenArea( Display* pDisplay, - Drawable aSrc, int nScreenSrc, int nSrcDepth, - Drawable aDest, int nScreenDest, int nDestDepth, + Drawable aSrc, SalX11Screen nXScreenSrc, int nSrcDepth, + Drawable aDest, SalX11Screen nXScreenDest, int nDestDepth, GC aDestGC, int src_x, int src_y, unsigned int w, unsigned int h, diff --git a/vcl/inc/unx/saltype.h b/vcl/inc/unx/saltype.h new file mode 100644 index 000000000000..fd87d1157e60 --- /dev/null +++ b/vcl/inc/unx/saltype.h @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Michael Meeks <michael.meeks@novell.com> + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Major Contributor(s): + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SAL_TYPE_H +#define SAL_TYPE_H + +// an X11 screen index - this unpleasant construct is to allow +// us to cleanly separate the 'DisplayScreen' concept - as used +// in the public facing API, from X's idea of screen indicees. +// Both of these are plain unsigned integers called 'screen' +class SalX11Screen { + unsigned int mnXScreen; +public: + explicit SalX11Screen(unsigned int nXScreen) : mnXScreen( nXScreen ) {} + unsigned int getXScreen() const { return mnXScreen; } + bool operator==(const SalX11Screen &rOther) { return rOther.mnXScreen == mnXScreen; } + bool operator!=(const SalX11Screen &rOther) { return rOther.mnXScreen != mnXScreen; } +}; + +#endif // SAL_TYPE_H +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/salvd.h b/vcl/inc/unx/salvd.h index 42ce192ea76f..d0d4623d5b19 100644 --- a/vcl/inc/unx/salvd.h +++ b/vcl/inc/unx/salvd.h @@ -31,6 +31,7 @@ // -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #include <unx/salstd.hxx> +#include <unx/saltype.h> #include <salvd.hxx> // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -45,40 +46,40 @@ class X11SalVirtualDevice : public SalVirtualDevice Pixmap hDrawable_; - int m_nScreen; + SalX11Screen m_nXScreen; int nDX_; int nDY_; - sal_uInt16 nDepth_; - sal_Bool bGraphics_; // is Graphics used - sal_Bool bExternPixmap_; + sal_uInt16 nDepth_; + sal_Bool bGraphics_; // is Graphics used + sal_Bool bExternPixmap_; public: X11SalVirtualDevice(); virtual ~X11SalVirtualDevice(); sal_Bool Init( SalDisplay *pDisplay, - long nDX, long nDY, - sal_uInt16 nBitCount, - int nScreen, - Pixmap hDrawable = None, - XRenderPictFormat* pXRenderFormat = NULL ); + long nDX, long nDY, + sal_uInt16 nBitCount, + SalX11Screen nXScreen, + Pixmap hDrawable = None, + XRenderPictFormat* pXRenderFormat = NULL ); inline void InitGraphics( X11SalVirtualDevice *pVD ); inline Display *GetXDisplay() const; inline SalDisplay *GetDisplay() const; - inline sal_Bool IsDisplay() const; + inline sal_Bool IsDisplay() const; inline Pixmap GetDrawable() const { return hDrawable_; } - inline sal_uInt16 GetDepth() const { return nDepth_; } + inline sal_uInt16 GetDepth() const { return nDepth_; } int GetWidth() const { return nDX_; } int GetHeight() const { return nDY_; } - int GetScreenNumber() const { return m_nScreen; } + SalX11Screen GetXScreenNumber() const { return m_nXScreen; } virtual SalGraphics* GetGraphics(); virtual void ReleaseGraphics( SalGraphics* pGraphics ); // Set new size, without saving the old contents - virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); virtual void GetSize( long& rWidth, long& rHeight ); }; diff --git a/vcl/inc/unx/soicon.hxx b/vcl/inc/unx/soicon.hxx index cb3302cb777b..9ec95e6c2a4d 100644 --- a/vcl/inc/unx/soicon.hxx +++ b/vcl/inc/unx/soicon.hxx @@ -28,13 +28,15 @@ #ifndef _SV_SOICON_HXX #define _SV_SOICON_HXX +#include <unx/saltype.h> + class SalDisplay; class SalBitmap; class Bitmap; -sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen, - sal_uInt16 nIcon, sal_uInt16 iconSize, - Pixmap& icon_pixmap, Pixmap& icon_mask ); +sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, SalX11Screen nScreen, + sal_uInt16 nIcon, sal_uInt16 iconSize, + Pixmap& icon_pixmap, Pixmap& icon_mask ); #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx index efe3f3debf6a..b1464a6fb40f 100644 --- a/vcl/ios/source/window/salframe.cxx +++ b/vcl/ios/source/window/salframe.cxx @@ -1003,7 +1003,7 @@ void IosSalFrame::UpdateFrameGeometry() maScreenRect = [pScreen frame]; NSArray* pScreens = [NSScreen screens]; if( pScreens ) - maGeometry.nScreenNumber = [pScreens indexOfObject: pScreen]; + maGeometry.nDisplayScreenNumber = [pScreens indexOfObject: pScreen]; } CGRect aFrameRect = [mpWindow frame]; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 15b5cac1d13d..c149de318a7b 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2517,8 +2517,8 @@ Size Menu::ImplCalcSize( Window* pWin ) // except on rather small screens // TODO: move GetScreenNumber from SystemWindow to Window ? // currently we rely on internal privileges - unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber; - Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) ); + unsigned int nDisplayScreen = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nDisplayScreenNumber; + Rectangle aDispRect( Application::GetScreenPosSizePixel( nDisplayScreen ) ); long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800; if( nMaxWidth > nScreenWidth/2 ) nMaxWidth = nScreenWidth/2; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f087921477d2..d4399432ef55 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -1019,23 +1019,19 @@ sal_Bool SystemWindow::ImplIsInTaskPaneList( Window* pWin ) return sal_False; } -// ----------------------------------------------------------------------- - unsigned int SystemWindow::GetScreenNumber() const { - return mpWindowImpl->mpFrame->maGeometry.nScreenNumber; + return mpWindowImpl->mpFrame->maGeometry.nDisplayScreenNumber; } -// ----------------------------------------------------------------------- - -void SystemWindow::SetScreenNumber(unsigned int nScreen) +void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen) { - mpWindowImpl->mpFrame->SetScreenNumber( nScreen ); + mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen ); } void SystemWindow::SetApplicationID(const rtl::OUString &rApplicationID) { - mpWindowImpl->mpFrame->SetApplicationID(rApplicationID); + mpWindowImpl->mpFrame->SetApplicationID( rApplicationID ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 83ffa424ba74..3077c34b9311 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -212,7 +212,7 @@ Point XIMStatusWindow::updatePosition() XLIB_Window aChild; XTranslateCoordinates( (Display*)pParentEnvData->pDisplay, (XLIB_Window)pParentEnvData->aShellWindow, - GetGenericData()->GetSalDisplay()->GetRootWindow( GetGenericData()->GetSalDisplay()->GetDefaultScreenNumber() ), + GetGenericData()->GetSalDisplay()->GetRootWindow( GetGenericData()->GetSalDisplay()->GetDefaultXScreen() ), 0, 0, &x, &y, &aChild ); diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index aec8b53920d6..c3d5f7981d7f 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -365,6 +365,7 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay, SalDisplay::SalDisplay( Display *display ) : mpInputMethod( NULL ), pDisp_( display ), + m_nXDefaultScreen( 0 ), m_pWMAdaptor( NULL ), m_bUseRandRWrapper( true ), m_nLastUserEventTime( CurrentTime ) @@ -378,7 +379,7 @@ SalDisplay::SalDisplay( Display *display ) : DBG_ASSERT( ! pData->GetDisplay(), "Second SalDisplay created !!!\n" ); pData->SetDisplay( this ); - m_nDefaultScreen = DefaultScreen( pDisp_ ); + m_nXDefaultScreen = SalX11Screen( DefaultScreen( pDisp_ ) ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -521,61 +522,62 @@ void SalX11Display::PostUserEvent() pXLib_->PostUserEvent(); } -void SalDisplay::initScreen( int nScreen ) const +SalDisplay::ScreenData * +SalDisplay::initScreen( SalX11Screen nXScreen ) const { - if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) ) - nScreen = m_nDefaultScreen; - ScreenData& rSD = const_cast<ScreenData&>(m_aScreens[nScreen]); - if( rSD.m_bInit ) - return; - rSD.m_bInit = true; + if( nXScreen.getXScreen() >= static_cast<int>(m_aScreens.size()) ) + nXScreen = m_nXDefaultScreen; + ScreenData* pSD = const_cast<ScreenData *>(&m_aScreens[nXScreen.getXScreen()]); + if( pSD->m_bInit ) + return NULL; + pSD->m_bInit = true; XVisualInfo aVI; Colormap aColMap; - if( SalDisplay::BestVisual( pDisp_, nScreen, aVI ) ) // DefaultVisual - aColMap = DefaultColormap( pDisp_, nScreen ); + if( SalDisplay::BestVisual( pDisp_, nXScreen.getXScreen(), aVI ) ) // DefaultVisual + aColMap = DefaultColormap( pDisp_, nXScreen.getXScreen() ); else aColMap = XCreateColormap( pDisp_, - RootWindow( pDisp_, nScreen ), + RootWindow( pDisp_, nXScreen.getXScreen() ), aVI.visual, AllocNone ); - Screen* pScreen = ScreenOfDisplay( pDisp_, nScreen ); + Screen* pScreen = ScreenOfDisplay( pDisp_, nXScreen.getXScreen() ); - rSD.m_aSize = Size( WidthOfScreen( pScreen ), HeightOfScreen( pScreen ) ); - rSD.m_aRoot = RootWindow( pDisp_, nScreen ); - rSD.m_aVisual = SalVisual( &aVI ); - rSD.m_aColormap = SalColormap( this, aColMap, nScreen ); + pSD->m_aSize = Size( WidthOfScreen( pScreen ), HeightOfScreen( pScreen ) ); + pSD->m_aRoot = RootWindow( pDisp_, nXScreen.getXScreen() ); + pSD->m_aVisual = SalVisual( &aVI ); + pSD->m_aColormap = SalColormap( this, aColMap, nXScreen ); // we're interested in configure notification of root windows - InitRandR( rSD.m_aRoot ); + InitRandR( pSD->m_aRoot ); // - - - - - - - - - - Reference Window/Default Drawable - - XSetWindowAttributes aXWAttributes; aXWAttributes.border_pixel = 0; aXWAttributes.background_pixel = 0; aXWAttributes.colormap = aColMap; - rSD.m_aRefWindow = XCreateWindow( pDisp_, - rSD.m_aRoot, + pSD->m_aRefWindow = XCreateWindow( pDisp_, + pSD->m_aRoot, 0,0, 16,16, 0, - rSD.m_aVisual.GetDepth(), + pSD->m_aVisual.GetDepth(), InputOutput, - rSD.m_aVisual.GetVisual(), + pSD->m_aVisual.GetVisual(), CWBorderPixel|CWBackPixel|CWColormap, &aXWAttributes ); // set client leader (session id gets set when session is started) - if( rSD.m_aRefWindow ) + if( pSD->m_aRefWindow ) { // client leader must have WM_CLIENT_LEADER pointing to itself XChangeProperty( pDisp_, - rSD.m_aRefWindow, + pSD->m_aRefWindow, XInternAtom( pDisp_, "WM_CLIENT_LEADER", False ), XA_WINDOW, 32, PropModeReplace, - (unsigned char*)&rSD.m_aRefWindow, + (unsigned char*)&pSD->m_aRefWindow, 1 ); @@ -583,73 +585,74 @@ void SalDisplay::initScreen( int nScreen ) const const char* argv[2]; argv[0] = "/bin/sh"; argv[1] = aExec.getStr(); - XSetCommand( pDisp_, rSD.m_aRefWindow, const_cast<char**>(argv), 2 ); - XSelectInput( pDisp_, rSD.m_aRefWindow, PropertyChangeMask ); + XSetCommand( pDisp_, pSD->m_aRefWindow, const_cast<char**>(argv), 2 ); + XSelectInput( pDisp_, pSD->m_aRefWindow, PropertyChangeMask ); // - - - - - - - - - - GCs - - - - - - - - - - - - - - - - - XGCValues values; values.graphics_exposures = False; values.fill_style = FillOpaqueStippled; - values.background = (1<<rSD.m_aVisual.GetDepth())-1; + values.background = (1<<pSD->m_aVisual.GetDepth())-1; values.foreground = 0; - rSD.m_aCopyGC = XCreateGC( pDisp_, - rSD.m_aRefWindow, + pSD->m_aCopyGC = XCreateGC( pDisp_, + pSD->m_aRefWindow, GCGraphicsExposures | GCForeground | GCBackground, &values ); - rSD.m_aAndInvertedGC= XCreateGC( pDisp_, - rSD.m_aRefWindow, + pSD->m_aAndInvertedGC= XCreateGC( pDisp_, + pSD->m_aRefWindow, GCGraphicsExposures | GCForeground | GCBackground, &values ); - rSD.m_aAndGC = XCreateGC( pDisp_, - rSD.m_aRefWindow, + pSD->m_aAndGC = XCreateGC( pDisp_, + pSD->m_aRefWindow, GCGraphicsExposures | GCForeground | GCBackground, &values ); - rSD.m_aOrGC = XCreateGC( pDisp_, - rSD.m_aRefWindow, + pSD->m_aOrGC = XCreateGC( pDisp_, + pSD->m_aRefWindow, GCGraphicsExposures | GCForeground | GCBackground, &values ); - rSD.m_aStippleGC = XCreateGC( pDisp_, - rSD.m_aRefWindow, + pSD->m_aStippleGC = XCreateGC( pDisp_, + pSD->m_aRefWindow, GCGraphicsExposures | GCFillStyle | GCForeground | GCBackground, &values ); - XSetFunction( pDisp_, rSD.m_aAndInvertedGC, GXandInverted ); - XSetFunction( pDisp_, rSD.m_aAndGC, GXand ); + XSetFunction( pDisp_, pSD->m_aAndInvertedGC, GXandInverted ); + XSetFunction( pDisp_, pSD->m_aAndGC, GXand ); // PowerPC Solaris 2.5 (XSun 3500) Bug: GXor = GXnop - XSetFunction( pDisp_, rSD.m_aOrGC, GXxor ); + XSetFunction( pDisp_, pSD->m_aOrGC, GXxor ); - if( 1 == rSD.m_aVisual.GetDepth() ) + if( 1 == pSD->m_aVisual.GetDepth() ) { - XSetFunction( pDisp_, rSD.m_aCopyGC, GXcopyInverted ); - rSD.m_aMonoGC = rSD.m_aCopyGC; + XSetFunction( pDisp_, pSD->m_aCopyGC, GXcopyInverted ); + pSD->m_aMonoGC = pSD->m_aCopyGC; } else { - Pixmap hPixmap = XCreatePixmap( pDisp_, rSD.m_aRefWindow, 1, 1, 1 ); - rSD.m_aMonoGC = XCreateGC( pDisp_, + Pixmap hPixmap = XCreatePixmap( pDisp_, pSD->m_aRefWindow, 1, 1, 1 ); + pSD->m_aMonoGC = XCreateGC( pDisp_, hPixmap, GCGraphicsExposures, &values ); XFreePixmap( pDisp_, hPixmap ); } - rSD.m_hInvert50 = XCreateBitmapFromData( pDisp_, - rSD.m_aRefWindow, + pSD->m_hInvert50 = XCreateBitmapFromData( pDisp_, + pSD->m_aRefWindow, reinterpret_cast<const char*>(invert50_bits), invert50_width, invert50_height ); } + return pSD; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -685,8 +688,10 @@ void SalDisplay::Init() if( mbExactResolution == false ) { aResolution_ = - Pair( DPI( WidthOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), DisplayWidthMM ( pDisp_, m_nDefaultScreen ) ), - DPI( HeightOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), DisplayHeightMM( pDisp_, m_nDefaultScreen ) ) ); + Pair( DPI( WidthOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), + DisplayWidthMM ( pDisp_, m_nXDefaultScreen.getXScreen() ) ), + DPI( HeightOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), + DisplayHeightMM( pDisp_, m_nXDefaultScreen.getXScreen() ) ) ); } nMaxRequestSize_ = XExtendedMaxRequestSize( pDisp_ ) * 4; @@ -1893,7 +1898,7 @@ XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle ) if( None == aCur ) { XColor aBlack, aWhite, aDummy; - Colormap hColormap = GetColormap(m_nDefaultScreen).GetXColormap(); + Colormap hColormap = GetColormap(m_nXDefaultScreen).GetXColormap(); XAllocNamedColor( pDisp_, hColormap, "black", &aBlack, &aDummy ); XAllocNamedColor( pDisp_, hColormap, "white", &aWhite, &aDummy ); @@ -2269,7 +2274,8 @@ void SalDisplay::PrintInfo() const fprintf( stderr, "\tProtocol \t%d.%d\n", ProtocolVersion(pDisp_), ProtocolRevision(pDisp_) ); fprintf( stderr, "\tScreen (count,def)\t%d (%d,%d)\n", - m_nDefaultScreen, ScreenCount(pDisp_), DefaultScreen(pDisp_) ); + m_nXDefaultScreen.getXScreen(), + ScreenCount(pDisp_), DefaultScreen(pDisp_) ); fprintf( stderr, "\tshift ctrl alt \t%s (0x%X) %s (0x%X) %s (0x%X)\n", KeyStr( nShiftKeySym_ ), sal::static_int_cast< unsigned int >(nShiftKeySym_), KeyStr( nCtrlKeySym_ ), sal::static_int_cast< unsigned int >(nCtrlKeySym_), @@ -2286,17 +2292,21 @@ void SalDisplay::PrintInfo() const fprintf( stderr, "Screen\n" ); fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n", aResolution_.A(), aResolution_.B(), - m_aScreens[m_nDefaultScreen].m_aSize.Width(), m_aScreens[m_nDefaultScreen].m_aSize.Height(), - Hypothenuse( DisplayWidthMM ( pDisp_, m_nDefaultScreen ), - DisplayHeightMM( pDisp_, m_nDefaultScreen ) ) / 25.4 ); + m_aScreens[m_nXDefaultScreen.getXScreen()].m_aSize.Width(), + m_aScreens[m_nXDefaultScreen.getXScreen()].m_aSize.Height(), + Hypothenuse( DisplayWidthMM ( pDisp_, m_nXDefaultScreen.getXScreen() ), + DisplayHeightMM( pDisp_, m_nXDefaultScreen.getXScreen() ) ) / 25.4 ); fprintf( stderr, "\tBlack&White \t%lu %lu\n", - GetColormap(m_nDefaultScreen).GetBlackPixel(), GetColormap(m_nDefaultScreen).GetWhitePixel() ); + GetColormap(m_nXDefaultScreen).GetBlackPixel(), + GetColormap(m_nXDefaultScreen).GetWhitePixel() ); fprintf( stderr, "\tRGB \t0x%lx 0x%lx 0x%lx\n", - GetVisual(m_nDefaultScreen).red_mask, GetVisual(m_nDefaultScreen).green_mask, GetVisual(m_nDefaultScreen).blue_mask ); + GetVisual(m_nXDefaultScreen).red_mask, + GetVisual(m_nXDefaultScreen).green_mask, + GetVisual(m_nXDefaultScreen).blue_mask ); fprintf( stderr, "\tVisual \t%d-bit %s ID=0x%x\n", - GetVisual(m_nDefaultScreen).GetDepth(), - VisualClassName[ GetVisual(m_nDefaultScreen).GetClass() ], - sal::static_int_cast< unsigned int >(GetVisual(m_nDefaultScreen).GetVisualId()) ); + GetVisual(m_nXDefaultScreen).GetDepth(), + VisualClassName[ GetVisual(m_nXDefaultScreen).GetClass() ], + sal::static_int_cast< unsigned int >(GetVisual(m_nXDefaultScreen).GetVisualId()) ); } void SalDisplay::addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight ) @@ -2393,7 +2403,7 @@ extern "C" { SalDisplay* pSalDisplay = reinterpret_cast<SalDisplay*>(i_pArg); if( i_pEvent->type == PropertyNotify && - i_pEvent->xproperty.window == pSalDisplay->GetDrawable( pSalDisplay->GetDefaultScreenNumber() ) && + i_pEvent->xproperty.window == pSalDisplay->GetDrawable( pSalDisplay->GetDefaultXScreen() ) && i_pEvent->xproperty.atom == pSalDisplay->getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT ) ) return True; @@ -2410,7 +2420,7 @@ XLIB_Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const unsigned char c = 0; XEvent aEvent; Atom nAtom = getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT ); - XChangeProperty( GetDisplay(), GetDrawable( GetDefaultScreenNumber() ), + XChangeProperty( GetDisplay(), GetDrawable( GetDefaultXScreen() ), nAtom, nAtom, 8, PropModeReplace, &c, 1 ); XFlush( GetDisplay() ); @@ -2593,12 +2603,13 @@ Pixel SalVisual::GetTCPixel( SalColor nSalColor ) const // -=-= SalColormap -=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap, int nScreen ) +SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap, + SalX11Screen nXScreen ) : m_pDisplay( pDisplay ), m_hColormap( hColormap ), - m_nScreen( nScreen ) + m_nXScreen( nXScreen ) { - m_aVisual = m_pDisplay->GetVisual( m_nScreen ); + m_aVisual = m_pDisplay->GetVisual( m_nXScreen ); XColor aColor; @@ -2664,10 +2675,8 @@ SalColormap::SalColormap() m_nWhitePixel( 1 ), m_nBlackPixel( 0 ), m_nUsed( 2 ), - m_nScreen( 0 ) + m_nXScreen( m_pDisplay != NULL ? m_pDisplay->GetDefaultXScreen() : SalX11Screen( 0 ) ) { - if( m_pDisplay ) - m_nScreen = m_pDisplay->GetDefaultScreenNumber(); m_aPalette = std::vector<SalColor>(m_nUsed); m_aPalette[m_nBlackPixel] = SALCOLOR_BLACK; @@ -2681,9 +2690,9 @@ SalColormap::SalColormap( sal_uInt16 nDepth ) m_nWhitePixel( (1 << nDepth) - 1 ), m_nBlackPixel( 0x00000000 ), m_nUsed( 1 << nDepth ), - m_nScreen( GetGenericData()->GetSalDisplay()->GetDefaultScreenNumber() ) + m_nXScreen( GetGenericData()->GetSalDisplay()->GetDefaultXScreen() ) { - const SalVisual *pVisual = &m_pDisplay->GetVisual( m_nScreen ); + const SalVisual *pVisual = &m_pDisplay->GetVisual( m_nXScreen ); if( pVisual->GetClass() == TrueColor && pVisual->GetDepth() == nDepth ) m_aVisual = *pVisual; @@ -2692,7 +2701,7 @@ SalColormap::SalColormap( sal_uInt16 nDepth ) XVisualInfo aVI; if( !XMatchVisualInfo( m_pDisplay->GetDisplay(), - m_pDisplay->GetDefaultScreenNumber(), + m_pDisplay->GetDefaultXScreen().getXScreen(), nDepth, TrueColor, &aVI ) ) diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index d4f97631652c..68f1dfee52b5 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -486,10 +486,10 @@ void SessionManagerClient::open() ICEConnectionObserver::unlock(); SalDisplay* pDisp = GetGenericData()->GetSalDisplay(); - if( pDisp->GetDrawable(pDisp->GetDefaultScreenNumber()) && !m_aClientID.isEmpty() ) + if( pDisp->GetDrawable(pDisp->GetDefaultXScreen()) && !m_aClientID.isEmpty() ) { XChangeProperty( pDisp->GetDisplay(), - pDisp->GetDrawable( pDisp->GetDefaultScreenNumber() ), + pDisp->GetDrawable( pDisp->GetDefaultXScreen() ), XInternAtom( pDisp->GetDisplay(), "SM_CLIENT_ID", False ), XA_STRING, 8, diff --git a/vcl/unx/generic/app/soicon.cxx b/vcl/unx/generic/app/soicon.cxx index b2db0a516951..79d9e6019035 100644 --- a/vcl/unx/generic/app/soicon.cxx +++ b/vcl/unx/generic/app/soicon.cxx @@ -43,8 +43,9 @@ #include <impbmp.hxx> -sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon, sal_uInt16 iconSize, - Pixmap& icon_pixmap, Pixmap& icon_mask) +sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, SalX11Screen nXScreen, + sal_uInt16 nIcon, sal_uInt16 iconSize, + Pixmap& icon_pixmap, Pixmap& icon_mask) { if( ! ImplGetResMgr() ) return sal_False; @@ -74,23 +75,26 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon (aIcon.ImplGetBitmapImpBitmap()->ImplGetSalBitmap()); icon_pixmap = XCreatePixmap( pDisplay->GetDisplay(), - pDisplay->GetRootWindow( nScreen ), + pDisplay->GetRootWindow( nXScreen ), iconSize, iconSize, - DefaultDepth( pDisplay->GetDisplay(), nScreen ) + DefaultDepth( pDisplay->GetDisplay(), + nXScreen.getXScreen() ) ); pBitmap->ImplDraw( icon_pixmap, - nScreen, - DefaultDepth( pDisplay->GetDisplay(), nScreen ), + nXScreen, + DefaultDepth( pDisplay->GetDisplay(), + nXScreen.getXScreen() ), aRect, - DefaultGC(pDisplay->GetDisplay(), nScreen ) ); + DefaultGC( pDisplay->GetDisplay(), + nXScreen.getXScreen() ) ); icon_mask = None; if( TRANSPARENT_BITMAP == aIcon.GetTransparentType() ) { icon_mask = XCreatePixmap( pDisplay->GetDisplay(), - pDisplay->GetRootWindow( pDisplay->GetDefaultScreenNumber() ), + pDisplay->GetRootWindow( pDisplay->GetDefaultXScreen() ), iconSize, iconSize, 1); XGCValues aValues; @@ -106,7 +110,7 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon X11SalBitmap *pMask = static_cast < X11SalBitmap * > (aMask.ImplGetImpBitmap()->ImplGetSalBitmap()); - pMask->ImplDraw(icon_mask, nScreen, 1, aRect, aMonoGC); + pMask->ImplDraw(icon_mask, nXScreen, 1, aRect, aMonoGC); XFreeGC( pDisplay->GetDisplay(), aMonoGC ); } diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index ecccb03e3314..46df22686588 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -255,7 +255,7 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : // default desktops m_nDesktops = 1; m_aWMWorkAreas = ::std::vector< Rectangle > - ( 1, Rectangle( Point(), m_pSalDisplay->GetScreenSize( m_pSalDisplay->GetDefaultScreenNumber() ) ) ); + ( 1, Rectangle( Point(), m_pSalDisplay->GetScreenSize( m_pSalDisplay->GetDefaultXScreen() ) ) ); m_bEqualWorkAreas = true; memset( m_aWMAtoms, 0, sizeof( m_aWMAtoms ) ); @@ -270,7 +270,7 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : Atom aRwmRunning = XInternAtom( m_pDisplay, "RWM_RUNNING", True ); if( aRwmRunning != None && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), aRwmRunning, 0, 32, False, @@ -287,7 +287,7 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : } else if( (aRwmRunning = XInternAtom( m_pDisplay, "_WRQ_WM_RUNNING", True )) != None && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), aRwmRunning, 0, 32, False, @@ -308,7 +308,7 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : Atom aTTAPlatform = XInternAtom( m_pDisplay, "TTA_CLIENT_PLATFORM", True ); if( aTTAPlatform != None && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), aTTAPlatform, 0, 32, False, @@ -367,7 +367,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : bNetWM = getNetWmName(); if( bNetWM && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_SUPPORTED ], 0, 0, False, @@ -388,7 +388,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : } // collect supported protocols if( XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_SUPPORTED ], 0, nBytesLeft/4, False, @@ -446,7 +446,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : // get number of desktops if( m_aWMAtoms[ NET_NUMBER_OF_DESKTOPS ] && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_NUMBER_OF_DESKTOPS ], 0, 1, False, @@ -465,7 +465,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : // get work areas if( m_aWMAtoms[ NET_WORKAREA ] && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_WORKAREA ], 0, 4*m_nDesktops, False, @@ -558,7 +558,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : { XLIB_Window aWMChild = None; if( XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ WIN_SUPPORTING_WM_CHECK ], 0, 1, False, @@ -625,7 +625,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : } if( m_bValid && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ WIN_PROTOCOLS ], 0, 0, False, @@ -646,7 +646,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : } // collect supported protocols if( XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ WIN_PROTOCOLS ], 0, nBytesLeft/4, False, @@ -710,7 +710,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : // get number of desktops if( m_aWMAtoms[ WIN_WORKSPACE_COUNT ] && XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ WIN_WORKSPACE_COUNT ], 0, 1, False, @@ -763,7 +763,7 @@ bool WMAdaptor::getNetWmName() { XLIB_Window aWMChild = None; if( XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ], 0, 1, False, @@ -2182,7 +2182,7 @@ int WMAdaptor::getCurrentWorkArea() const unsigned long nBytesLeft = 0; unsigned char* pProperty = NULL; if( XGetWindowProperty( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), m_aWMAtoms[ NET_CURRENT_DESKTOP ], 0, 1, False, @@ -2260,7 +2260,7 @@ void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const XEvent aEvent; aEvent.type = ClientMessage; aEvent.xclient.display = m_pDisplay; - aEvent.xclient.window = m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ); + aEvent.xclient.window = m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ); aEvent.xclient.message_type = m_aWMAtoms[ NET_CURRENT_DESKTOP ]; aEvent.xclient.format = 32; aEvent.xclient.data.l[0] = nWorkArea; @@ -2269,7 +2269,7 @@ void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const aEvent.xclient.data.l[3] = 0; aEvent.xclient.data.l[4] = 0; XSendEvent( m_pDisplay, - m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ), + m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultXScreen() ), False, SubstructureNotifyMask | SubstructureRedirectMask, &aEvent diff --git a/vcl/unx/generic/gdi/gcach_xpeer.cxx b/vcl/unx/generic/gdi/gcach_xpeer.cxx index ac3793430b8d..c6a23f33818e 100644 --- a/vcl/unx/generic/gdi/gcach_xpeer.cxx +++ b/vcl/unx/generic/gdi/gcach_xpeer.cxx @@ -54,12 +54,12 @@ X11GlyphPeer::~X11GlyphPeer() //Why do this here, move into dtor/shutdown of display? SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); Display* const pX11Disp = pSalDisp->GetDisplay(); - int nMaxScreens = pSalDisp->GetScreenCount(); + int nMaxScreens = pSalDisp->GetXScreenCount(); XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); for( int i = 0; i < nMaxScreens; i++ ) { - SalDisplay::RenderEntryMap& rMap = pSalDisp->GetRenderEntries( i ); + SalDisplay::RenderEntryMap& rMap = pSalDisp->GetRenderEntries( SalX11Screen (i) ); for( SalDisplay::RenderEntryMap::iterator it = rMap.begin(); it != rMap.end(); ++it ) { if( it->second.m_aPixmap ) diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 51d0f19e8e9d..0eccf20f1ad0 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -203,7 +203,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, - int nScreen, + SalX11Screen nScreen, long nDrawableDepth, long nX, long nY, @@ -378,7 +378,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, - int nScreen, + SalX11Screen nScreen, long nDepth, const SalTwoRect& rTwoRect ) const @@ -549,7 +549,7 @@ XImage* X11SalBitmap::ImplCreateXImage( // ----------------------------------------------------------------------------- bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, + SalX11Screen nScreen, long nDrawableDepth, long nX, long nY, @@ -628,10 +628,10 @@ bool X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) { XImage* pImage = XGetImage( pDisplay, aAttribute.root, x, y, width, height, AllPlanes, ZPixmap ); - bool bSnapShot = ImplCreateFromXImage( pDisplay, - aAttribute.root, - XScreenNumberOfScreen( aAttribute.screen ), - pImage ); + bool bSnapShot = ImplCreateFromXImage( + pDisplay, aAttribute.root, + SalX11Screen (XScreenNumberOfScreen( aAttribute.screen ) ), + pImage ); XDestroyImage (pImage); return bSnapShot; @@ -646,7 +646,7 @@ bool X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) bool X11SalBitmap::ImplCreateFromXImage ( Display* pDisplay, XLIB_Window hWindow, - int nScreen, + SalX11Screen nScreen, XImage* pImage ) { Destroy(); @@ -661,12 +661,12 @@ bool X11SalBitmap::ImplCreateFromXImage ( ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, const SalTwoRect& rTwoRect ) const { - if( !mpDDB || !mpDDB->ImplMatches( nScreen, nDrawableDepth, rTwoRect ) ) + if( !mpDDB || !mpDDB->ImplMatches( nXScreen, nDrawableDepth, rTwoRect ) ) { if( mpDDB ) { @@ -739,12 +739,12 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( } } - XImage* pImage = ImplCreateXImage( GetGenericData()->GetSalDisplay(), nScreen, + XImage* pImage = ImplCreateXImage( GetGenericData()->GetSalDisplay(), nXScreen, nDrawableDepth, aTwoRect ); if( pImage ) { - const_cast<X11SalBitmap*>(this)->mpDDB = new ImplSalDDB( pImage, aDrawable, nScreen, aTwoRect ); + const_cast<X11SalBitmap*>(this)->mpDDB = new ImplSalDDB( pImage, aDrawable, nXScreen, aTwoRect ); delete[] pImage->data, pImage->data = NULL; XDestroyImage( pImage ); @@ -760,13 +760,13 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( void X11SalBitmap::ImplDraw( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const { - ImplGetDDB( aDrawable, nScreen, nDrawableDepth, rTwoRect ); + ImplGetDDB( aDrawable, nXScreen, nDrawableDepth, rTwoRect ); if( mpDDB ) mpDDB->ImplDraw( aDrawable, nDrawableDepth, rTwoRect, rGC ); } @@ -853,7 +853,8 @@ bool X11SalBitmap::Create( mbGrey = bMask; bool bSuccess = ImplCreateFromDrawable( pixmapHandle, - 0, + // FIXME: this seems multi-screen broken to me + SalX11Screen( 0 ), depth, 0, 0, @@ -975,11 +976,12 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) // - ImplSalDDB - // -------------- -ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) +ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, + SalX11Screen nXScreen, const SalTwoRect& rTwoRect ) : maPixmap ( 0 ) , maTwoRect ( rTwoRect ) , mnDepth ( pImage->depth ) - , mnScreen ( nScreen ) + , mnXScreen ( nXScreen ) { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -1007,8 +1009,8 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const S // ----------------------------------------------------------------------------------------- // create from XImage -ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) - : mnScreen( nScreen ) +ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, SalX11Screen nXScreen, XImage* pImage) + : mnXScreen( nXScreen ) { maPixmap = XCreatePixmap (pDisplay, hWindow, pImage->width, pImage->height, pImage->depth); if (maPixmap != 0) @@ -1047,14 +1049,14 @@ ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XIm ImplSalDDB::ImplSalDDB( Drawable aDrawable, - int nScreen, + SalX11Screen nXScreen, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : mnDepth( nDrawableDepth ) - , mnScreen( nScreen ) + , mnXScreen( nXScreen ) { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -1094,11 +1096,11 @@ ImplSalDDB::~ImplSalDDB() // ----------------------------------------------------------------------------- -bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const +bool ImplSalDDB::ImplMatches( SalX11Screen nXScreen, long nDepth, const SalTwoRect& rTwoRect ) const { bool bRet = false; - if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) + if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nXScreen == mnXScreen) { if ( rTwoRect.mnSrcX == maTwoRect.mnSrcX && rTwoRect.mnSrcY == maTwoRect.mnSrcY diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index abd153a86ef0..b07a709555cf 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -96,6 +96,7 @@ inline SalPolyLine::~SalPolyLine() // -=-= X11SalGraphics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= X11SalGraphics::X11SalGraphics() + : m_nXScreen( 0 ) { m_pFrame = NULL; m_pVDev = NULL; @@ -189,18 +190,18 @@ void X11SalGraphics::freeResources() bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false; } -void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) +void X11SalGraphics::SetDrawable( Drawable aDrawable, SalX11Screen nXScreen ) { // shortcut if nothing changed if( hDrawable_ == aDrawable ) return; // free screen specific resources if needed - if( nScreen != m_nScreen ) + if( nXScreen != m_nXScreen ) { freeResources(); - m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap( nScreen ); - m_nScreen = nScreen; + m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap( nXScreen ); + m_nXScreen = nXScreen; } hDrawable_ = aDrawable; @@ -219,22 +220,22 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen ) } } -void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen ) +void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, + SalX11Screen nXScreen ) { + m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap(nXScreen); + m_nXScreen = nXScreen; + SetDrawable( aTarget, nXScreen ); - m_pColormap = &GetGenericData()->GetSalDisplay()->GetColormap(nScreen); - m_nScreen = nScreen; - SetDrawable( aTarget, nScreen ); - - bWindow_ = sal_True; - m_pFrame = pFrame; - m_pVDev = NULL; + bWindow_ = sal_True; + m_pFrame = pFrame; + m_pVDev = NULL; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void X11SalGraphics::DeInit() { - SetDrawable( None, m_nScreen ); + SetDrawable( None, m_nXScreen ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -477,7 +478,7 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor ) // put the ximage to the pixmap XPutImage( GetXDisplay(), hBrush_, - GetDisplay()->GetCopyGC( m_nScreen ), + GetDisplay()->GetCopyGC( m_nXScreen ), pImage, 0, 0, // Source 0, 0, // Destination @@ -1041,7 +1042,7 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const aRes.pDisplay = GetXDisplay(); aRes.hDrawable = hDrawable_; aRes.pVisual = GetVisual().visual; - aRes.nScreen = m_nScreen; + aRes.nScreen = m_nXScreen.getXScreen(); aRes.nDepth = GetBitCount(); aRes.aColormap = GetColormap().GetXColormap(); aRes.pXRenderFormat = m_pXRenderFormat; @@ -1135,7 +1136,7 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr // get xrender Picture for polygon foreground // TODO: cache it like the target picture which uses GetXRenderPicture() XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); - SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nScreen )[ 32 ]; + SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nXScreen )[ 32 ]; if( !rEntry.m_aPicture ) { Display* pXDisplay = GetXDisplay(); diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 900bd90717a6..e61576ef7391 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -68,16 +68,16 @@ // -=-= X11SalGraphics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void X11SalGraphics::CopyScreenArea( Display* pDisplay, - Drawable aSrc, int nScreenSrc, int nSrcDepth, - Drawable aDest, int nScreenDest, int nDestDepth, - GC aDestGC, - int src_x, int src_y, - unsigned int w, unsigned int h, - int dest_x, int dest_y ) + Drawable aSrc, SalX11Screen nXScreenSrc, int nSrcDepth, + Drawable aDest, SalX11Screen nXScreenDest, int nDestDepth, + GC aDestGC, + int src_x, int src_y, + unsigned int w, unsigned int h, + int dest_x, int dest_y ) { if( nSrcDepth == nDestDepth ) { - if( nScreenSrc == nScreenDest ) + if( nXScreenSrc == nXScreenDest ) XCopyArea( pDisplay, aSrc, aDest, aDestGC, src_x, src_y, w, h, dest_x, dest_y ); else @@ -98,14 +98,14 @@ void X11SalGraphics::CopyScreenArea( Display* pDisplay, else { X11SalBitmap aBM; - aBM.ImplCreateFromDrawable( aSrc, nScreenSrc, nSrcDepth, src_x, src_y, w, h ); + aBM.ImplCreateFromDrawable( aSrc, nXScreenSrc, nSrcDepth, src_x, src_y, w, h ); SalTwoRect aTwoRect; aTwoRect.mnSrcX = aTwoRect.mnSrcY = 0; aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = w; aTwoRect.mnSrcHeight = aTwoRect.mnDestHeight = h; aTwoRect.mnDestX = dest_x; aTwoRect.mnDestY = dest_y; - aBM.ImplDraw( aDest, nScreenDest, nDestDepth, aTwoRect,aDestGC ); + aBM.ImplDraw( aDest, nXScreenDest, nDestDepth, aTwoRect,aDestGC ); } } @@ -119,7 +119,7 @@ GC X11SalGraphics::CreateGC( Drawable hDrawable, unsigned long nMask ) values.function = GXxor; values.line_width = 1; values.fill_style = FillStippled; - values.stipple = GetDisplay()->GetInvert50( m_nScreen ); + values.stipple = GetDisplay()->GetInvert50( m_nXScreen ); values.subwindow_mode = ClipByChildren; return XCreateGC( GetXDisplay(), hDrawable, nMask | GCSubwindowMode, &values ); @@ -206,7 +206,7 @@ GC X11SalGraphics::GetInvert50GC() else { values.fill_style = FillStippled; - values.stipple = GetDisplay()->GetInvert50( m_nScreen ); + values.stipple = GetDisplay()->GetInvert50( m_nXScreen ); } pInvert50GC_ = XCreateGC( GetXDisplay(), GetDrawable(), @@ -360,7 +360,7 @@ GC X11SalGraphics::SetMask( int &nX, // - - - - reset pixmap; all 0 - - - - - - - - - - - - - - - - - - - XFillRectangle( pDisplay, hPixmap, - GetDisplay()->GetMonoGC( m_nScreen ), + GetDisplay()->GetMonoGC( m_nXScreen ), 0, 0, nDX, nDY ); @@ -467,7 +467,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry, { // window or compatible virtual device if( pSrcGraphics->GetDisplay() == GetDisplay() && - pSrcGraphics->m_nScreen == m_nScreen && + pSrcGraphics->m_nXScreen == m_nXScreen && pSrcGraphics->GetVisual().GetDepth() == GetVisual().GetDepth() ) n = 2; // same Display @@ -508,7 +508,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight, pSrcGraphics->GetBitCount() ); - pCopyGC = GetDisplay()->GetCopyGC( m_nScreen ); + pCopyGC = GetDisplay()->GetCopyGC( m_nXScreen ); if( bNeedGraphicsExposures ) XSetGraphicsExposures( GetXDisplay(), @@ -615,8 +615,8 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa const SalDisplay* pSalDisp = GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); const Drawable aDrawable( GetDrawable() ); - const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen ); - const long nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth(); + const SalColormap& rColMap = pSalDisp->GetColormap( m_nXScreen ); + const long nDepth = GetDisplay()->GetVisual( m_nXScreen ).GetDepth(); GC aGC( GetCopyGC() ); XGCValues aOldVal, aNewVal; int nValues = GCForeground | GCBackground; @@ -644,7 +644,7 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa XChangeGC( pXDisp, aGC, nValues, &aNewVal ); } - static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aDrawable, m_nScreen, nDepth, *pPosAry, aGC ); + static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aDrawable, m_nXScreen, nDepth, *pPosAry, aGC ); if( rSalBitmap.GetBitCount() == 1 ) XChangeGC( pXDisp, aGC, nValues, &aOldVal ); @@ -687,7 +687,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, // refuse to work. const sal_uInt16 nDepth( m_pVDev ? m_pVDev->GetDepth() : - pSalDisp->GetVisual( m_nScreen ).GetDepth() ); + pSalDisp->GetVisual( m_nXScreen ).GetDepth() ); Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth, pPosAry->mnDestHeight, nDepth ) ); Pixmap aBG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth, @@ -697,7 +697,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, { GC aTmpGC; XGCValues aValues; - const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen ); + const SalColormap& rColMap = pSalDisp->GetColormap( m_nXScreen ); const int nBlack = rColMap.GetBlackPixel(), nWhite = rColMap.GetWhitePixel(); const int nValues = GCFunction | GCForeground | GCBackground; SalTwoRect aTmpRect( *pPosAry ); aTmpRect.mnDestX = aTmpRect.mnDestY = 0; @@ -705,7 +705,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, // draw paint bitmap in pixmap #1 aValues.function = GXcopy, aValues.foreground = nWhite, aValues.background = nBlack; aTmpGC = XCreateGC( pXDisp, aFG, nValues, &aValues ); - static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aFG, m_nScreen, nDepth, aTmpRect, aTmpGC ); + static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aFG, m_nXScreen, nDepth, aTmpRect, aTmpGC ); DBG_TESTTRANS( aFG ); // draw background in pixmap #2 @@ -719,7 +719,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, // mask out paint bitmap in pixmap #1 (transparent areas 0) aValues.function = GXand, aValues.foreground = 0x00000000, aValues.background = 0xffffffff; XChangeGC( pXDisp, aTmpGC, nValues, &aValues ); - static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aFG, m_nScreen, 1, aTmpRect, aTmpGC ); + static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aFG, m_nXScreen, 1, aTmpRect, aTmpGC ); DBG_TESTTRANS( aFG ); @@ -729,7 +729,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry, // mask out background in pixmap #2 (nontransparent areas 0) aValues.function = GXand, aValues.foreground = 0xffffffff, aValues.background = 0x00000000; XChangeGC( pXDisp, aTmpGC, nValues, &aValues ); - static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aBG, m_nScreen, 1, aTmpRect, aTmpGC ); + static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aBG, m_nXScreen, 1, aTmpRect, aTmpGC ); DBG_TESTTRANS( aBG ); } @@ -794,13 +794,13 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, return false; const SalDisplay* pSalDisp = GetDisplay(); - const SalVisual& rSalVis = pSalDisp->GetVisual( m_nScreen ); + const SalVisual& rSalVis = pSalDisp->GetVisual( m_nXScreen ); Display* pXDisplay = pSalDisp->GetDisplay(); // create source Picture int nDepth = m_pVDev ? m_pVDev->GetDepth() : rSalVis.GetDepth(); const X11SalBitmap& rSrcX11Bmp = static_cast<const X11SalBitmap&>( rSrcBitmap ); - ImplSalDDB* pSrcDDB = rSrcX11Bmp.ImplGetDDB( hDrawable_, m_nScreen, nDepth, rTR ); + ImplSalDDB* pSrcDDB = rSrcX11Bmp.ImplGetDDB( hDrawable_, m_nXScreen, nDepth, rTR ); if( !pSrcDDB ) return false; @@ -958,7 +958,7 @@ void X11SalGraphics::drawMask( const SalTwoRect* pPosAry, aValues.function = GXcopyInverted; aValues.foreground = 1, aValues.background = 0; aTmpGC = XCreateGC( pXDisp, aStipple, GCFunction | GCForeground | GCBackground, &aValues ); - static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aStipple, m_nScreen, 1, aTwoRect, aTmpGC ); + static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aStipple, m_nXScreen, 1, aTwoRect, aTmpGC ); XFreeGC( pXDisp, aTmpGC ); @@ -1039,11 +1039,11 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY ) X11SalBitmap* pSalBitmap = new X11SalBitmap; sal_uInt16 nBitCount = GetBitCount(); - if( &GetDisplay()->GetColormap( m_nScreen ) != &GetColormap() ) + if( &GetDisplay()->GetColormap( m_nXScreen ) != &GetColormap() ) nBitCount = 1; if( ! bFakeWindowBG ) - pSalBitmap->ImplCreateFromDrawable( GetDrawable(), m_nScreen, nBitCount, nX, nY, nDX, nDY ); + pSalBitmap->ImplCreateFromDrawable( GetDrawable(), m_nXScreen, nBitCount, nX, nY, nDX, nDY ); else pSalBitmap->Create( Size( nDX, nDY ), (nBitCount > 8) ? 24 : nBitCount, BitmapPalette( nBitCount > 8 ? nBitCount : 0 ) ); @@ -1123,7 +1123,7 @@ bool X11SalGraphics::supportsOperation( OutDevSupportType eType ) const { XRenderPeer& rPeer = XRenderPeer::GetInstance(); const SalDisplay* pSalDisp = GetDisplay(); - const SalVisual& rSalVis = pSalDisp->GetVisual( m_nScreen ); + const SalVisual& rSalVis = pSalDisp->GetVisual( m_nXScreen ); Visual* pDstXVisual = rSalVis.GetVisual(); XRenderPictFormat* pDstVisFmt = rPeer.FindVisualFormat( pDstXVisual ); diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index d492df229f52..e27cb43bf998 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -326,8 +326,10 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) if (pVisualFormat) { - surface = cairo_xlib_surface_create_with_xrender_format (pDisplay, hDrawable_, - ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16); + surface = cairo_xlib_surface_create_with_xrender_format ( + pDisplay, hDrawable_, + ScreenOfDisplay(pDisplay, m_nXScreen.getXScreen()), + pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16); } else { diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index 757e11d1405e..0bf64dfdbc97 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -68,7 +68,8 @@ SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics, } nDX = (long)w; nDY = (long)h; - if( !pVDev->Init( GetGenericData()->GetSalDisplay(), nDX, nDY, nBitCount, nScreen, pData->hDrawable, + if( !pVDev->Init( GetGenericData()->GetSalDisplay(), nDX, nDY, nBitCount, + SalX11Screen( nScreen ), pData->hDrawable, static_cast< XRenderPictFormat* >( pData->pXRenderFormat )) ) { delete pVDev; @@ -77,7 +78,7 @@ SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics, } else if( !pVDev->Init( GetGenericData()->GetSalDisplay(), nDX, nDY, nBitCount, pGraphics ? static_cast<X11SalGraphics*>(pGraphics)->GetScreenNumber() : - GetGenericData()->GetSalDisplay()->GetDefaultScreenNumber() ) ) + GetGenericData()->GetSalDisplay()->GetDefaultXScreen() ) ) { delete pVDev; return NULL; @@ -94,14 +95,15 @@ void X11SalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice ) // -=-= SalGraphicsData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, bool bDeleteColormap ) +void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, + bool bDeleteColormap ) { SalColormap *pOrigDeleteColormap = m_pDeleteColormap; SalDisplay *pDisplay = pDevice->GetDisplay(); - m_nScreen = pDevice->GetScreenNumber(); + m_nXScreen = pDevice->GetXScreenNumber(); - int nVisualDepth = pDisplay->GetColormap( m_nScreen ).GetVisual().GetDepth(); + int nVisualDepth = pDisplay->GetColormap( m_nXScreen ).GetVisual().GetDepth(); int nDeviceDepth = pDevice->GetDepth(); if( pColormap ) @@ -112,7 +114,7 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, } else if( nDeviceDepth == nVisualDepth ) - m_pColormap = &pDisplay->GetColormap( m_nScreen ); + m_pColormap = &pDisplay->GetColormap( m_nXScreen ); else if( nDeviceDepth == 1 ) m_pColormap = m_pDeleteColormap = new SalColormap(); @@ -121,7 +123,7 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, delete pOrigDeleteColormap; const Drawable aVdevDrawable = pDevice->GetDrawable(); - SetDrawable( aVdevDrawable, m_nScreen ); + SetDrawable( aVdevDrawable, m_nXScreen ); m_pVDev = pDevice; m_pFrame = NULL; @@ -133,27 +135,27 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, // -=-= SalVirDevData / SalVirtualDevice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay, - long nDX, long nDY, - sal_uInt16 nBitCount, - int nScreen, - Pixmap hDrawable, - XRenderPictFormat* pXRenderFormat ) + long nDX, long nDY, + sal_uInt16 nBitCount, + SalX11Screen nXScreen, + Pixmap hDrawable, + XRenderPictFormat* pXRenderFormat ) { SalColormap* pColormap = NULL; bool bDeleteColormap = false; pDisplay_ = pDisplay; pGraphics_ = new X11SalGraphics(); - m_nScreen = nScreen; + m_nXScreen = nXScreen; if( pXRenderFormat ) { pGraphics_->SetXRenderFormat( pXRenderFormat ); if( pXRenderFormat->colormap ) - pColormap = new SalColormap( pDisplay, pXRenderFormat->colormap, m_nScreen ); + pColormap = new SalColormap( pDisplay, pXRenderFormat->colormap, m_nXScreen ); else pColormap = new SalColormap( nBitCount ); bDeleteColormap = true; } - else if( nBitCount != pDisplay->GetVisual( m_nScreen ).GetDepth() ) + else if( nBitCount != pDisplay->GetVisual( m_nXScreen ).GetDepth() ) { pColormap = new SalColormap( nBitCount ); bDeleteColormap = true; @@ -165,7 +167,7 @@ sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay, if( hDrawable == None ) hDrawable_ = XCreatePixmap( GetXDisplay(), - pDisplay_->GetDrawable( m_nScreen ), + pDisplay_->GetDrawable( m_nXScreen ), nDX_, nDY_, GetDepth() ); else @@ -180,7 +182,8 @@ sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay, } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalVirtualDevice::X11SalVirtualDevice() +X11SalVirtualDevice::X11SalVirtualDevice() : + m_nXScreen( 0 ) { pDisplay_ = (SalDisplay*)ILLEGAL_POINTER; pGraphics_ = NULL; @@ -236,7 +239,7 @@ sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY ) if( !nDY ) nDY = 1; Pixmap h = XCreatePixmap( GetXDisplay(), - pDisplay_->GetDrawable( m_nScreen ), + pDisplay_->GetDrawable( m_nXScreen ), nDX, nDY, nDepth_ ); if( !h ) @@ -244,7 +247,7 @@ sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY ) if( !GetDrawable() ) { hDrawable_ = XCreatePixmap( GetXDisplay(), - pDisplay_->GetDrawable( m_nScreen ), + pDisplay_->GetDrawable( m_nXScreen ), 1, 1, nDepth_ ); nDX_ = 1; nDY_ = 1; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 20b8b06641f7..f075d99cc7c4 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -210,14 +210,14 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) +void X11SalFrame::Init( sal_uLong nSalFrameStyle, SalX11Screen nXScreen, SystemParentData* pParentData, bool bUseGeometry ) { - if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) - nScreen = GetDisplay()->GetDefaultScreenNumber(); + if( nXScreen.getXScreen() >= GetDisplay()->GetXScreenCount() ) + nXScreen = GetDisplay()->GetDefaultXScreen(); if( mpParent ) - nScreen = mpParent->m_nScreen; + nXScreen = mpParent->m_nXScreen; - m_nScreen = nScreen; + m_nXScreen = nXScreen; nStyle_ = nSalFrameStyle; XWMHints Hints; Hints.flags = InputHint; @@ -235,12 +235,12 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* ; Attributes.border_pixel = 0; Attributes.background_pixmap = None; - Attributes.colormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap(); + Attributes.colormap = GetDisplay()->GetColormap( m_nXScreen ).GetXColormap(); Attributes.override_redirect = False; Attributes.event_mask = CLIENT_EVENTS; - const SalVisual& rVis = GetDisplay()->GetVisual( m_nScreen ); - XLIB_Window aFrameParent = pParentData ? pParentData->aWindow : GetDisplay()->GetRootWindow( m_nScreen ); + const SalVisual& rVis = GetDisplay()->GetVisual( m_nXScreen ); + XLIB_Window aFrameParent = pParentData ? pParentData->aWindow : GetDisplay()->GetRootWindow( m_nXScreen ); XLIB_Window aClientLeader = None; if( bUseGeometry ) @@ -334,7 +334,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* { if( ! bUseGeometry ) { - Size aScreenSize( GetDisplay()->getDataForScreen( m_nScreen ).m_aSize ); + Size aScreenSize( GetDisplay()->getDataForScreen( m_nXScreen ).m_aSize ); w = aScreenSize.Width(); h = aScreenSize.Height(); if( nSalFrameStyle & SAL_FRAME_STYLE_SIZEABLE && @@ -402,7 +402,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* int root_x = 0, root_y = 0, lx, ly; unsigned int mask; XQueryPointer( GetXDisplay(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), &aRoot, &aChild, &root_x, &root_y, &lx, &ly, &mask ); const std::vector< Rectangle >& rScreens = GetDisplay()->GetXineramaScreens(); @@ -431,7 +431,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* bool bOk=false; try { - bOk=SelectAppIconPixmap( pDisplay_, m_nScreen, + bOk=SelectAppIconPixmap( pDisplay_, m_nXScreen, mnIconID != 1 ? mnIconID : (mpParent ? mpParent->mnIconID : 1), 32, Hints.icon_pixmap, Hints.icon_mask ); @@ -480,7 +480,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* // note: for a normal document window this will produce None // as the window is not yet created and the shell window is // initialized to None. This must be corrected after window creation. - aClientLeader = GetDisplay()->GetDrawable( m_nScreen ); + aClientLeader = GetDisplay()->GetDrawable( m_nXScreen ); } } @@ -648,7 +648,9 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent ) +X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, + SystemParentData* pSystemParent ) : + m_nXScreen( 0 ) { SalGenericData *pData = GetGenericData(); @@ -724,7 +726,7 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemPar if( mpParent ) mpParent->maChildren.push_back( this ); - Init( nSalFrameStyle, GetDisplay()->GetDefaultScreenNumber(), pSystemParent ); + Init( nSalFrameStyle, GetDisplay()->GetDefaultXScreen(), pSystemParent ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -874,7 +876,7 @@ void X11SalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) GetWindow(), aSize.Width(), aSize.Height(), - GetDisplay()->GetVisual( m_nScreen ).GetDepth() ); + GetDisplay()->GetVisual( m_nXScreen ).GetDepth() ); if( mhBackgroundPixmap ) { SalTwoRect aTwoRect; @@ -882,9 +884,9 @@ void X11SalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = aSize.Width(); aTwoRect.mnSrcHeight = aTwoRect.mnDestHeight = aSize.Height(); pBM->ImplDraw( mhBackgroundPixmap, - m_nScreen, - GetDisplay()->GetVisual( m_nScreen ).GetDepth(), - aTwoRect, GetDisplay()->GetCopyGC( m_nScreen ) ); + m_nXScreen, + GetDisplay()->GetVisual( m_nXScreen ).GetDepth(), + aTwoRect, GetDisplay()->GetCopyGC( m_nXScreen ) ); XSetWindowBackgroundPixmap( GetXDisplay(), GetWindow(), mhBackgroundPixmap ); } } @@ -901,10 +903,10 @@ const SystemChildData* X11SalFrame::GetSystemData() const pFrame->maSystemChildData.aWindow = pFrame->GetWindow(); pFrame->maSystemChildData.pSalFrame = pFrame; pFrame->maSystemChildData.pWidget = NULL; - pFrame->maSystemChildData.pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual(); - pFrame->maSystemChildData.nScreen = m_nScreen; - pFrame->maSystemChildData.nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth(); - pFrame->maSystemChildData.aColormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap(); + pFrame->maSystemChildData.pVisual = GetDisplay()->GetVisual( m_nXScreen ).GetVisual(); + pFrame->maSystemChildData.nScreen = m_nXScreen.getXScreen(); + pFrame->maSystemChildData.nDepth = GetDisplay()->GetVisual( m_nXScreen ).GetDepth(); + pFrame->maSystemChildData.aColormap = GetDisplay()->GetColormap( m_nXScreen ).GetXColormap(); pFrame->maSystemChildData.pAppContext = NULL; pFrame->maSystemChildData.aShellWindow = pFrame->GetShellWindow(); pFrame->maSystemChildData.pShellWidget = NULL; @@ -924,7 +926,7 @@ SalGraphics *X11SalFrame::GetGraphics() else { pGraphics_ = new X11SalGraphics(); - pGraphics_->Init( this, GetWindow(), m_nScreen ); + pGraphics_->Init( this, GetWindow(), m_nXScreen ); } return pGraphics_; @@ -945,9 +947,9 @@ void X11SalFrame::updateGraphics( bool bClear ) { Drawable aDrawable = bClear ? None : GetWindow(); if( pGraphics_ ) - pGraphics_->SetDrawable( aDrawable, m_nScreen ); + pGraphics_->SetDrawable( aDrawable, m_nXScreen ); if( pFreeGraphics_ ) - pFreeGraphics_->SetDrawable( aDrawable, m_nScreen ); + pFreeGraphics_->SetDrawable( aDrawable, m_nXScreen ); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -972,7 +974,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) XIconSize *pIconSize = NULL; int nSizes = 0; int iconSize = 32; - if ( XGetIconSizes( GetXDisplay(), GetDisplay()->GetRootWindow( m_nScreen ), &pIconSize, &nSizes ) ) + if ( XGetIconSizes( GetXDisplay(), GetDisplay()->GetRootWindow( m_nXScreen ), &pIconSize, &nSizes ) ) { #if OSL_DEBUG_LEVEL > 1 fprintf(stderr, "X11SalFrame::SetIcon(): found %d IconSizes:\n", nSizes); @@ -1020,7 +1022,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) bGnomeChecked=true; int nCount = 0; Atom* pProps = XListProperties( GetXDisplay(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), &nCount ); for( int i = 0; i < nCount && !bGnomeIconSize; i++ ) { @@ -1047,13 +1049,13 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon ) } pHints = &Hints; - sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, + sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nXScreen, nIcon, iconSize, pHints->icon_pixmap, pHints->icon_mask ); if ( !bOk ) { // load default icon (0) - bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, + bOk = SelectAppIconPixmap( GetDisplay(), m_nXScreen, 0, iconSize, pHints->icon_pixmap, pHints->icon_mask ); } @@ -1325,7 +1327,7 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) */ if( mpParent && ! (nStyle_ & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) XDeleteProperty( GetXDisplay(), GetShellWindow(), GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::WM_TRANSIENT_FOR ) ); - XWithdrawWindow( GetXDisplay(), GetShellWindow(), m_nScreen ); + XWithdrawWindow( GetXDisplay(), GetShellWindow(), m_nXScreen.getXScreen() ); } else if( ! m_bXEmbed ) XUnmapWindow( GetXDisplay(), GetWindow() ); @@ -1414,7 +1416,7 @@ void X11SalFrame::Center( ) int nRealScreenWidth, nRealScreenHeight; int nScreenX = 0, nScreenY = 0; - const Size& aScreenSize = GetDisplay()->getDataForScreen( m_nScreen ).m_aSize; + const Size& aScreenSize = GetDisplay()->getDataForScreen( m_nXScreen ).m_aSize; nScreenWidth = aScreenSize.Width(); nScreenHeight = aScreenSize.Height(); nRealScreenWidth = nScreenWidth; @@ -1535,13 +1537,13 @@ void X11SalFrame::updateScreenNumber() { if( rScreenRects[i].IsInside( aPoint ) ) { - maGeometry.nScreenNumber = static_cast<unsigned int>(i); + maGeometry.nDisplayScreenNumber = static_cast<unsigned int>(i); break; } } } else - maGeometry.nScreenNumber = static_cast<unsigned int>(m_nScreen); + maGeometry.nDisplayScreenNumber = m_nXScreen.getXScreen(); } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -1684,7 +1686,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState ) bDoAdjust = true; } - const Size& aScreenSize = pDisplay_->getDataForScreen( m_nScreen ).m_aSize; + const Size& aScreenSize = pDisplay_->getDataForScreen( m_nXScreen ).m_aSize; if( bDoAdjust && aPosSize.GetWidth() <= aScreenSize.Width() && aPosSize.GetHeight() <= aScreenSize.Height() ) @@ -1867,7 +1869,7 @@ void X11SalFrame::GetPosSize( Rectangle &rPosSize ) { if( maGeometry.nWidth < 1 || maGeometry.nHeight < 1 ) { - const Size& aScreenSize = pDisplay_->getDataForScreen( m_nScreen ).m_aSize; + const Size& aScreenSize = pDisplay_->getDataForScreen( m_nXScreen ).m_aSize; long w = aScreenSize.Width() - maGeometry.nLeftDecoration - maGeometry.nRightDecoration; long h = aScreenSize.Height() - maGeometry.nTopDecoration - maGeometry.nBottomDecoration; @@ -1947,7 +1949,7 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize ) // coordinates are relative to parent, so translate to root coordinates XTranslateCoordinates( GetDisplay()->GetDisplay(), mpParent->GetWindow(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), values.x, values.y, &values.x, &values.y, & aChild ); @@ -2061,7 +2063,7 @@ void X11SalFrame::Minimize() if( XIconifyWindow( GetXDisplay(), GetShellWindow(), - pDisplay_->GetDefaultScreenNumber() ) ) + pDisplay_->GetDefaultXScreen().getXScreen() ) ) nShowState_ = SHOWSTATE_MINIMIZED; } @@ -2107,7 +2109,7 @@ void X11SalFrame::Restore() void X11SalFrame::SetScreenNumber( unsigned int nNewScreen ) { - if( nNewScreen == maGeometry.nScreenNumber ) + if( nNewScreen == maGeometry.nDisplayScreenNumber ) return; if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 ) @@ -2115,27 +2117,27 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen ) if( nNewScreen >= GetDisplay()->GetXineramaScreens().size() ) return; - Rectangle aOldScreenRect( GetDisplay()->GetXineramaScreens()[maGeometry.nScreenNumber] ); + Rectangle aOldScreenRect( GetDisplay()->GetXineramaScreens()[maGeometry.nDisplayScreenNumber] ); Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] ); bool bVisible = bMapped_; if( bVisible ) Show( sal_False ); maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left()); maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top()); - createNewWindow( None, m_nScreen ); + createNewWindow( None, m_nXScreen ); if( bVisible ) Show( sal_True ); - maGeometry.nScreenNumber = nNewScreen; + maGeometry.nDisplayScreenNumber = nNewScreen; } - else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() ) + else if( sal_Int32(nNewScreen) < GetDisplay()->GetXScreenCount() ) { bool bVisible = bMapped_; if( bVisible ) Show( sal_False ); - createNewWindow( None, nNewScreen ); + createNewWindow( None, SalX11Screen( nNewScreen ) ); if( bVisible ) Show( sal_True ); - maGeometry.nScreenNumber = nNewScreen; + maGeometry.nDisplayScreenNumber = nNewScreen; } } @@ -2181,7 +2183,7 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) Size( maGeometry.nWidth, maGeometry.nHeight ) ); Rectangle aRect; if( nScreen < 0 || nScreen >= static_cast<int>(GetDisplay()->GetXineramaScreens().size()) ) - aRect = Rectangle( Point(0,0), GetDisplay()->GetScreenSize( m_nScreen ) ); + aRect = Rectangle( Point(0,0), GetDisplay()->GetScreenSize( m_nXScreen ) ); else aRect = GetDisplay()->GetXineramaScreens()[nScreen]; nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; @@ -2194,7 +2196,7 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) maGeometry.nHeight = aRect.GetHeight(); mbMaximizedHorz = mbMaximizedVert = false; mbFullScreen = true; - createNewWindow( None, m_nScreen ); + createNewWindow( None, m_nXScreen ); if( GetDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) GetDisplay()->getWMAdaptor()->enableAlwaysOnTop( this, true ); else @@ -2212,7 +2214,7 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) maRestorePosSize = Rectangle(); if( bVisible ) Show( sal_False ); - createNewWindow( None, m_nScreen ); + createNewWindow( None, m_nXScreen ); if( !aRect.IsEmpty() ) SetPosSize( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | @@ -2223,16 +2225,16 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) } else { - if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) - nScreen = m_nScreen; - if( nScreen != m_nScreen ) + if( nScreen < 0 || nScreen >= (int)GetDisplay()->GetXScreenCount() ) + nScreen = m_nXScreen.getXScreen(); + if( nScreen != (int)m_nXScreen.getXScreen() ) { bool bVisible = bMapped_; if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, false ); if( bVisible ) Show( sal_False ); - createNewWindow( None, nScreen ); + createNewWindow( None, SalX11Screen( nScreen ) ); if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, true ); if( bVisible ) @@ -2243,7 +2245,7 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, bFullScreen ); if( IsOverrideRedirect() - && WMSupportsFWS( GetXDisplay(), GetDisplay()->GetRootWindow( m_nScreen ) ) ) + && WMSupportsFWS( GetXDisplay(), GetDisplay()->GetRootWindow( m_nXScreen ) ) ) { AddFwsProtocols( GetXDisplay(), GetShellWindow() ); RegisterFwsWindow( GetXDisplay(), GetShellWindow() ); @@ -2453,7 +2455,7 @@ void X11SalFrame::SetPointerPos(long nX, long nY) unsigned int nWindowLeft = maGeometry.nX + nX; unsigned int nWindowTop = maGeometry.nY + nY; - XWarpPointer( GetXDisplay(), None, pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() ), + XWarpPointer( GetXDisplay(), None, pDisplay_->GetRootWindow( pDisplay_->GetDefaultXScreen() ), 0, 0, 0, 0, nWindowLeft, nWindowTop); } @@ -2625,8 +2627,8 @@ void X11SalFrame::SetParent( SalFrame* pNewParent ) mpParent = static_cast<X11SalFrame*>(pNewParent); mpParent->maChildren.push_back( this ); - if( mpParent->m_nScreen != m_nScreen ) - createNewWindow( None, mpParent->m_nScreen ); + if( mpParent->m_nXScreen != m_nXScreen ) + createNewWindow( None, mpParent->m_nXScreen ); GetDisplay()->getWMAdaptor()->changeReferenceFrame( this, mpParent ); } } @@ -2636,21 +2638,21 @@ SalFrame* X11SalFrame::GetParent() const return mpParent; } -void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) +void X11SalFrame::createNewWindow( XLIB_Window aNewParent, SalX11Screen nXScreen ) { bool bWasVisible = bMapped_; if( bWasVisible ) Show( sal_False ); - if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) - nScreen = m_nScreen; + if( nXScreen.getXScreen() >= GetDisplay()->GetXScreenCount() ) + nXScreen = m_nXScreen; SystemParentData aParentData; aParentData.aWindow = aNewParent; aParentData.bXEmbedSupport = (aNewParent != None && m_bXEmbed); // caution: this is guesswork if( aNewParent == None ) { - aNewParent = GetDisplay()->GetRootWindow(nScreen); + aNewParent = GetDisplay()->GetRootWindow(nXScreen); aParentData.aWindow = None; m_bXEmbed = false; } @@ -2658,12 +2660,12 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) { // is new parent a root window ? Display* pDisp = GetDisplay()->GetDisplay(); - int nScreens = GetDisplay()->GetScreenCount(); + int nScreens = GetDisplay()->GetXScreenCount(); for( int i = 0; i < nScreens; i++ ) { if( aNewParent == RootWindow( pDisp, i ) ) { - nScreen = i; + nXScreen = SalX11Screen( i ); aParentData.aWindow = None; m_bXEmbed = false; break; @@ -2690,9 +2692,9 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) // now init with new parent again if ( aParentData.aWindow != None ) - Init( nStyle_ | SAL_FRAME_STYLE_PLUG, nScreen, &aParentData ); + Init( nStyle_ | SAL_FRAME_STYLE_PLUG, nXScreen, &aParentData ); else - Init( nStyle_ & ~SAL_FRAME_STYLE_PLUG, nScreen, NULL, true ); + Init( nStyle_ & ~SAL_FRAME_STYLE_PLUG, nXScreen, NULL, true ); // update graphics if necessary updateGraphics(false); @@ -2702,7 +2704,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) if( mpParent ) { - if( mpParent->m_nScreen != m_nScreen ) + if( mpParent->m_nXScreen != m_nXScreen ) SetParent( NULL ); else pDisplay_->getWMAdaptor()->changeReferenceFrame( this, mpParent ); @@ -2713,7 +2715,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) std::list< X11SalFrame* > aChildren = maChildren; for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) - (*it)->createNewWindow( None, m_nScreen ); + (*it)->createNewWindow( None, m_nXScreen ); // FIXME: SalObjects } @@ -2946,7 +2948,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) int root_x, root_y, win_x, win_y; unsigned int mask_return; if( XQueryPointer( GetXDisplay(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), &aRoot, &aChild, &root_x, &root_y, &win_x, &win_y, @@ -3640,7 +3642,7 @@ void X11SalFrame::RestackChildren() XLIB_Window aRoot, aParent, *pChildren = NULL; unsigned int nChildren; if( XQueryTree( GetXDisplay(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), &aRoot, &aParent, &pChildren, @@ -3710,7 +3712,7 @@ long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent ) XLIB_Window hDummy; XTranslateCoordinates( GetXDisplay(), GetWindow(), - pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() ), + pDisplay_->GetRootWindow( pDisplay_->GetDefaultXScreen() ), 0, 0, &pEvent->x, &pEvent->y, &hDummy ); @@ -3840,9 +3842,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) XSelectInput( pDisplay, GetStackingWindow(), StructureNotifyMask ); } - if( hWM_Parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() ) + if( hWM_Parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultXScreen() ) || hWM_Parent == GetForeignParent() - || pEvent->parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() ) + || pEvent->parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultXScreen() ) || ( nStyle_ & SAL_FRAME_STYLE_FLOAT ) ) { // Reparenting before Destroy @@ -3863,14 +3865,14 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) if( hPresentationWindow != None && hPresentationWindow != GetWindow() && GetStackingWindow() != None - && GetStackingWindow() != GetDisplay()->GetRootWindow( m_nScreen ) + && GetStackingWindow() != GetDisplay()->GetRootWindow( m_nXScreen ) ) { int x = 0, y = 0; XLIB_Window aChild; XTranslateCoordinates( GetXDisplay(), GetStackingWindow(), - GetDisplay()->GetRootWindow( m_nScreen ), + GetDisplay()->GetRootWindow( m_nXScreen ), 0, 0, &x, &y, &aChild @@ -3939,7 +3941,7 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) // #i81311# do this only for sizable frames if( (nStyle_ & SAL_FRAME_STYLE_SIZEABLE) != 0 ) { - Size aScreenSize = GetDisplay()->GetScreenSize( m_nScreen ); + Size aScreenSize = GetDisplay()->GetScreenSize( m_nXScreen ); int nScreenWidth = aScreenSize.Width(); int nScreenHeight = aScreenSize.Height(); int nFrameWidth = maGeometry.nWidth + maGeometry.nLeftDecoration + maGeometry.nRightDecoration; diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx index 3e576604623b..db344ed528e8 100644 --- a/vcl/unx/generic/window/salobj.cxx +++ b/vcl/unx/generic/window/salobj.cxx @@ -81,10 +81,10 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p // find out on which screen that window is XWindowAttributes aParentAttr; XGetWindowAttributes( pDisp, aObjectParent, &aParentAttr ); - int nScreen = XScreenNumberOfScreen( aParentAttr.screen ); + SalX11Screen nXScreen( XScreenNumberOfScreen( aParentAttr.screen ) ); Visual* pVisual = (pWindowData && pWindowData->pVisual) ? (Visual*)pWindowData->pVisual : - pSalDisp->GetVisual( nScreen ).GetVisual(); + pSalDisp->GetVisual( nXScreen ).GetVisual(); // get visual info VisualID aVisID = XVisualIDFromVisual( pVisual ); XVisualInfo aTemplate; @@ -111,25 +111,25 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p aObjectParent, 0, 0, 1, 1, 0, - pSalDisp->GetColormap( nScreen ).GetBlackPixel(), - pSalDisp->GetColormap( nScreen ).GetWhitePixel() + pSalDisp->GetColormap( nXScreen ).GetBlackPixel(), + pSalDisp->GetColormap( nXScreen ).GetWhitePixel() ); - if( aVisID == pSalDisp->GetVisual( nScreen ).GetVisualId() ) + if( aVisID == pSalDisp->GetVisual( nXScreen ).GetVisualId() ) { pObject->maSecondary = XCreateSimpleWindow( pDisp, pObject->maPrimary, 0, 0, 1, 1, 0, - pSalDisp->GetColormap( nScreen ).GetBlackPixel(), - pSalDisp->GetColormap( nScreen ).GetWhitePixel() + pSalDisp->GetColormap( nXScreen ).GetBlackPixel(), + pSalDisp->GetColormap( nXScreen ).GetWhitePixel() ); } else { #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "visual id of vcl %x, of visual %x\n", - static_cast<unsigned int> (pSalDisp->GetVisual( nScreen ).GetVisualId()), + static_cast<unsigned int> (pSalDisp->GetVisual( nXScreen ).GetVisualId()), static_cast<unsigned int> (aVisID) ); #endif GetGenericData()->ErrorTrapPush(); @@ -137,13 +137,13 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p // create colormap for visual - there might not be one pObject->maColormap = aAttribs.colormap = XCreateColormap( pDisp, - pSalDisp->GetRootWindow( nScreen ), + pSalDisp->GetRootWindow( nXScreen ), pVisual, AllocNone ); pObject->maSecondary = XCreateWindow( pDisp, - pSalDisp->GetRootWindow( nScreen ), + pSalDisp->GetRootWindow( nXScreen ), 0, 0, 1, 1, 0, nDepth, InputOutput, @@ -170,8 +170,8 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p pObjData->pWidget = NULL; pObjData->pVisual = pVisual; pObjData->nDepth = nDepth; - pObjData->aColormap = aVisID == pSalDisp->GetVisual( nScreen ).GetVisualId() ? - pSalDisp->GetColormap( nScreen ).GetXColormap() : None; + pObjData->aColormap = aVisID == pSalDisp->GetVisual( nXScreen ).GetVisualId() ? + pSalDisp->GetColormap( nXScreen ).GetXColormap() : None; pObjData->pAppContext = NULL; XSync(pDisp, False); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 66e6b4ae1b19..3685d1156110 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -218,49 +218,41 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen ) emitDisplayChanged(); } -void GtkSalDisplay::initScreen( int nScreen ) const +#if !GTK_CHECK_VERSION(3,0,0) +SalDisplay::ScreenData * +GtkSalDisplay::initScreen( SalX11Screen nXScreen ) const { -#if GTK_CHECK_VERSION(3,0,0) - // No implementation needed for gt3k: no colormaps handling - // or need to init screens ... - (void)nScreen; -#else - if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) ) - nScreen = m_nDefaultScreen; - ScreenData& rSD = const_cast<ScreenData&>(m_aScreens[nScreen]); - if( rSD.m_bInit ) - return; - // choose visual for screen - SalDisplay::initScreen( nScreen ); + ScreenData *pSD; + if (!(pSD = SalDisplay::initScreen( nXScreen ))) + return NULL; // now set a gdk default colormap matching the chosen visual to the screen - GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, nScreen ); + GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, nXScreen.getXScreen() ); // should really use this: -// GdkVisual* pVis = gdk_x11_screen_lookup_visual_get( screen, rSD.m_aVisual.visualid ); +// GdkVisual* pVis = gdk_x11_screen_lookup_visual_get( screen, pSD->m_aVisual.visualid ); // and not this: - GdkVisual* pVis = gdkx_visual_get( rSD.m_aVisual.visualid ); + GdkVisual* pVis = gdkx_visual_get( pSD->m_aVisual.visualid ); if( pVis ) { GdkColormap* pDefCol = gdk_screen_get_default_colormap( pScreen ); GdkVisual* pDefVis = gdk_colormap_get_visual( pDefCol ); if( pDefVis != pVis ) { - pDefCol = gdk_x11_colormap_foreign_new( pVis, rSD.m_aColormap.GetXColormap() ); + pDefCol = gdk_x11_colormap_foreign_new( pVis, pSD->m_aColormap.GetXColormap() ); gdk_screen_set_default_colormap( pScreen, pDefCol ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "set new gdk color map for screen %d\n", nScreen ); + fprintf( stderr, "set new gdk color map for screen %d\n", nXScreen.getXScreen() ); #endif } } #if OSL_DEBUG_LEVEL > 1 else - fprintf( stderr, "not GdkVisual for visual id %d\n", (int)rSD.m_aVisual.visualid ); + fprintf( stderr, "not GdkVisual for visual id %d\n", (int)pSD->m_aVisual.visualid ); #endif -#endif + return pSD; } -#if !GTK_CHECK_VERSION(3,0,0) long GtkSalDisplay::Dispatch( XEvent* pEvent ) { if( GetDisplay() == pEvent->xany.display ) diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index 9ce1671d28f5..6690d5f0b70e 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -56,6 +56,34 @@ GtkSalSystem::~GtkSalSystem() { } +int +GtkSalSystem::GetDisplayXScreenCount() +{ + return gdk_display_get_n_screens (mpDisplay); +} + +// Including gdkx.h kills us with the Window / XWindow conflict +extern "C" { + GType gdk_x11_display_get_type (void); + int gdk_x11_screen_get_screen_number (GdkScreen *screen); +} + +SalX11Screen +GtkSalSystem::getXScreenFromDisplayScreen(unsigned int nScreen) +{ + gint nMonitor; + GdkScreen *pScreen = NULL; + + pScreen = getScreenMonitorFromIdx (mpDisplay, nScreen, nMonitor); + if (!pScreen) + return SalX11Screen (0); +#if GTK_CHECK_VERSION(3,0,0) + if (!G_TYPE_CHECK_INSTANCE_TYPE (mpDisplay, gdk_x11_display_get_type ())) + return SalX11Screen (0); +#endif + return SalX11Screen (gdk_x11_screen_get_screen_number (pScreen)); +} + GdkScreen * GtkSalSystem::getScreenMonitorFromIdx (GdkDisplay *pDisplay, int nIdx, gint &nMonitor) { diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index d064f8328d43..686c7846f85e 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -60,7 +60,8 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) m_aClipRegion( REGION_NULL ) { Init( pFrame, GDK_WINDOW_XID( widget_get_window( pWindow ) ), - gdk_x11_screen_get_screen_number( gtk_widget_get_screen( pWindow ) ) ); + SalX11Screen( gdk_x11_screen_get_screen_number( + gtk_widget_get_screen( pWindow ) ) ) ); } GtkSalGraphics::~GtkSalGraphics() @@ -159,7 +160,14 @@ struct NWFWidgetData // easily and quickly reset each to a default state before using // them static boost::unordered_map<long, guint> gWidgetDefaultFlags; -static std::vector<NWFWidgetData> gWidgetData; +class WidgetDataVector : public std::vector<NWFWidgetData> +{ +public: + WidgetDataVector(size_t nElems = 0) : std::vector<NWFWidgetData>( nElems ) {} + NWFWidgetData &operator [](size_t i) { return at(i); } + NWFWidgetData &operator [](const SalX11Screen &s) { return at(s.getXScreen()); } +}; +static WidgetDataVector gWidgetData; static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 }; @@ -169,27 +177,27 @@ static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 }; #define MIN_SPIN_ARROW_WIDTH 6 -static void NWEnsureGTKRadio ( int nScreen ); -static void NWEnsureGTKButton ( int nScreen ); -static void NWEnsureGTKCheck ( int nScreen ); -static void NWEnsureGTKScrollbars ( int nScreen ); -static void NWEnsureGTKArrow ( int nScreen ); -static void NWEnsureGTKEditBox ( int nScreen ); -static void NWEnsureGTKSpinButton ( int nScreen ); -static void NWEnsureGTKNotebook ( int nScreen ); -static void NWEnsureGTKOptionMenu ( int nScreen ); -static void NWEnsureGTKCombo ( int nScreen ); -static void NWEnsureGTKScrolledWindow ( int nScreen ); -static void NWEnsureGTKToolbar ( int nScreen ); -static void NWEnsureGTKMenubar ( int nScreen ); -static void NWEnsureGTKMenu ( int nScreen ); -static void NWEnsureGTKTooltip ( int nScreen ); -static void NWEnsureGTKProgressBar ( int nScreen ); -static void NWEnsureGTKTreeView ( int nScreen ); -static void NWEnsureGTKSlider ( int nScreen ); +static void NWEnsureGTKRadio ( SalX11Screen nScreen ); +static void NWEnsureGTKButton ( SalX11Screen nScreen ); +static void NWEnsureGTKCheck ( SalX11Screen nScreen ); +static void NWEnsureGTKScrollbars ( SalX11Screen nScreen ); +static void NWEnsureGTKArrow ( SalX11Screen nScreen ); +static void NWEnsureGTKEditBox ( SalX11Screen nScreen ); +static void NWEnsureGTKSpinButton ( SalX11Screen nScreen ); +static void NWEnsureGTKNotebook ( SalX11Screen nScreen ); +static void NWEnsureGTKOptionMenu ( SalX11Screen nScreen ); +static void NWEnsureGTKCombo ( SalX11Screen nScreen ); +static void NWEnsureGTKScrolledWindow ( SalX11Screen nScreen ); +static void NWEnsureGTKToolbar ( SalX11Screen nScreen ); +static void NWEnsureGTKMenubar ( SalX11Screen nScreen ); +static void NWEnsureGTKMenu ( SalX11Screen nScreen ); +static void NWEnsureGTKTooltip ( SalX11Screen nScreen ); +static void NWEnsureGTKProgressBar ( SalX11Screen nScreen ); +static void NWEnsureGTKTreeView ( SalX11Screen nScreen ); +static void NWEnsureGTKSlider ( SalX11Screen nScreen ); static void NWConvertVCLStateToGTKState( ControlState nVCLState, GtkStateType* nGTKState, GtkShadowType* nGTKShadow ); -static void NWAddWidgetToCacheWindow( GtkWidget* widget, int nScreen ); +static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen ); static void NWSetWidgetState( GtkWidget* widget, ControlState nState, GtkStateType nGtkState ); static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ); @@ -200,37 +208,37 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ); */ //--- -static Rectangle NWGetButtonArea( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetButtonArea( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); //--- -static Rectangle NWGetEditBoxPixmapRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetEditBoxPixmapRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); -static void NWPaintOneEditBox( int nScreen, GdkDrawable * gdkDrawable, GdkRectangle *gdkRect, +static void NWPaintOneEditBox( SalX11Screen nScreen, GdkDrawable * gdkDrawable, GdkRectangle *gdkRect, ControlType nType, ControlPart nPart, Rectangle aEditBoxRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); //--- -static Rectangle NWGetSpinButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetSpinButtonRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); -static void NWPaintOneSpinButton( int nScreen, GdkPixmap * pixmap, ControlType nType, ControlPart nPart, Rectangle aAreaRect, +static void NWPaintOneSpinButton( SalX11Screen nScreen, GdkPixmap * pixmap, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); //--- -static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); //--- -static Rectangle NWGetListBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetListBoxButtonRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); -static Rectangle NWGetListBoxIndicatorRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, +static Rectangle NWGetListBoxIndicatorRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); -static Rectangle NWGetToolbarRect( int nScreen, +static Rectangle NWGetToolbarRect( SalX11Screen nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, @@ -239,7 +247,7 @@ static Rectangle NWGetToolbarRect( int nScreen, const OUString& rCaption ); //--- -static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect ); +static Rectangle NWGetScrollButtonRect( SalX11Screen nScreen, ControlPart nPart, Rectangle aAreaRect ); //--- /********************************************************* @@ -272,7 +280,7 @@ class NWPixmapCache int m_screen; NWPixmapCacheData* pData; public: - NWPixmapCache( int nScreen ); + NWPixmapCache( SalX11Screen nScreen ); ~NWPixmapCache(); void SetSize( int n) @@ -309,11 +317,11 @@ void NWPixmapCacheData::SetPixmap( GdkPixmap* pPixmap ) } -NWPixmapCache::NWPixmapCache( int nScreen ) +NWPixmapCache::NWPixmapCache( SalX11Screen nScreen ) { m_idx = 0; m_size = 0; - m_screen = nScreen; + m_screen = nScreen.getXScreen(); pData = NULL; if( gWidgetData[m_screen].gNWPixmapCacheList ) gWidgetData[m_screen].gNWPixmapCacheList->AddCache(this); @@ -421,13 +429,13 @@ void GtkData::initNWF( void ) // omit GetNativeControl while painting (see brdwin.cxx) pSVData->maNWFData.mbCanDrawWidgetAnySize = true; - int nScreens = GetGenericData()->GetSalDisplay()->GetScreenCount(); - gWidgetData = std::vector<NWFWidgetData>( nScreens ); + int nScreens = GetGtkSalData()->GetGtkDisplay()->GetXScreenCount(); + gWidgetData = WidgetDataVector( nScreens ); for( int i = 0; i < nScreens; i++ ) gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList; // small extra border around menu items - NWEnsureGTKMenu( 0 ); + NWEnsureGTKMenu( SalX11Screen( 0 ) ); gint horizontal_padding = 1; gtk_widget_style_get( gWidgetData[0].gMenuItemMenuWidget, "horizontal_padding", &horizontal_padding, @@ -437,7 +445,7 @@ void GtkData::initNWF( void ) if( SalGetDesktopEnvironment().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) ) { // #i97196# ensure a widget exists and the style engine was loaded - NWEnsureGTKButton( 0 ); + NWEnsureGTKButton( SalX11Screen( 0 ) ); if( g_type_from_name( "QtEngineStyle" ) ) { // KDE 3.3 invented a bug in the qt<->gtk theme engine @@ -632,7 +640,7 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType, ( nPart == PART_BUTTON_LEFT ) || ( nPart == PART_BUTTON_RIGHT ) ) ) { - NWEnsureGTKScrollbars( m_nScreen ); + NWEnsureGTKScrollbars( m_nXScreen ); // Grab some button style attributes gboolean has_forward; @@ -640,10 +648,12 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType, gboolean has_backward; gboolean has_backward2; - gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward, - "has-secondary-forward-stepper", &has_forward2, - "has-backward-stepper", &has_backward, - "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); + gtk_widget_style_get( gWidgetData[m_nXScreen].gScrollHorizWidget, + "has-forward-stepper", &has_forward, + "has-secondary-forward-stepper", &has_forward2, + "has-backward-stepper", &has_backward, + "has-secondary-backward-stepper", &has_backward2, + (char *)NULL ); Rectangle aForward; Rectangle aBackward; @@ -659,8 +669,8 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType, else if ( nPart == PART_BUTTON_RIGHT ) nCounterPart = PART_BUTTON_LEFT; - aBackward = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion ); - aForward = NWGetScrollButtonRect( m_nScreen, nCounterPart, rControlRegion ); + aBackward = NWGetScrollButtonRect( m_nXScreen, nPart, rControlRegion ); + aForward = NWGetScrollButtonRect( m_nXScreen, nCounterPart, rControlRegion ); if ( has_backward && has_forward2 ) { @@ -945,7 +955,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, && (rControlRegion.GetWidth() > 16) && (rControlRegion.GetHeight() > 16) ) { - rNativeBoundingRegion = NWGetButtonArea( m_nScreen, nType, nPart, rControlRegion, + rNativeBoundingRegion = NWGetButtonArea( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rControlRegion; @@ -953,7 +963,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { - rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, + rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; @@ -962,7 +972,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { - rNativeBoundingRegion = NWGetSpinButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, + rNativeBoundingRegion = NWGetSpinButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; @@ -970,7 +980,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { - rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, + rNativeBoundingRegion = NWGetListBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; @@ -984,14 +994,14 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, (nPart==PART_BUTTON) )) { - rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); + rNativeBoundingRegion = NWGetToolbarRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; returnVal = sal_True; } if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) || (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) ) { - rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion ); + rNativeBoundingRegion = NWGetScrollButtonRect( m_nXScreen, nPart, rControlRegion ); rNativeContentRegion = rNativeBoundingRegion; //See fdo#33523, possibly makes sense to do this test for all return values @@ -1003,9 +1013,9 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) ) { - NWEnsureGTKMenubar( m_nScreen ); + NWEnsureGTKMenubar( m_nXScreen ); GtkRequisition aReq; - gtk_widget_size_request( gWidgetData[m_nScreen].gMenubarWidget, &aReq ); + gtk_widget_size_request( gWidgetData[m_nXScreen].gMenubarWidget, &aReq ); Rectangle aMenuBarRect = rControlRegion; aMenuBarRect = Rectangle( aMenuBarRect.TopLeft(), Size( aMenuBarRect.GetWidth(), aReq.height+1 ) ); @@ -1018,11 +1028,11 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, if( (nPart == PART_MENU_ITEM_CHECK_MARK) || (nPart == PART_MENU_ITEM_RADIO_MARK) ) { - NWEnsureGTKMenu( m_nScreen ); + NWEnsureGTKMenu( m_nXScreen ); gint indicator_size = 0; GtkWidget* pWidget = (nPart == PART_MENU_ITEM_CHECK_MARK) ? - gWidgetData[m_nScreen].gMenuItemCheckMenuWidget : gWidgetData[m_nScreen].gMenuItemRadioMenuWidget; + gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget : gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget; gtk_widget_style_get( pWidget, "indicator_size", &indicator_size, (char *)NULL ); @@ -1035,7 +1045,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } else if( nPart == PART_MENU_SUBMENU_ARROW ) { - GtkWidget* widget = gWidgetData[m_nScreen].gMenuItemMenuWidget; + GtkWidget* widget = gWidgetData[m_nXScreen].gMenuItemMenuWidget; GtkWidget* child; PangoContext *context; PangoFontMetrics *metrics; @@ -1072,9 +1082,9 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) ) { - NWEnsureGTKRadio( m_nScreen ); - NWEnsureGTKCheck( m_nScreen ); - GtkWidget* widget = (nType == CTRL_RADIOBUTTON) ? gWidgetData[m_nScreen].gRadioWidget : gWidgetData[m_nScreen].gCheckWidget; + NWEnsureGTKRadio( m_nXScreen ); + NWEnsureGTKCheck( m_nXScreen ); + GtkWidget* widget = (nType == CTRL_RADIOBUTTON) ? gWidgetData[m_nXScreen].gRadioWidget : gWidgetData[m_nXScreen].gCheckWidget; gint indicator_size, indicator_spacing; gtk_widget_style_get( widget, "indicator_size", &indicator_size, @@ -1090,8 +1100,8 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL ) { - NWEnsureGTKEditBox( m_nScreen ); - GtkWidget* widget = gWidgetData[m_nScreen].gEditBoxWidget; + NWEnsureGTKEditBox( m_nXScreen ); + GtkWidget* widget = gWidgetData[m_nXScreen].gEditBoxWidget; GtkRequisition aReq; gtk_widget_size_request( widget, &aReq ); Rectangle aEditRect = rControlRegion; @@ -1104,8 +1114,8 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, } if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) { - NWEnsureGTKSlider( m_nScreen ); - GtkWidget* widget = (nPart == PART_THUMB_HORZ) ? gWidgetData[m_nScreen].gHScale : gWidgetData[m_nScreen].gVScale; + NWEnsureGTKSlider( m_nXScreen ); + GtkWidget* widget = (nPart == PART_THUMB_HORZ) ? gWidgetData[m_nXScreen].gHScale : gWidgetData[m_nXScreen].gVScale; gint slider_length = 10; gint slider_width = 10; gtk_widget_style_get( widget, @@ -1154,10 +1164,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal( GtkBorder* pBorder; GdkRectangle clipRect; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKToolbar( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKToolbar( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); - NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gBtnWidget, nState, stateType ); x = rControlRectangle.Left(); y = rControlRectangle.Top(); @@ -1167,7 +1177,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal( gint internal_padding = 0; if(GTK_IS_TOOL_ITEM(button)) { - gtk_widget_style_get (GTK_WIDGET (gWidgetData[m_nScreen].gToolbarWidget), + gtk_widget_style_get (GTK_WIDGET (gWidgetData[m_nXScreen].gToolbarWidget), "internal-padding", &internal_padding, NULL); x += internal_padding/2; @@ -1176,11 +1186,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal( } // Grab some button style attributes - gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth, + gtk_widget_style_get( gWidgetData[m_nXScreen].gBtnWidget, "focus-line-width", &focusWidth, "focus-padding", &focusPad, "interior_focus", &interiorFocus, (char *)NULL ); - gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gBtnWidget, "default_border", &pBorder, (char *)NULL ); @@ -1220,10 +1230,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal( clipRect.height = it->GetHeight(); // Buttons must paint opaque since some themes have alpha-channel enabled buttons - if(button == gWidgetData[m_nScreen].gToolbarButtonWidget) + if(button == gWidgetData[m_nXScreen].gToolbarButtonWidget) { - gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, - &clipRect, gWidgetData[m_nScreen].gToolbarWidget, "toolbar", x, y, w, h ); + gtk_paint_box( gWidgetData[m_nXScreen].gToolbarWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, + &clipRect, gWidgetData[m_nXScreen].gToolbarWidget, "toolbar", x, y, w, h ); } else { @@ -1239,8 +1249,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKButtonReal( /* don't draw "button", because it can be a tool_button, and * it causes some weird things, so, the default button is * just fine */ - gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi ); + gtk_paint_box( gWidgetData[m_nXScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nXScreen].gBtnWidget, "button", xi, yi, wi, hi ); } return( sal_True ); @@ -1255,7 +1265,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton( const OUString& string) { return NWPaintGTKButtonReal( - gWidgetData[m_nScreen].gBtnWidget, + gWidgetData[m_nXScreen].gBtnWidget, gdkDrawable, type, part, rControlRectangle, @@ -1264,7 +1274,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton( string ); } -static Rectangle NWGetButtonArea( int nScreen, +static Rectangle NWGetButtonArea( SalX11Screen nScreen, ControlType, ControlPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue&, const OUString& ) { @@ -1331,20 +1341,20 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, gint x, y; GdkRectangle clipRect; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKRadio( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKRadio( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); gint indicator_size; - gtk_widget_style_get( gWidgetData[m_nScreen].gRadioWidget, "indicator_size", &indicator_size, (char *)NULL); + gtk_widget_style_get( gWidgetData[m_nXScreen].gRadioWidget, "indicator_size", &indicator_size, (char *)NULL); x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2; y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; // Set the shadow based on if checked or not so we get a freakin checkmark. shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT; - NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gRadioWidgetSibling, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gRadioWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gRadioWidgetSibling, nState, stateType ); // GTK enforces radio groups, so that if we don't have 2 buttons in the group, // the single button will always be active. So we have to have 2 buttons. @@ -1355,8 +1365,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, // intermediate states between active/inactive. Let's hope that // GtkToggleButtone stays binary compatible. if (!isChecked) - GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = sal_True; - GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked; + GTK_TOGGLE_BUTTON(gWidgetData[m_nXScreen].gRadioWidgetSibling)->active = sal_True; + GTK_TOGGLE_BUTTON(gWidgetData[m_nXScreen].gRadioWidget)->active = isChecked; for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) { @@ -1365,8 +1375,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable, clipRect.width = it->GetWidth(); clipRect.height = it->GetHeight(); - gtk_paint_option( gWidgetData[m_nScreen].gRadioWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gRadioWidget, "radiobutton", + gtk_paint_option( gWidgetData[m_nXScreen].gRadioWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nXScreen].gRadioWidget, "radiobutton", x, y, indicator_size, indicator_size ); } @@ -1390,20 +1400,20 @@ sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, GdkRectangle clipRect; gint x,y; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKCheck( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKCheck( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); gint indicator_size; - gtk_widget_style_get( gWidgetData[m_nScreen].gCheckWidget, "indicator_size", &indicator_size, (char *)NULL); + gtk_widget_style_get( gWidgetData[m_nXScreen].gCheckWidget, "indicator_size", &indicator_size, (char *)NULL); x = rControlRectangle.Left() + (rControlRectangle.GetWidth()-indicator_size)/2; y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2; // Set the shadow based on if checked or not so we get a checkmark. shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT; - NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType ); - GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked; + NWSetWidgetState( gWidgetData[m_nXScreen].gCheckWidget, nState, stateType ); + GTK_TOGGLE_BUTTON(gWidgetData[m_nXScreen].gCheckWidget)->active = isChecked; for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) { @@ -1412,8 +1422,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable, clipRect.width = it->GetWidth(); clipRect.height = it->GetHeight(); - gtk_paint_check( gWidgetData[m_nScreen].gCheckWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gCheckWidget, "checkbutton", + gtk_paint_check( gWidgetData[m_nXScreen].gCheckWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nXScreen].gCheckWidget, "checkbutton", x, y, indicator_size, indicator_size ); } @@ -1477,9 +1487,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, button12BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); button21BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKScrollbars( m_nScreen ); - NWEnsureGTKArrow( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKScrollbars( m_nXScreen ); + NWEnsureGTKArrow( m_nXScreen ); // Find the overall bounding rect of the control pixmapRect = rControlRectangle; @@ -1491,7 +1501,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, return( sal_True ); // Grab some button style attributes - gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gScrollHorizWidget, "slider_width", &slider_width, "stepper_size", &stepper_size, "trough_border", &trough_border, @@ -1502,7 +1512,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, gboolean has_backward; gboolean has_backward2; - gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward, + gtk_widget_style_get( gWidgetData[m_nXScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward, "has-secondary-forward-stepper", &has_forward2, "has-backward-stepper", &has_backward, "has-secondary-backward-stepper", &has_backward2, (char *)NULL ); @@ -1520,7 +1530,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, scrollbarRect.Move( 0, vShim ); scrollbarRect.SetSize( Size( scrollbarRect.GetWidth(), sliderHeight ) ); - scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollHorizWidget ); + scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nXScreen].gScrollHorizWidget ); scrollbarOrientation = GTK_ORIENTATION_HORIZONTAL; scrollbarTag = scrollbarTagH; button1Type = GTK_ARROW_LEFT; @@ -1565,7 +1575,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, scrollbarRect.Move( hShim, 0 ); scrollbarRect.SetSize( Size( sliderWidth, scrollbarRect.GetHeight() ) ); - scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nScreen].gScrollVertWidget ); + scrollbarWidget = GTK_SCROLLBAR( gWidgetData[m_nXScreen].gScrollVertWidget ); scrollbarOrientation = GTK_ORIENTATION_VERTICAL; scrollbarTag = scrollbarTagV; button1Type = GTK_ARROW_UP; @@ -1636,7 +1646,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); NWSetWidgetState( GTK_WIDGET(scrollbarWidget), nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gBtnWidget, nState, stateType ); style = GTK_WIDGET( scrollbarWidget )->style; gtk_style_apply_default_background( m_pWindow->style, gdkDrawable, TRUE, @@ -1746,7 +1756,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, //--- -static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect ) +static Rectangle NWGetScrollButtonRect( SalX11Screen nScreen, ControlPart nPart, Rectangle aAreaRect ) { gint slider_width; gint stepper_size; @@ -1842,7 +1852,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, // Find the overall bounding rect of the buttons's drawing area, // plus its actual draw rect excluding adornment - pixmapRect = NWGetEditBoxPixmapRect( m_nScreen, nType, nPart, rControlRectangle, + pixmapRect = NWGetEditBoxPixmapRect( m_nXScreen, nType, nPart, rControlRectangle, nState, aValue, rCaption ); for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) { @@ -1851,7 +1861,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, clipRect.width = it->GetWidth(); clipRect.height = it->GetHeight(); - NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption ); + NWPaintOneEditBox( m_nXScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption ); } return( sal_True ); @@ -1862,7 +1872,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable, * the bounding rectangle of the edit box including * any focus requirements. */ -static Rectangle NWGetEditBoxPixmapRect(int nScreen, +static Rectangle NWGetEditBoxPixmapRect(SalX11Screen nScreen, ControlType, ControlPart, Rectangle aAreaRect, @@ -1896,7 +1906,7 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen, * All coordinates should be local to the Pixmap, NOT * screen/window coordinates. */ -static void NWPaintOneEditBox( int nScreen, +static void NWPaintOneEditBox( SalX11Screen nScreen, GdkDrawable * gdkDrawable, GdkRectangle * gdkRect, ControlType nType, @@ -1985,9 +1995,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart ControlPart downBtnPart = PART_BUTTON_DOWN; ControlState downBtnState = CTRL_STATE_ENABLED; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKSpinButton( m_nScreen ); - NWEnsureGTKArrow( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKSpinButton( m_nXScreen ); + NWEnsureGTKArrow( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); @@ -2019,8 +2029,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart if ( !pixmap ) return( sal_False ); - upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); - downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); + upBtnRect = NWGetSpinButtonRect( m_nXScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); + downBtnRect = NWGetSpinButtonRect( m_nXScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); if ( (nType==CTRL_SPINBOX) && (nPart!=PART_ALL_BUTTONS) ) { @@ -2033,25 +2043,25 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart aEditBoxRect.setX( 0 ); aEditBoxRect.setY( 0 ); - NWPaintOneEditBox( m_nScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rCaption ); + NWPaintOneEditBox( m_nXScreen, pixmap, NULL, nType, nPart, aEditBoxRect, nState, aValue, rCaption ); } - NWSetWidgetState( gWidgetData[m_nScreen].gSpinButtonWidget, nState, stateType ); - gtk_widget_style_get( gWidgetData[m_nScreen].gSpinButtonWidget, "shadow_type", &shadowType, (char *)NULL ); + NWSetWidgetState( gWidgetData[m_nXScreen].gSpinButtonWidget, nState, stateType ); + gtk_widget_style_get( gWidgetData[m_nXScreen].gSpinButtonWidget, "shadow_type", &shadowType, (char *)NULL ); if ( shadowType != GTK_SHADOW_NONE ) { Rectangle shadowRect( upBtnRect ); shadowRect.Union( downBtnRect ); - gtk_paint_box( gWidgetData[m_nScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL, - gWidgetData[m_nScreen].gSpinButtonWidget, "spinbutton", + gtk_paint_box( gWidgetData[m_nXScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL, + gWidgetData[m_nXScreen].gSpinButtonWidget, "spinbutton", (shadowRect.Left() - pixmapRect.Left()), (shadowRect.Top() - pixmapRect.Top()), shadowRect.GetWidth(), shadowRect.GetHeight() ); } - NWPaintOneSpinButton( m_nScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); - NWPaintOneSpinButton( m_nScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); + NWPaintOneSpinButton( m_nXScreen, pixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); + NWPaintOneSpinButton( m_nXScreen, pixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); if( !NWRenderPixmapToScreen(pixmap, pixmapRect) ) { @@ -2065,7 +2075,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart //--- -static Rectangle NWGetSpinButtonRect( int nScreen, +static Rectangle NWGetSpinButtonRect( SalX11Screen nScreen, ControlType, ControlPart nPart, Rectangle aAreaRect, @@ -2115,7 +2125,7 @@ static Rectangle NWGetSpinButtonRect( int nScreen, //--- -static void NWPaintOneSpinButton( int nScreen, +static void NWPaintOneSpinButton( SalX11Screen nScreen, GdkPixmap* pixmap, ControlType nType, ControlPart nPart, @@ -2175,9 +2185,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, gint x,y; GdkRectangle clipRect; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKArrow( m_nScreen ); - NWEnsureGTKCombo( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKArrow( m_nXScreen ); + NWEnsureGTKCombo( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); // Find the overall bounding rect of the buttons's drawing area, @@ -2186,11 +2196,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, x = rControlRectangle.Left(); y = rControlRectangle.Top(); - NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gComboWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gArrowWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gBtnWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gComboWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gArrowWidget, nState, stateType ); - buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); + buttonRect = NWGetComboBoxButtonRect( m_nXScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); if( nPart == PART_BUTTON_DOWN ) buttonRect.Left() += 1; @@ -2213,7 +2223,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, clipRect.height = it->GetHeight(); if( nPart == PART_ENTIRE_CONTROL ) - NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, aEditBoxRect, + NWPaintOneEditBox( m_nXScreen, gdkDrawable, &clipRect, nType, nPart, aEditBoxRect, nState, aValue, rCaption ); // Buttons must paint opaque since some themes have alpha-channel enabled buttons @@ -2222,14 +2232,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, x+(buttonRect.Left() - pixmapRect.Left()), y+(buttonRect.Top() - pixmapRect.Top()), buttonRect.GetWidth(), buttonRect.GetHeight() ); - gtk_paint_box( GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button->style, gdkDrawable, stateType, shadowType, - &clipRect, GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button, "button", + gtk_paint_box( GTK_COMBO(gWidgetData[m_nXScreen].gComboWidget)->button->style, gdkDrawable, stateType, shadowType, + &clipRect, GTK_COMBO(gWidgetData[m_nXScreen].gComboWidget)->button, "button", x+(buttonRect.Left() - pixmapRect.Left()), y+(buttonRect.Top() - pixmapRect.Top()), buttonRect.GetWidth(), buttonRect.GetHeight() ); - gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, sal_True, + gtk_paint_arrow( gWidgetData[m_nXScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nXScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, sal_True, x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()), arrowRect.GetWidth(), arrowRect.GetHeight() ); } @@ -2239,7 +2249,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, //---- -static Rectangle NWGetComboBoxButtonRect( int nScreen, +static Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen, ControlType, ControlPart nPart, Rectangle aAreaRect, @@ -2312,13 +2322,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, Rectangle tabRect; GtkStateType stateType; GtkShadowType shadowType; - if( ! gWidgetData[ m_nScreen ].gCacheTabItems ) + if( ! gWidgetData[ m_nXScreen ].gCacheTabItems ) { - gWidgetData[ m_nScreen ].gCacheTabItems = new NWPixmapCache( m_nScreen ); - gWidgetData[ m_nScreen ].gCacheTabPages = new NWPixmapCache( m_nScreen ); + gWidgetData[ m_nXScreen ].gCacheTabItems = new NWPixmapCache( m_nXScreen ); + gWidgetData[ m_nXScreen ].gCacheTabPages = new NWPixmapCache( m_nXScreen ); } - NWPixmapCache& aCacheItems = *gWidgetData[ m_nScreen ].gCacheTabItems; - NWPixmapCache& aCachePage = *gWidgetData[ m_nScreen ].gCacheTabPages; + NWPixmapCache& aCacheItems = *gWidgetData[ m_nXScreen ].gCacheTabItems; + NWPixmapCache& aCachePage = *gWidgetData[ m_nXScreen ].gCacheTabPages; if( !aCacheItems.GetSize() ) aCacheItems.SetSize( 20 ); @@ -2330,8 +2340,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, return( false ); } - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKNotebook( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKNotebook( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); // Find the overall bounding rect of the buttons's drawing area, @@ -2380,7 +2390,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, } pixmap = gdk_pixmap_new( NULL, pixmapRect.GetWidth(), pixmapRect.GetHeight(), - GetGenericData()->GetSalDisplay()->GetVisual( m_nScreen ).GetDepth() ); + GetGenericData()->GetSalDisplay()->GetVisual( m_nXScreen ).GetDepth() ); GdkRectangle paintRect; paintRect.x = paintRect.y = 0; paintRect.width = pixmapRect.GetWidth(); @@ -2389,7 +2399,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, gtk_paint_flat_box( m_pWindow->style, pixmap, GTK_STATE_NORMAL, GTK_SHADOW_NONE, &paintRect, m_pWindow, "base", 0, 0, -1, -1); - NWSetWidgetState( gWidgetData[m_nScreen].gNotebookWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gNotebookWidget, nState, stateType ); switch( nType ) { @@ -2398,14 +2408,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, case CTRL_FIXEDBORDER: case CTRL_TAB_PANE: - gtk_paint_box_gap( gWidgetData[m_nScreen].gNotebookWidget->style, pixmap, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, gWidgetData[m_nScreen].gNotebookWidget, + gtk_paint_box_gap( gWidgetData[m_nXScreen].gNotebookWidget->style, pixmap, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget, (char *)"notebook", 0, 0, pixmapRect.GetWidth(), pixmapRect.GetHeight(), GTK_POS_TOP, 0, 0 ); break; case CTRL_TAB_ITEM: stateType = ( nState & CTRL_STATE_SELECTED ) ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE; - gtk_paint_extension( gWidgetData[m_nScreen].gNotebookWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[m_nScreen].gNotebookWidget, + gtk_paint_extension( gWidgetData[m_nXScreen].gNotebookWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget, (char *)"tab", (tabRect.Left() - pixmapRect.Left()), (tabRect.Top() - pixmapRect.Top()), tabRect.GetWidth(), tabRect.GetHeight(), GTK_POS_BOTTOM ); @@ -2456,9 +2466,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, gint x,y; GdkRectangle clipRect; - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKOptionMenu( m_nScreen ); - NWEnsureGTKScrolledWindow( m_nScreen ); + NWEnsureGTKButton( m_nXScreen ); + NWEnsureGTKOptionMenu( m_nXScreen ); + NWEnsureGTKScrolledWindow( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); // Find the overall bounding rect of the buttons's drawing area, @@ -2478,13 +2488,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, y = pixmapRect.Top(); // set up references to correct drawable and cliprect - NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gOptionMenuWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gScrolledWindowWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gBtnWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gOptionMenuWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gScrolledWindowWidget, nState, stateType ); if ( nPart != PART_WINDOW ) { - gtk_widget_style_get( gWidgetData[m_nScreen].gOptionMenuWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gOptionMenuWidget, "interior_focus", &bInteriorFocus, "focus_line_width", &nFocusLineWidth, "focus_padding", &nFocusPadding, @@ -2504,15 +2514,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, &clipRect, m_pWindow, "base", x, y, pixmapRect.GetWidth(), pixmapRect.GetHeight() ); - gtk_paint_box( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenu", + gtk_paint_box( gWidgetData[m_nXScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, + gWidgetData[m_nXScreen].gOptionMenuWidget, "optionmenu", x+(widgetRect.Left() - pixmapRect.Left()), y+(widgetRect.Top() - pixmapRect.Top()), widgetRect.GetWidth(), widgetRect.GetHeight() ); - aIndicatorRect = NWGetListBoxIndicatorRect( m_nScreen, nType, nPart, widgetRect, nState, + aIndicatorRect = NWGetListBoxIndicatorRect( m_nXScreen, nType, nPart, widgetRect, nState, aValue, rCaption ); - gtk_paint_tab( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenutab", + gtk_paint_tab( gWidgetData[m_nXScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, + gWidgetData[m_nXScreen].gOptionMenuWidget, "optionmenutab", x+(aIndicatorRect.Left() - pixmapRect.Left()), y+(aIndicatorRect.Top() - pixmapRect.Top()), aIndicatorRect.GetWidth(), aIndicatorRect.GetHeight() ); @@ -2521,8 +2531,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, { shadowType = GTK_SHADOW_IN; - gtk_paint_shadow( gWidgetData[m_nScreen].gScrolledWindowWidget->style, gdkDrawable, GTK_STATE_NORMAL, shadowType, - &clipRect, gWidgetData[m_nScreen].gScrolledWindowWidget, "scrolled_window", + gtk_paint_shadow( gWidgetData[m_nXScreen].gScrolledWindowWidget->style, gdkDrawable, GTK_STATE_NORMAL, shadowType, + &clipRect, gWidgetData[m_nXScreen].gScrolledWindowWidget, "scrolled_window", x+(widgetRect.Left() - pixmapRect.Left()), y+(widgetRect.Top() - pixmapRect.Top()), widgetRect.GetWidth(), widgetRect.GetHeight() ); } @@ -2544,10 +2554,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar( gint x, y, w, h; gint g_x=0, g_y=0, g_w=10, g_h=10; bool bPaintButton = true; - GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget; + GtkWidget* pButtonWidget = gWidgetData[m_nXScreen].gToolbarButtonWidget; GdkRectangle clipRect; - NWEnsureGTKToolbar( m_nScreen ); + NWEnsureGTKToolbar( m_nXScreen ); if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk nState &= ~CTRL_STATE_FOCUSED; NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); @@ -2560,27 +2570,27 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar( // handle toolbar if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT ) { - NWSetWidgetState( gWidgetData[m_nScreen].gToolbarWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gToolbarWidget, nState, stateType ); - GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nScreen].gToolbarWidget, GTK_SENSITIVE ); + GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gToolbarWidget, GTK_SENSITIVE ); if ( nState & CTRL_STATE_ENABLED ) - GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gToolbarWidget, GTK_SENSITIVE ); + GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gToolbarWidget, GTK_SENSITIVE ); if( nPart == PART_DRAW_BACKGROUND_HORZ ) - gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_HORIZONTAL ); + gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nXScreen].gToolbarWidget), GTK_ORIENTATION_HORIZONTAL ); else - gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_VERTICAL ); + gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nXScreen].gToolbarWidget), GTK_ORIENTATION_VERTICAL ); } // handle grip else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT ) { - NWSetWidgetState( gWidgetData[m_nScreen].gHandleBoxWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gHandleBoxWidget, nState, stateType ); - GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nScreen].gHandleBoxWidget, GTK_SENSITIVE ); + GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gHandleBoxWidget, GTK_SENSITIVE ); if ( nState & CTRL_STATE_ENABLED ) - GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gHandleBoxWidget, GTK_SENSITIVE ); + GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gHandleBoxWidget, GTK_SENSITIVE ); - gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(gWidgetData[m_nScreen].gHandleBoxWidget), shadowType ); + gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(gWidgetData[m_nXScreen].gHandleBoxWidget), shadowType ); // evaluate grip rect if( aValue.getType() == CTRL_TOOLBAR ) @@ -2624,32 +2634,32 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar( // draw toolbar if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT ) { - gtk_paint_flat_box( gWidgetData[m_nScreen].gToolbarWidget->style, + gtk_paint_flat_box( gWidgetData[m_nXScreen].gToolbarWidget->style, gdkDrawable, (GtkStateType)GTK_STATE_NORMAL, GTK_SHADOW_NONE, &clipRect, - gWidgetData[m_nScreen].gToolbarWidget, + gWidgetData[m_nXScreen].gToolbarWidget, "base", x, y, w, h ); - gtk_paint_box( gWidgetData[m_nScreen].gToolbarWidget->style, + gtk_paint_box( gWidgetData[m_nXScreen].gToolbarWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gToolbarWidget, + gWidgetData[m_nXScreen].gToolbarWidget, "toolbar", x, y, w, h ); } // draw grip else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT ) { - gtk_paint_handle( gWidgetData[m_nScreen].gHandleBoxWidget->style, + gtk_paint_handle( gWidgetData[m_nXScreen].gHandleBoxWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT, &clipRect, - gWidgetData[m_nScreen].gHandleBoxWidget, + gWidgetData[m_nXScreen].gHandleBoxWidget, "handlebox", g_x, g_y, g_w, g_h, nPart == PART_THUMB_HORZ ? @@ -2661,23 +2671,23 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar( { gint separator_height, separator_width, wide_separators; - gtk_widget_style_get (gWidgetData[m_nScreen].gVSeparator, + gtk_widget_style_get (gWidgetData[m_nXScreen].gVSeparator, "wide-separators", &wide_separators, "separator-width", &separator_width, "separator-height", &separator_height, NULL); if (wide_separators) - gtk_paint_box (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable, + gtk_paint_box (gWidgetData[m_nXScreen].gVSeparator->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT, - &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator", + &clipRect, gWidgetData[m_nXScreen].gVSeparator, "vseparator", x + (w - separator_width) / 2, y + 7, separator_width, h - 14); else - gtk_paint_vline (gWidgetData[m_nScreen].gVSeparator->style, gdkDrawable, + gtk_paint_vline (gWidgetData[m_nXScreen].gVSeparator->style, gdkDrawable, GTK_STATE_NORMAL, - &clipRect, gWidgetData[m_nScreen].gVSeparator, "vseparator", + &clipRect, gWidgetData[m_nXScreen].gVSeparator, "vseparator", y + 7, y + h - 7, x + w/2 - 1); @@ -2704,7 +2714,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar( gint x, y, w, h; GdkRectangle clipRect; - NWEnsureGTKMenubar( m_nScreen ); + NWEnsureGTKMenubar( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); x = rControlRectangle.Left(); @@ -2716,7 +2726,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar( { if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) { - gtk_widget_style_get( gWidgetData[m_nScreen].gMenuItemMenubarWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenubarWidget, "selected_shadow_type", &selected_shadow_type, (char *)NULL); } @@ -2732,14 +2742,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar( // handle Menubar if( nPart == PART_ENTIRE_CONTROL ) { - NWSetWidgetState( gWidgetData[m_nScreen].gMenubarWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gMenubarWidget, nState, stateType ); - GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nScreen].gMenubarWidget, GTK_SENSITIVE ); + GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gMenubarWidget, GTK_SENSITIVE ); if ( nState & CTRL_STATE_ENABLED ) - GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gMenubarWidget, GTK_SENSITIVE ); + GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gMenubarWidget, GTK_SENSITIVE ); // for translucent menubar styles paint background first - gtk_paint_flat_box( gWidgetData[m_nScreen].gMenubarWidget->style, + gtk_paint_flat_box( gWidgetData[m_nXScreen].gMenubarWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, @@ -2747,12 +2757,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar( GTK_WIDGET(m_pWindow), "base", x, y, w, h ); - gtk_paint_box( gWidgetData[m_nScreen].gMenubarWidget->style, + gtk_paint_box( gWidgetData[m_nXScreen].gMenubarWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gMenubarWidget, + gWidgetData[m_nXScreen].gMenubarWidget, "menubar", x, y, w, h ); } @@ -2761,12 +2771,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar( { if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) { - gtk_paint_box( gWidgetData[m_nScreen].gMenuItemMenubarWidget->style, + gtk_paint_box( gWidgetData[m_nXScreen].gMenuItemMenubarWidget->style, gdkDrawable, GTK_STATE_PRELIGHT, selected_shadow_type, &clipRect, - gWidgetData[m_nScreen].gMenuItemMenubarWidget, + gWidgetData[m_nXScreen].gMenuItemMenubarWidget, "menuitem", x, y, w, h); } @@ -2796,7 +2806,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( gint x, y, w, h; GdkRectangle clipRect; - NWEnsureGTKMenu( m_nScreen ); + NWEnsureGTKMenu( m_nXScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); x = rControlRectangle.Left(); @@ -2807,16 +2817,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( if( nPart == PART_MENU_ITEM && ( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) ) { - gtk_widget_style_get( gWidgetData[m_nScreen].gMenuItemMenuWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenuWidget, "selected_shadow_type", &selected_shadow_type, (char *)NULL); } - NWSetWidgetState( gWidgetData[m_nScreen].gMenuWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nXScreen].gMenuWidget, nState, stateType ); - GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nScreen].gMenuWidget, GTK_SENSITIVE ); + GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gMenuWidget, GTK_SENSITIVE ); if ( nState & CTRL_STATE_ENABLED ) - GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gMenuWidget, GTK_SENSITIVE ); + GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gMenuWidget, GTK_SENSITIVE ); for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) { @@ -2828,7 +2838,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( if( nPart == PART_ENTIRE_CONTROL ) { // for translucent menubar styles paint background first - gtk_paint_flat_box( gWidgetData[m_nScreen].gMenuWidget->style, + gtk_paint_flat_box( gWidgetData[m_nXScreen].gMenuWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, @@ -2836,12 +2846,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( GTK_WIDGET(m_pWindow), "base", x, y, w, h ); - gtk_paint_box( gWidgetData[m_nScreen].gMenuWidget->style, + gtk_paint_box( gWidgetData[m_nXScreen].gMenuWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT, &clipRect, - gWidgetData[m_nScreen].gMenuWidget, + gWidgetData[m_nXScreen].gMenuWidget, "menu", x, y, w, h ); } @@ -2850,12 +2860,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) { if( nState & CTRL_STATE_ENABLED ) - gtk_paint_box( gWidgetData[m_nScreen].gMenuItemMenuWidget->style, + gtk_paint_box( gWidgetData[m_nXScreen].gMenuItemMenuWidget->style, gdkDrawable, GTK_STATE_PRELIGHT, selected_shadow_type, &clipRect, - gWidgetData[m_nScreen].gMenuItemMenuWidget, + gWidgetData[m_nXScreen].gMenuItemMenuWidget, "menuitem", x, y, w, h); } @@ -2863,8 +2873,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ) { GtkWidget* pWidget = (nPart == PART_MENU_ITEM_CHECK_MARK) ? - gWidgetData[m_nScreen].gMenuItemCheckMenuWidget : - gWidgetData[m_nScreen].gMenuItemRadioMenuWidget; + gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget : + gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget; GtkStateType nStateType = GTK_STATE_NORMAL; GtkShadowType nShadowType; @@ -2886,7 +2896,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( nStateType, nShadowType, &clipRect, - gWidgetData[m_nScreen].gMenuItemMenuWidget, + gWidgetData[m_nXScreen].gMenuItemMenuWidget, "check", x, y, w, h ); } @@ -2897,18 +2907,18 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( nStateType, nShadowType, &clipRect, - gWidgetData[m_nScreen].gMenuItemMenuWidget, + gWidgetData[m_nXScreen].gMenuItemMenuWidget, "option", x, y, w, h ); } } else if( nPart == PART_MENU_SEPARATOR ) { - gtk_paint_hline( gWidgetData[m_nScreen].gMenuItemSeparatorMenuWidget->style, + gtk_paint_hline( gWidgetData[m_nXScreen].gMenuItemSeparatorMenuWidget->style, gdkDrawable, GTK_STATE_NORMAL, &clipRect, - gWidgetData[m_nScreen].gMenuItemSeparatorMenuWidget, + gWidgetData[m_nXScreen].gMenuItemSeparatorMenuWidget, "menuitem", x, x + w, y + h / 2); } @@ -2920,7 +2930,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( if ( nState & CTRL_STATE_SELECTED ) nStateType = GTK_STATE_PRELIGHT; - NWSetWidgetState( gWidgetData[m_nScreen].gMenuItemMenuWidget, + NWSetWidgetState( gWidgetData[m_nXScreen].gMenuItemMenuWidget, nState, nStateType ); if ( nState & CTRL_STATE_PRESSED ) @@ -2934,12 +2944,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( else eArrow = GTK_ARROW_RIGHT; - gtk_paint_arrow( gWidgetData[m_nScreen].gMenuItemMenuWidget->style, + gtk_paint_arrow( gWidgetData[m_nXScreen].gMenuItemMenuWidget->style, gdkDrawable, nStateType, nShadowType, &clipRect, - gWidgetData[m_nScreen].gMenuItemMenuWidget, + gWidgetData[m_nXScreen].gMenuItemMenuWidget, "menuitem", eArrow, TRUE, x, y, w, h); @@ -2957,7 +2967,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTooltip( ControlState, const ImplControlValue&, const OUString& ) { - NWEnsureGTKTooltip( m_nScreen ); + NWEnsureGTKTooltip( m_nXScreen ); gint x, y, w, h; GdkRectangle clipRect; @@ -2974,12 +2984,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKTooltip( clipRect.width = it->GetWidth(); clipRect.height = it->GetHeight(); - gtk_paint_flat_box( gWidgetData[m_nScreen].gTooltipPopup->style, + gtk_paint_flat_box( gWidgetData[m_nXScreen].gTooltipPopup->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT, &clipRect, - gWidgetData[m_nScreen].gTooltipPopup, + gWidgetData[m_nXScreen].gTooltipPopup, "tooltip", x, y, w, h ); } @@ -2995,7 +3005,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode( ControlState nState, const ImplControlValue& rValue, const OUString& ) { - NWEnsureGTKTreeView( m_nScreen ); + NWEnsureGTKTreeView( m_nXScreen ); Rectangle aRect( rControlRectangle ); aRect.Left() -= 2; @@ -3026,11 +3036,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode( return sal_False; GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); - gtk_paint_expander( gWidgetData[m_nScreen].gTreeView->style, + gtk_paint_expander( gWidgetData[m_nXScreen].gTreeView->style, pixDrawable, stateType, NULL, - gWidgetData[m_nScreen].gTreeView, + gWidgetData[m_nXScreen].gTreeView, "treeview", w/2, h/2, eStyle ); @@ -3049,7 +3059,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress( ControlState, const ImplControlValue& rValue, const OUString& ) { - NWEnsureGTKProgressBar( m_nScreen ); + NWEnsureGTKProgressBar( m_nXScreen ); gint w, h; w = rControlRectangle.GetWidth(); @@ -3064,12 +3074,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress( GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); // paint background - gtk_paint_flat_box( gWidgetData[m_nScreen].gProgressBar->style, + gtk_paint_flat_box( gWidgetData[m_nXScreen].gProgressBar->style, pixDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, - gWidgetData[m_nScreen].gProgressBar, + gWidgetData[m_nXScreen].gProgressBar, "trough", 0, 0, w, h ); if( nProgressWidth > 0 ) @@ -3077,22 +3087,22 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress( // paint progress if( Application::GetSettings().GetLayoutRTL() ) { - gtk_paint_box( gWidgetData[m_nScreen].gProgressBar->style, + gtk_paint_box( gWidgetData[m_nXScreen].gProgressBar->style, pixDrawable, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, - gWidgetData[m_nScreen].gProgressBar, + gWidgetData[m_nXScreen].gProgressBar, "bar", w-nProgressWidth, 0, nProgressWidth, h ); } else { - gtk_paint_box( gWidgetData[m_nScreen].gProgressBar->style, + gtk_paint_box( gWidgetData[m_nXScreen].gProgressBar->style, pixDrawable, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, NULL, - gWidgetData[m_nScreen].gProgressBar, + gWidgetData[m_nXScreen].gProgressBar, "bar", 0, 0, nProgressWidth, h ); @@ -3114,7 +3124,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider( const OUString& ) { OSL_ASSERT( rValue.getType() == CTRL_SLIDER ); - NWEnsureGTKSlider( m_nScreen ); + NWEnsureGTKSlider( m_nXScreen ); gint w, h; w = rControlRectangle.GetWidth(); @@ -3128,8 +3138,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider( GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap ); GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA) - ? GTK_WIDGET(gWidgetData[m_nScreen].gHScale) - : GTK_WIDGET(gWidgetData[m_nScreen].gVScale); + ? GTK_WIDGET(gWidgetData[m_nXScreen].gHScale) + : GTK_WIDGET(gWidgetData[m_nXScreen].gVScale); const gchar* pDetail = (nPart == PART_TRACK_HORZ_AREA) ? "hscale" : "vscale"; GtkOrientation eOri = (nPart == PART_TRACK_HORZ_AREA) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL; GtkStateType eState = (nState & CTRL_STATE_ENABLED) ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE; @@ -3197,7 +3207,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider( //---- -static Rectangle NWGetListBoxButtonRect( int nScreen, +static Rectangle NWGetListBoxButtonRect( SalX11Screen nScreen, ControlType, ControlPart nPart, Rectangle aAreaRect, @@ -3262,7 +3272,7 @@ static Rectangle NWGetListBoxButtonRect( int nScreen, //---- -static Rectangle NWGetListBoxIndicatorRect( int nScreen, +static Rectangle NWGetListBoxIndicatorRect( SalX11Screen nScreen, ControlType, ControlPart, Rectangle aAreaRect, @@ -3312,7 +3322,7 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen, return( aIndicatorRect ); } -static Rectangle NWGetToolbarRect( int nScreen, +static Rectangle NWGetToolbarRect( SalX11Screen nScreen, ControlType, ControlPart nPart, Rectangle aAreaRect, @@ -3399,11 +3409,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) StyleSettings aStyleSet = rSettings.GetStyleSettings(); // get the widgets in place - NWEnsureGTKMenu( m_nScreen ); - NWEnsureGTKMenubar( m_nScreen ); - NWEnsureGTKScrollbars( m_nScreen ); - NWEnsureGTKEditBox( m_nScreen ); - NWEnsureGTKTooltip( m_nScreen ); + NWEnsureGTKMenu( m_nXScreen ); + NWEnsureGTKMenubar( m_nXScreen ); + NWEnsureGTKScrollbars( m_nXScreen ); + NWEnsureGTKEditBox( m_nXScreen ); + NWEnsureGTKTooltip( m_nXScreen ); #if OSL_DEBUG_LEVEL > 2 printStyleColors( pStyle ); @@ -3421,7 +3431,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetFieldTextColor( aTextColor ); // Tooltip colors - GtkStyle* pTooltipStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gTooltipPopup ); + GtkStyle* pTooltipStyle = gtk_widget_get_style( gWidgetData[m_nXScreen].gTooltipPopup ); aTextColor = getColor( pTooltipStyle->fg[ GTK_STATE_NORMAL ] ); aStyleSet.SetHelpTextColor( aTextColor ); @@ -3475,10 +3485,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetSkipDisabledInMenus( sal_True ); aStyleSet.SetAcceleratorsInContextMenus( sal_False ); // menu colors - GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget ); - GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget ); - GtkStyle* pMenubarStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenubarWidget ); - GtkStyle* pMenuTextStyle = gtk_rc_get_style( gtk_bin_get_child( GTK_BIN(gWidgetData[m_nScreen].gMenuItemMenuWidget) ) ); + GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nXScreen].gMenuWidget ); + GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nXScreen].gMenuItemMenuWidget ); + GtkStyle* pMenubarStyle = gtk_rc_get_style( gWidgetData[m_nXScreen].gMenubarWidget ); + GtkStyle* pMenuTextStyle = gtk_rc_get_style( gtk_bin_get_child( GTK_BIN(gWidgetData[m_nXScreen].gMenuItemMenuWidget) ) ); aBackColor = getColor( pMenubarStyle->bg[GTK_STATE_NORMAL] ); aStyleSet.SetMenuBarColor( aBackColor ); @@ -3655,7 +3665,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) gint min_slider_length = 21; // Grab some button style attributes - gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, + gtk_widget_style_get( gWidgetData[m_nXScreen].gScrollHorizWidget, "slider-width", &slider_width, "trough-border", &trough_border, "min-slider-length", &min_slider_length, @@ -3739,12 +3749,12 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect ) // Copy the background of the screen into a composite pixmap CopyScreenArea( GetXDisplay(), - GetDrawable(), GetScreenNumber(), GetVisual().GetDepth(), - gdk_x11_drawable_get_xid(pPixmap), - gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ), - gdk_drawable_get_depth( GDK_DRAWABLE( pPixmap ) ), - gdk_x11_gc_get_xgc(pPixmapGC), - srcRect.Left(), srcRect.Top(), srcRect.GetWidth(), srcRect.GetHeight(), 0, 0 ); + GetDrawable(), GetScreenNumber(), GetVisual().GetDepth(), + gdk_x11_drawable_get_xid(pPixmap), + SalX11Screen( gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ) ), + gdk_drawable_get_depth( GDK_DRAWABLE( pPixmap ) ), + gdk_x11_gc_get_xgc(pPixmapGC), + srcRect.Left(), srcRect.Top(), srcRect.GetWidth(), srcRect.GetHeight(), 0, 0 ); g_object_unref( pPixmapGC ); return( pPixmap ); @@ -3772,12 +3782,12 @@ sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle d // Copy the background of the screen into a composite pixmap CopyScreenArea( GetXDisplay(), - GDK_DRAWABLE_XID(pPixmap), - gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ), - gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ), - GetDrawable(), m_nScreen, GetVisual().GetDepth(), - aFontGC, - 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); + GDK_DRAWABLE_XID(pPixmap), + SalX11Screen( gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ) ), + gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ), + GetDrawable(), m_nXScreen, GetVisual().GetDepth(), + aFontGC, + 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); return( sal_True ); } @@ -3838,7 +3848,7 @@ static void NWSetWidgetState( GtkWidget* widget, ControlState nState, GtkStateTy //------------------------------------- -static void NWAddWidgetToCacheWindow( GtkWidget* widget, int nScreen ) +static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen ) { NWFWidgetData& rData = gWidgetData[nScreen]; if ( !rData.gCacheWindow || !rData.gDumbContainer ) @@ -3846,7 +3856,8 @@ static void NWAddWidgetToCacheWindow( GtkWidget* widget, int nScreen ) if ( !rData.gCacheWindow ) { rData.gCacheWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), nScreen ); + GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), + nScreen.getXScreen() ); if( pScreen ) gtk_window_set_screen( GTK_WINDOW(rData.gCacheWindow), pScreen ); } @@ -3867,7 +3878,7 @@ static void NWAddWidgetToCacheWindow( GtkWidget* widget, int nScreen ) //------------------------------------- -static void NWEnsureGTKButton( int nScreen ) +static void NWEnsureGTKButton( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gBtnWidget ) { @@ -3878,7 +3889,7 @@ static void NWEnsureGTKButton( int nScreen ) //------------------------------------- -static void NWEnsureGTKRadio( int nScreen ) +static void NWEnsureGTKRadio( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gRadioWidget || !gWidgetData[nScreen].gRadioWidgetSibling ) { @@ -3891,7 +3902,7 @@ static void NWEnsureGTKRadio( int nScreen ) //------------------------------------- -static void NWEnsureGTKCheck( int nScreen ) +static void NWEnsureGTKCheck( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gCheckWidget ) { @@ -3902,7 +3913,7 @@ static void NWEnsureGTKCheck( int nScreen ) //------------------------------------- -static void NWEnsureGTKScrollbars( int nScreen ) +static void NWEnsureGTKScrollbars( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gScrollHorizWidget ) { @@ -3919,7 +3930,7 @@ static void NWEnsureGTKScrollbars( int nScreen ) //------------------------------------- -static void NWEnsureGTKArrow( int nScreen ) +static void NWEnsureGTKArrow( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gArrowWidget || !gWidgetData[nScreen].gDropdownWidget ) { @@ -3934,7 +3945,7 @@ static void NWEnsureGTKArrow( int nScreen ) //------------------------------------- -static void NWEnsureGTKEditBox( int nScreen ) +static void NWEnsureGTKEditBox( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gEditBoxWidget ) { @@ -3945,7 +3956,7 @@ static void NWEnsureGTKEditBox( int nScreen ) //------------------------------------- -static void NWEnsureGTKSpinButton( int nScreen ) +static void NWEnsureGTKSpinButton( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gSpinButtonWidget ) { @@ -3962,7 +3973,7 @@ static void NWEnsureGTKSpinButton( int nScreen ) //------------------------------------- -static void NWEnsureGTKNotebook( int nScreen ) +static void NWEnsureGTKNotebook( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gNotebookWidget ) { @@ -3973,7 +3984,7 @@ static void NWEnsureGTKNotebook( int nScreen ) //------------------------------------- -static void NWEnsureGTKOptionMenu( int nScreen ) +static void NWEnsureGTKOptionMenu( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gOptionMenuWidget ) { @@ -3984,7 +3995,7 @@ static void NWEnsureGTKOptionMenu( int nScreen ) //------------------------------------- -static void NWEnsureGTKCombo( int nScreen ) +static void NWEnsureGTKCombo( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gComboWidget ) { @@ -4004,7 +4015,7 @@ static void NWEnsureGTKCombo( int nScreen ) //------------------------------------- -static void NWEnsureGTKScrolledWindow( int nScreen ) +static void NWEnsureGTKScrolledWindow( SalX11Screen nScreen ) { if ( !gWidgetData[nScreen].gScrolledWindowWidget ) { @@ -4018,7 +4029,7 @@ static void NWEnsureGTKScrolledWindow( int nScreen ) //------------------------------------- -static void NWEnsureGTKToolbar( int nScreen ) +static void NWEnsureGTKToolbar( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gToolbarWidget ) { @@ -4049,7 +4060,7 @@ static void NWEnsureGTKToolbar( int nScreen ) //------------------------------------- -static void NWEnsureGTKMenubar( int nScreen ) +static void NWEnsureGTKMenubar( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gMenubarWidget ) { @@ -4068,7 +4079,7 @@ static void NWEnsureGTKMenubar( int nScreen ) } } -static void NWEnsureGTKMenu( int nScreen ) +static void NWEnsureGTKMenu( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gMenuWidget ) { @@ -4113,12 +4124,13 @@ static void NWEnsureGTKMenu( int nScreen ) } } -static void NWEnsureGTKTooltip( int nScreen ) +static void NWEnsureGTKTooltip( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gTooltipPopup ) { gWidgetData[nScreen].gTooltipPopup = gtk_window_new (GTK_WINDOW_POPUP); - GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), nScreen ); + GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), + nScreen.getXScreen() ); if( pScreen ) gtk_window_set_screen( GTK_WINDOW(gWidgetData[nScreen].gTooltipPopup), pScreen ); gtk_widget_set_name( gWidgetData[nScreen].gTooltipPopup, "gtk-tooltips"); @@ -4127,7 +4139,7 @@ static void NWEnsureGTKTooltip( int nScreen ) } } -static void NWEnsureGTKProgressBar( int nScreen ) +static void NWEnsureGTKProgressBar( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gProgressBar ) { @@ -4136,7 +4148,7 @@ static void NWEnsureGTKProgressBar( int nScreen ) } } -static void NWEnsureGTKTreeView( int nScreen ) +static void NWEnsureGTKTreeView( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gTreeView ) { @@ -4145,7 +4157,7 @@ static void NWEnsureGTKTreeView( int nScreen ) } } -static void NWEnsureGTKSlider( int nScreen ) +static void NWEnsureGTKSlider( SalX11Screen nScreen ) { if( !gWidgetData[nScreen].gHScale ) { diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index f778354ed5c9..0768093ef9fb 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -453,8 +453,8 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder() } GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) + : m_nXScreen( getDisplay()->GetDefaultXScreen() ) { - m_nScreen = getDisplay()->GetDefaultScreenNumber(); getDisplay()->registerFrame( this ); m_nDuringRender = 0; m_bDefaultPos = true; @@ -464,8 +464,8 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle ) } GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) + : m_nXScreen( getDisplay()->GetDefaultXScreen() ) { - m_nScreen = getDisplay()->GetDefaultScreenNumber(); getDisplay()->registerFrame( this ); // permanently ignore errors from our unruly children ... GetGenericData()->ErrorTrapPush(); @@ -481,7 +481,7 @@ GtkSalFrame::~GtkSalFrame() if( !m_aGraphics[i].pGraphics ) continue; #if !GTK_CHECK_VERSION(3,0,0) - m_aGraphics[i].pGraphics->SetDrawable( None, m_nScreen ); + m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); #endif m_aGraphics[i].bInUse = false; } @@ -586,7 +586,7 @@ void GtkSalFrame::updateScreenNumber() GdkScreen *pScreen = gtk_widget_get_screen( m_pWindow ); if( pScreen ) nScreen = GtkSalSystem::getScreenMonitorIdx( getGdkDisplay(), pScreen, maGeometry.nX, maGeometry.nY ); - maGeometry.nScreenNumber = nScreen; + maGeometry.nDisplayScreenNumber = nScreen; } void GtkSalFrame::InitCommon() @@ -658,9 +658,9 @@ void GtkSalFrame::InitCommon() #if !GTK_CHECK_VERSION(3,0,0) GtkSalDisplay* pDisp = GetGtkSalData()->GetGtkDisplay(); m_aSystemData.pDisplay = pDisp->GetDisplay(); - m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual(); - m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth(); - m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap(); + m_aSystemData.pVisual = pDisp->GetVisual( m_nXScreen ).GetVisual(); + m_aSystemData.nDepth = pDisp->GetVisual( m_nXScreen ).GetDepth(); + m_aSystemData.aColormap = pDisp->GetColormap( m_nXScreen ).GetXColormap(); m_aSystemData.aWindow = widget_get_xid(m_pWindow); #else static int nWindow = 0; @@ -668,7 +668,7 @@ void GtkSalFrame::InitCommon() #endif m_aSystemData.pSalFrame = this; m_aSystemData.pWidget = m_pWindow; - m_aSystemData.nScreen = m_nScreen; + m_aSystemData.nScreen = m_nXScreen.getXScreen(); m_aSystemData.pAppContext = NULL; m_aSystemData.aShellWindow = m_aSystemData.aWindow; m_aSystemData.pShellWidget = m_aSystemData.pWidget; @@ -1102,7 +1102,8 @@ SalGraphics* GtkSalFrame::GetGraphics() AllocateFrame(); m_aGraphics[i].pGraphics->setDevice( m_aFrame ); #else // common case: - m_aGraphics[i].pGraphics->Init( this, widget_get_xid(m_pWindow), m_nScreen ); + m_aGraphics[i].pGraphics->Init( this, widget_get_xid(m_pWindow), + m_nXScreen ); #endif } return m_aGraphics[i].pGraphics; @@ -1319,7 +1320,7 @@ void GtkSalFrame::Center() Size GtkSalFrame::calcDefaultSize() { - Size aScreenSize = GetGtkSalData()->GetGtkDisplay()->GetScreenSize( m_nScreen ); + Size aScreenSize = getDisplay()->GetScreenSize( GetDisplayScreen() ); long w = aScreenSize.Width(); long h = aScreenSize.Height(); @@ -1645,7 +1646,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u #if GTK_CHECK_VERSION(3,0,0) // adjust position to avoid off screen windows // but allow toolbars to be positioned partly off screen by the user - Size aScreenSize = GetGtkSalData()->GetGtkDisplay()->GetScreenSize( m_nScreen ); + Size aScreenSize = getDisplay()->GetScreenSize( GetDisplayScreen() ); if( ! (m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) { if( nX < (long)maGeometry.nLeftDecoration ) @@ -1846,6 +1847,9 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSiz if( !m_pWindow ) return; + if (maGeometry.nDisplayScreenNumber == nNewScreen && eType == SET_RETAIN_SIZE) + return; + gint nMonitor; GdkScreen *pScreen = NULL; pScreen = GtkSalSystem::getScreenMonitorFromIdx( getGdkDisplay(), nNewScreen, nMonitor ); @@ -2531,21 +2535,21 @@ void GtkSalFrame::SetParent( SalFrame* pNewParent ) #if !GTK_CHECK_VERSION(3,0,0) -void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nScreen ) +void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, SalX11Screen nXScreen ) { bool bWasVisible = IS_WIDGET_MAPPED(m_pWindow); if( bWasVisible ) Show( sal_False ); - if( nScreen < 0 || nScreen >= getDisplay()->GetScreenCount() ) - nScreen = m_nScreen; + if( (int)nXScreen.getXScreen() >= getDisplay()->GetXScreenCount() ) + nXScreen = m_nXScreen; SystemParentData aParentData; aParentData.aWindow = aNewParent; aParentData.bXEmbedSupport = bXEmbed; if( aNewParent == None ) { - aNewParent = getDisplay()->GetRootWindow(nScreen); + aNewParent = getDisplay()->GetRootWindow(nXScreen); aParentData.aWindow = None; aParentData.bXEmbedSupport = false; } @@ -2553,12 +2557,12 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc { // is new parent a root window ? Display* pDisp = getDisplay()->GetDisplay(); - int nScreens = getDisplay()->GetScreenCount(); + int nScreens = getDisplay()->GetXScreenCount(); for( int i = 0; i < nScreens; i++ ) { if( aNewParent == RootWindow( pDisp, i ) ) { - nScreen = i; + nXScreen = SalX11Screen( i ); aParentData.aWindow = None; aParentData.bXEmbedSupport = false; break; @@ -2566,12 +2570,10 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc } } -#if !GTK_CHECK_VERSION(3,0,0) // free xrender resources for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) if( m_aGraphics[i].bInUse ) - m_aGraphics[i].pGraphics->SetDrawable( None, m_nScreen ); -#endif + m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen ); // first deinit frame if( m_pIMHandler ) @@ -2580,13 +2582,13 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc m_pIMHandler = NULL; } if( m_pRegion ) -{ + { #if GTK_CHECK_VERSION(3,0,0) cairo_region_destroy( m_pRegion ); #else gdk_region_destroy( m_pRegion ); #endif -} + } if( m_pFixedContainer ) gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) ); if( m_pWindow ) @@ -2606,20 +2608,18 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc else { m_nStyle &= ~SAL_FRAME_STYLE_PLUG; - Init( (m_pParent && m_pParent->m_nScreen == m_nScreen) ? m_pParent : NULL, m_nStyle ); + Init( (m_pParent && m_pParent->m_nXScreen == m_nXScreen) ? m_pParent : NULL, m_nStyle ); } -#if !GTK_CHECK_VERSION(3,0,0) // update graphics for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ ) { if( m_aGraphics[i].bInUse ) { - m_aGraphics[i].pGraphics->SetDrawable( widget_get_xid(m_pWindow), m_nScreen ); + m_aGraphics[i].pGraphics->SetDrawable( widget_get_xid(m_pWindow), m_nXScreen ); m_aGraphics[i].pGraphics->SetWindow( m_pWindow ); } } -#endif if( ! m_aTitle.isEmpty() ) SetTitle( m_aTitle ); @@ -2630,7 +2630,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc std::list< GtkSalFrame* > aChildren = m_aChildren; m_aChildren.clear(); for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) - (*it)->createNewWindow( None, false, m_nScreen ); + (*it)->createNewWindow( None, false, m_nXScreen ); // FIXME: SalObjects } @@ -2641,7 +2641,7 @@ bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent ) #if !GTK_CHECK_VERSION(3,0,0) if( pSysParent ) // this may be the first system child frame now GetGenericData()->ErrorTrapPush(); // permanantly ignore unruly children's errors - createNewWindow( pSysParent->aWindow, (pSysParent->nSize > sizeof(long)) ? pSysParent->bXEmbedSupport : false, m_nScreen ); + createNewWindow( pSysParent->aWindow, (pSysParent->nSize > sizeof(long)) ? pSysParent->bXEmbedSupport : false, m_nXScreen ); return true; #else (void)pSysParent; @@ -2733,7 +2733,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) XLIB_Window aChild; XTranslateCoordinates( getDisplay()->GetDisplay(), widget_get_xid(m_pWindow), - getDisplay()->GetRootWindow( getDisplay()->GetDefaultScreenNumber() ), + getDisplay()->GetRootWindow( getDisplay()->GetDefaultXScreen() ), 0, 0, &x, &y, &aChild ); @@ -2792,7 +2792,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) widget_get_xid(m_pWindow), aSize.Width(), aSize.Height(), - getDisplay()->GetVisual(m_nScreen).GetDepth() ); + getDisplay()->GetVisual(m_nXScreen).GetDepth() ); if( m_hBackgroundPixmap ) { SalTwoRect aTwoRect; @@ -2800,10 +2800,10 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = aSize.Width(); aTwoRect.mnSrcHeight = aTwoRect.mnDestHeight = aSize.Height(); pBM->ImplDraw( m_hBackgroundPixmap, - m_nScreen, - getDisplay()->GetVisual(m_nScreen).GetDepth(), + m_nXScreen, + getDisplay()->GetVisual(m_nXScreen).GetDepth(), aTwoRect, - getDisplay()->GetCopyGC(m_nScreen) ); + getDisplay()->GetCopyGC(m_nXScreen) ); XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), widget_get_xid(m_pWindow), m_hBackgroundPixmap ); @@ -4160,12 +4160,10 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint return sal_False; } -#if GTK_CHECK_VERSION(3,0,0) -Size GtkSalDisplay::GetScreenSize( int nScreen ) +Size GtkSalDisplay::GetScreenSize( int nDisplayScreen ) { - Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nScreen ); + Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nDisplayScreen ); return Size( aRect.GetWidth(), aRect.GetHeight() ); } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index 198bd263c4ac..7ca30237d2b0 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -66,10 +66,10 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow ) m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket)); m_aSystemData.pSalFrame = NULL; m_aSystemData.pWidget = m_pSocket; - m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual(); - m_aSystemData.nScreen = pParent->getScreenNumber(); - m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth(); - m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap(); + m_aSystemData.pVisual = pDisp->GetVisual(pParent->getXScreenNumber()).GetVisual(); + m_aSystemData.nScreen = pParent->getXScreenNumber().getXScreen(); + m_aSystemData.nDepth = pDisp->GetVisual(pParent->getXScreenNumber()).GetDepth(); + m_aSystemData.aColormap = pDisp->GetColormap(pParent->getXScreenNumber()).GetXColormap(); m_aSystemData.pAppContext = NULL; m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pParent->getWindow()))); m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 97e911fa1b9a..cc764daa5369 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -264,6 +264,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, ControlPart nPart, const ImplControlValue& aValue ) { + (void)nType; OSL_ASSERT( aValue.getType() == CTRL_SCROLLBAR ); const ScrollbarValue* pScrollbarVal = static_cast<const ScrollbarValue *>(&aValue); Rectangle scrollbarRect; @@ -550,6 +551,7 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context, Rectangle aAreaRect, ControlState nState ) { + (void)nType; Rectangle buttonRect; GtkStateFlags stateFlags; GtkShadowType shadowType; @@ -595,6 +597,7 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context, ControlPart nPart, const ImplControlValue& aValue ) { + (void)nPart; Rectangle areaRect; GtkShadowType shadowType; const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL; @@ -651,6 +654,8 @@ Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlType nType, ControlPart nPart, Rectangle aAreaRect ) { + (void)nType; + (void)nPart; Rectangle aButtonRect; gint nArrowWidth; gint nButtonWidth; @@ -696,6 +701,7 @@ void GtkSalGraphics::PaintCombobox( GtkStyleContext *context, ControlPart nPart, const ImplControlValue& aValue ) { + (void)aValue; Rectangle areaRect; Rectangle buttonRect; Rectangle arrowRect; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 4178a270de11..8ff0ce5f6463 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -237,7 +237,8 @@ class WidgetPainter */ sal_Bool drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, - Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc, + Display *dpy, XLIB_Window drawable, SalX11Screen nXScreen, + int nDepth, GC gc, ControlPart nPart = PART_ENTIRE_CONTROL ); /** 'Get' method for push button. @@ -429,8 +430,8 @@ WidgetPainter::~WidgetPainter( void ) sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, - Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc, - ControlPart nPart ) + Display *dpy, XLIB_Window drawable, SalX11Screen nXScreen, + int nDepth, GC gc, ControlPart nPart ) { if ( !pWidget ) return sal_False; @@ -478,12 +479,13 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, // Bitblt from the screen, because the radio buttons are usually not // rectangular, and there could be a bitmap under them GC aTmpGC = XCreateGC( dpy, qPixmap.handle(), 0, NULL ); - X11SalGraphics::CopyScreenArea( dpy, - drawable, nScreen, nDepth, - qPixmap.handle(), qPixmap.x11Screen(), qPixmap.x11Depth(), - aTmpGC, - qWidgetPos.x(), qWidgetPos.y(), qRect.width(), qRect.height(), - 0, 0 ); + X11SalGraphics::CopyScreenArea( + dpy, + drawable, nXScreen, nDepth, + qPixmap.handle(), SalX11Screen( qPixmap.x11Screen() ), qPixmap.x11Depth(), + aTmpGC, + qWidgetPos.x(), qWidgetPos.y(), qRect.width(), qRect.height(), + 0, 0 ); XFreeGC( dpy, aTmpGC ); kapp->style().drawControl( QStyle::CE_RadioButton, @@ -779,12 +781,12 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, return sal_False; // Bitblt it to the screen - X11SalGraphics::CopyScreenArea( dpy, - qPixmap.handle(), qPixmap.x11Screen(), qPixmap.x11Depth(), - drawable, nScreen, nDepth, - gc, - 0, 0, qRect.width(), qRect.height(), - qWidgetPos.x(), qWidgetPos.y() ); + X11SalGraphics::CopyScreenArea( + dpy, qPixmap.handle(), SalX11Screen( qPixmap.x11Screen() ), qPixmap.x11Depth(), + drawable, nXScreen, nDepth, + gc, + 0, 0, qRect.width(), qRect.height(), + qWidgetPos.x(), qWidgetPos.y() ); // Restore widget's position pWidget->move( qWidgetPos ); diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx index a5fb4613a534..f30d873dad91 100644 --- a/vcl/unx/x11/x11sys.cxx +++ b/vcl/unx/x11/x11sys.cxx @@ -57,20 +57,21 @@ X11SalSystem::~X11SalSystem() unsigned int X11SalSystem::GetDisplayScreenCount() { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); - return pSalDisp->IsXinerama() ? pSalDisp->GetXineramaScreens().size() : pSalDisp->GetScreenCount(); + return pSalDisp->IsXinerama() ? pSalDisp->GetXineramaScreens().size() : + pSalDisp->GetXScreenCount(); } bool X11SalSystem::IsUnifiedDisplay() { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); - unsigned int nScreenCount = pSalDisp->GetScreenCount(); + unsigned int nScreenCount = pSalDisp->GetXScreenCount(); return pSalDisp->IsXinerama() ? true : (nScreenCount == 1); } unsigned int X11SalSystem::GetDisplayDefaultScreen() { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); - return pSalDisp->GetDefaultScreenNumber(); + return pSalDisp->GetDefaultXScreen().getXScreen(); } Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) @@ -85,7 +86,8 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) } else { - const SalDisplay::ScreenData& rScreen = pSalDisp->getDataForScreen( nScreen ); + const SalDisplay::ScreenData& rScreen = + pSalDisp->getDataForScreen( SalX11Screen( nScreen ) ); aRet = Rectangle( Point( 0, 0 ), rScreen.m_aSize ); } @@ -116,7 +118,7 @@ rtl::OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen ) } else { - if( nScreen >= static_cast<unsigned int>(pSalDisp->GetScreenCount()) ) + if( nScreen >= static_cast<unsigned int>(pSalDisp->GetXScreenCount()) ) nScreen = 0; rtl::OUStringBuffer aBuf( 256 ); aBuf.append( rtl::OStringToOUString( rtl::OString( DisplayString( pSalDisp->GetDisplay() ) ), osl_getThreadTextEncoding() ) ); diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 977cf1b65018..591e2ecda4bd 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -932,7 +932,7 @@ void WinSalFrame::updateScreenNumber() if( rMonitors[i].m_aArea.IsInside( aPoint ) ) { mnDisplay = static_cast<sal_Int32>(i); - maGeometry.nScreenNumber = static_cast<unsigned int>(i); + maGeometry.nDisplayScreenNumber = static_cast<unsigned int>(i); } } } @@ -1900,7 +1900,7 @@ void WinSalFrame::SetScreenNumber( unsigned int nNewScreen ) } } mnDisplay = nNewScreen; - maGeometry.nScreenNumber = nNewScreen; + maGeometry.nDisplayScreenNumber = nNewScreen; SetPosSize( aNewMonPos.X() + (maGeometry.nX - aOldMonPos.X()), aNewMonPos.Y() + (maGeometry.nY - aOldMonPos.Y()), 0, 0, |