sd/source/ui/dlg/present.cxx | 8 +- unusedcode.easy | 1 vcl/aqua/source/app/salsys.cxx | 14 ---- vcl/headless/svpdummies.cxx | 14 ---- vcl/inc/aqua/salsys.h | 6 - vcl/inc/headless/svpdummies.hxx | 6 - vcl/inc/ios/salsys.h | 6 - vcl/inc/salsys.hxx | 18 ++--- vcl/inc/unx/gtk/gtkdata.hxx | 5 - vcl/inc/unx/gtk/gtksys.hxx | 8 +- vcl/inc/unx/saldisp.hxx | 6 - vcl/inc/unx/x11/x11sys.hxx | 10 +-- vcl/inc/vcl/svapp.hxx | 29 +++++---- vcl/inc/vcl/syswin.hxx | 8 +- vcl/inc/win/salsys.h | 7 -- vcl/ios/source/app/salsys.cxx | 14 ---- vcl/source/app/svapp.cxx | 18 ++--- vcl/source/components/display.cxx | 66 ++++++++++---------- vcl/source/window/floatwin.cxx | 2 vcl/source/window/menu.cxx | 2 vcl/source/window/syswin.cxx | 4 - vcl/unx/generic/app/saldisp.cxx | 120 -------------------------------------- vcl/unx/gtk/app/gtksys.cxx | 10 +-- vcl/unx/gtk/window/gtkframe.cxx | 2 vcl/unx/x11/x11sys.cxx | 10 +-- vcl/win/source/app/salinfo.cxx | 6 - 26 files changed, 119 insertions(+), 281 deletions(-)
New commits: commit 10b10580c46a69d25e987212bb127787300b871e Author: Michael Meeks <michael.me...@suse.com> Date: Sat Jan 14 11:28:22 2012 +0000 vcl: rename methods to crisp up a 'DisplayScreen' naming concept diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx index 0c67ccf..8a371d6 100644 --- a/vcl/aqua/source/app/salsys.cxx +++ b/vcl/aqua/source/app/salsys.cxx @@ -70,7 +70,7 @@ Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return aRet; } -Rectangle AquaSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +Rectangle AquaSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) { NSArray* pScreens = [NSScreen screens]; Rectangle aRet; @@ -89,7 +89,7 @@ Rectangle AquaSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) return aRet; } -rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen ) +rtl::OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen ) { NSArray* pScreens = [NSScreen screens]; OUString aRet; diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx index 74d9fc0..a4125f9 100644 --- a/vcl/headless/svpdummies.cxx +++ b/vcl/headless/svpdummies.cxx @@ -78,12 +78,12 @@ Rectangle SvpSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return aRect; } -Rectangle SvpSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +Rectangle SvpSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) { return GetDisplayScreenPosSizePixel( nScreen ); } -rtl::OUString SvpSalSystem::GetScreenName( unsigned int nScreen ) +rtl::OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen ) { rtl::OUStringBuffer aBuf( 32 ); aBuf.appendAscii( "VirtualScreen " ); diff --git a/vcl/inc/aqua/salsys.h b/vcl/inc/aqua/salsys.h index bc09765..6491cab 100644 --- a/vcl/inc/aqua/salsys.h +++ b/vcl/inc/aqua/salsys.h @@ -46,9 +46,9 @@ public: // get info about the display virtual unsigned int GetDisplayScreenCount(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx index 045214e..e1fb22c 100644 --- a/vcl/inc/headless/svpdummies.hxx +++ b/vcl/inc/headless/svpdummies.hxx @@ -82,8 +82,8 @@ class SvpSalSystem : public SalSystem // get info about the display virtual unsigned int GetDisplayScreenCount(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h index 81522e8..48ccfab 100644 --- a/vcl/inc/ios/salsys.h +++ b/vcl/inc/ios/salsys.h @@ -40,9 +40,9 @@ public: // get info about the display virtual unsigned int GetDisplayScreenCount(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual int ShowNativeMessageBox( const String& rTitle, const String& rMessage, int nButtonCombination, diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx index 24af20a..ea95234 100644 --- a/vcl/inc/salsys.hxx +++ b/vcl/inc/salsys.hxx @@ -57,11 +57,9 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES = 6; const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7; - // ------------- // - SalSystem - // ------------- - class VCL_PLUGIN_PUBLIC SalSystem { public: @@ -88,7 +86,7 @@ public: @returns the default screen number */ - virtual unsigned int GetDefaultDisplayNumber() { return 0; } + virtual unsigned int GetDisplayDefaultScreen() { return 0; } /* Gets relative position and size of the screens attached to the display @param nScreen @@ -106,7 +104,7 @@ public: @returns position and size relative to the scree */ - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) = 0; + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) = 0; /* Gets the name of a screen @param nScreen @@ -114,7 +112,7 @@ public: @returns the name of the screen */ - virtual rtl::OUString GetScreenName( unsigned int nScreen ) = 0; + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ) = 0; /* Shows a native message box with the specified title, message and button combination. diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index cbd1341..ced4d16 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -155,7 +155,7 @@ public: virtual int CaptureMouse( SalFrame* pFrame ); #if GTK_CHECK_VERSION(3,0,0) - int GetDefaultScreenNumber() { return m_pSys->GetDefaultDisplayNumber(); } + int GetDefaultScreenNumber() { return m_pSys->GetDisplayDefaultScreen(); } int GetScreenCount() { return m_pSys->GetDisplayScreenCount(); } Size GetScreenSize( int screen ); #endif diff --git a/vcl/inc/unx/gtk/gtksys.hxx b/vcl/inc/unx/gtk/gtksys.hxx index 4836f8b..784623b 100644 --- a/vcl/inc/unx/gtk/gtksys.hxx +++ b/vcl/inc/unx/gtk/gtksys.hxx @@ -43,10 +43,10 @@ public: virtual bool IsUnifiedDisplay(); virtual unsigned int GetDisplayScreenCount(); - virtual unsigned int GetDefaultDisplayNumber(); - virtual rtl::OUString GetScreenName (unsigned int nScreen); + virtual unsigned int GetDisplayDefaultScreen(); + virtual rtl::OUString GetDisplayScreenName (unsigned int nScreen); virtual Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen); - virtual Rectangle GetDisplayWorkAreaPosSizePixel (unsigned int nScreen); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen); virtual int ShowNativeDialog (const rtl::OUString& rTitle, const rtl::OUString& rMessage, const std::list< rtl::OUString >& rButtons, diff --git a/vcl/inc/unx/x11/x11sys.hxx b/vcl/inc/unx/x11/x11sys.hxx index d030d84..8a36d3e 100644 --- a/vcl/inc/unx/x11/x11sys.hxx +++ b/vcl/inc/unx/x11/x11sys.hxx @@ -45,10 +45,10 @@ public: // overload pure virtual methods virtual unsigned int GetDisplayScreenCount(); virtual bool IsUnifiedDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); - virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual unsigned int GetDisplayDefaultScreen(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual int ShowNativeDialog( const rtl::OUString& rTitle, const rtl::OUString& rMessage, const std::list< rtl::OUString >& rButtons, diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 3bdfd90..ba33ee2 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -292,11 +292,11 @@ public: // if IsUnifiedDisplay() == true the return value will be // nearest screen of the target rectangle // in case of IsUnifiedDisplay() == false the return value - // will always be GetDefaultDisplayNumber() + // will always be GetDisplayDefaultScreen() SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& ); SAL_DLLPRIVATE static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen ); - SAL_DLLPRIVATE static unsigned int GetDefaultDisplayNumber(); - SAL_DLLPRIVATE static rtl::OUString GetScreenName( unsigned int nScreen ); + SAL_DLLPRIVATE static unsigned int GetDisplayDefaultScreen(); + SAL_DLLPRIVATE static rtl::OUString GetDisplayScreenName( unsigned int nScreen ); static const LocaleDataWrapper& GetAppLocaleDataWrapper(); diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index 19cce93..832ebd2 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -241,10 +241,10 @@ public: /** Returns the screen number the window is on - The screen number is counted the same way that + The Display Screen number is counted the same way that <code>Application::GetScreenPosSizePixel</code>, <code>Application::GetWorkAreaPosSizePixel</code>, - <code>Application::GetScreenName</code> + <code>Application::GetDisplayScreenName</code> and of course <code>SystemWindow::SetScreenNumber</code> are counted in. @@ -263,10 +263,10 @@ public: Move the Window to a new screen. The same rules for positioning apply as in <code>SystemWindow::GetScreenNumber</code> - The screen number is counted the same way that + The Display Screen number is counted the same way that <code>Application::GetScreenPosSizePixel</code>, <code>Application::GetWorkAreaPosSizePixel</code>, - <code>Application::GetScreenName</code> + <code>Application::GetDisplayScreenName</code> and of course <code>SystemWindow::GetScreenNumber</code> are counted in. diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h index 8eb002a..7bd092c 100644 --- a/vcl/inc/win/salsys.h +++ b/vcl/inc/win/salsys.h @@ -69,10 +69,10 @@ public: virtual ~WinSalSystem(); virtual unsigned int GetDisplayScreenCount(); - virtual unsigned int GetDefaultDisplayNumber(); + virtual unsigned int GetDisplayDefaultScreen(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx index 92114c5..3a517ba 100644 --- a/vcl/ios/source/app/salsys.cxx +++ b/vcl/ios/source/app/salsys.cxx @@ -70,7 +70,7 @@ Rectangle IosSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return aRet; } -Rectangle IosSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +Rectangle IosSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) { NSArray* pScreens = [UIScreen screens]; Rectangle aRet; @@ -89,7 +89,7 @@ Rectangle IosSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) return aRet; } -rtl::OUString IosSalSystem::GetScreenName( unsigned int nScreen ) +rtl::OUString IosSalSystem::GetDisplayScreenName( unsigned int nScreen ) { NSArray* pScreens = [UIScreen screens]; OUString aRet; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 4df93e8..f3e3fc2 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1252,10 +1252,10 @@ unsigned int Application::GetScreenCount() return pSys ? pSys->GetDisplayScreenCount() : 0; } -rtl::OUString Application::GetScreenName( unsigned int nScreen ) +rtl::OUString Application::GetDisplayScreenName( unsigned int nScreen ) { SalSystem* pSys = ImplGetSalSystem(); - return pSys ? pSys->GetScreenName( nScreen ) : rtl::OUString(); + return pSys ? pSys->GetDisplayScreenName( nScreen ) : rtl::OUString(); } bool Application::IsUnifiedDisplay() @@ -1264,10 +1264,10 @@ bool Application::IsUnifiedDisplay() return pSys ? pSys->IsUnifiedDisplay() : true; } -unsigned int Application::GetDefaultDisplayNumber() +unsigned int Application::GetDisplayDefaultScreen() { SalSystem* pSys = ImplGetSalSystem(); - return pSys ? pSys->GetDefaultDisplayNumber() : 0; + return pSys ? pSys->GetDisplayDefaultScreen() : 0; } Rectangle Application::GetScreenPosSizePixel( unsigned int nScreen ) @@ -1279,7 +1279,7 @@ Rectangle Application::GetScreenPosSizePixel( unsigned int nScreen ) Rectangle Application::GetWorkAreaPosSizePixel( unsigned int nScreen ) { SalSystem* pSys = ImplGetSalSystem(); - return pSys ? pSys->GetDisplayWorkAreaPosSizePixel( nScreen ) : Rectangle(); + return pSys ? pSys->GetDisplayScreenWorkAreaPosSizePixel( nScreen ) : Rectangle(); } namespace { @@ -1296,7 +1296,7 @@ unsigned long calcDistSquare( const Point& i_rPoint, const Rectangle& i_rRect ) unsigned int Application::GetBestScreen( const Rectangle& i_rRect ) { if( !IsUnifiedDisplay() ) - return GetDefaultDisplayNumber(); + return GetDisplayDefaultScreen(); const unsigned int nScreens = GetScreenCount(); unsigned int nBestMatchScreen = 0; diff --git a/vcl/source/components/display.cxx b/vcl/source/components/display.cxx index 2451620..60870e3 100644 --- a/vcl/source/components/display.cxx +++ b/vcl/source/components/display.cxx @@ -55,7 +55,7 @@ namespace vcl class DisplayInfo : public ::cppu::WeakAggImplHelper3< XPropertySet, XPropertySetInfo, XServiceInfo > { public: - DisplayInfo( sal_uInt32 nDisplay ); + DisplayInfo( sal_uInt32 nDisplayScreen ); // XPropertySet virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (RuntimeException); @@ -77,7 +77,7 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException); private: - sal_uInt32 mnDisplay; + sal_uInt32 mnDisplayScreen; }; static const char* pScreenAreaName = "ScreenArea"; @@ -86,8 +86,8 @@ static const char* pScreenName = "ScreenName"; // -------------------------------------------------------------------- -DisplayInfo::DisplayInfo( sal_uInt32 nDisplay ) -: mnDisplay( nDisplay ) +DisplayInfo::DisplayInfo( sal_uInt32 nDisplayScreen ) +: mnDisplayScreen( nDisplayScreen ) { } @@ -107,15 +107,15 @@ Any SAL_CALL DisplayInfo::getPropertyValue( const OUString& PropertyName ) throw Rectangle aRect; if( PropertyName.equalsAscii( pScreenAreaName ) ) { - aRect = Application::GetScreenPosSizePixel( mnDisplay ); + aRect = Application::GetScreenPosSizePixel( mnDisplayScreen ); } else if( PropertyName.equalsAscii( pWorkAreaName ) ) { - aRect = Application::GetWorkAreaPosSizePixel( mnDisplay ); + aRect = Application::GetWorkAreaPosSizePixel( mnDisplayScreen ); } else if( PropertyName.equalsAscii( pScreenName ) ) { - return Any( Application::GetScreenName( mnDisplay ) ); + return Any( Application::GetDisplayScreenName( mnDisplayScreen ) ); } else throw UnknownPropertyException(); @@ -252,7 +252,7 @@ Any SAL_CALL DisplayAccess::getPropertyValue( const OUString& PropertyName ) thr } else if( PropertyName.equalsAscii( pDefaultDisplayName ) ) { - aRet <<= sal_Int32( Application::GetDefaultDisplayNumber() ); + aRet <<= sal_Int32( Application::GetDisplayDefaultScreen() ); } else throw UnknownPropertyException(); diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index 98c012a..9ce1671 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -153,7 +153,7 @@ static int _get_primary_monitor (GdkScreen *pScreen) } } // end anonymous namespace -unsigned int GtkSalSystem::GetDefaultDisplayNumber() +unsigned int GtkSalSystem::GetDisplayDefaultScreen() { GdkScreen *pDefault = gdk_display_get_default_screen (mpDisplay); int idx = getScreenIdxFromPtr (mpDisplay, pDefault); @@ -172,7 +172,7 @@ Rectangle GtkSalSystem::GetDisplayScreenPosSizePixel (unsigned int nScreen) return Rectangle (aRect.x, aRect.y, aRect.width, aRect.height); } -Rectangle GtkSalSystem::GetDisplayWorkAreaPosSizePixel (unsigned int nScreen) +Rectangle GtkSalSystem::GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen) { // FIXME: in theory we need extra code here to collect // the work area, ignoring fixed panels etc. on the screen. @@ -180,7 +180,7 @@ Rectangle GtkSalSystem::GetDisplayWorkAreaPosSizePixel (unsigned int nScreen) return GetDisplayScreenPosSizePixel( nScreen ); } -rtl::OUString GtkSalSystem::GetScreenName(unsigned int nScreen) +rtl::OUString GtkSalSystem::GetDisplayScreenName(unsigned int nScreen) { gchar *pStr; gint nMonitor; diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx index c2c7388..a5fb461 100644 --- a/vcl/unx/x11/x11sys.cxx +++ b/vcl/unx/x11/x11sys.cxx @@ -67,7 +67,7 @@ bool X11SalSystem::IsUnifiedDisplay() return pSalDisp->IsXinerama() ? true : (nScreenCount == 1); } -unsigned int X11SalSystem::GetDefaultDisplayNumber() +unsigned int X11SalSystem::GetDisplayDefaultScreen() { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); return pSalDisp->GetDefaultScreenNumber(); @@ -92,13 +92,13 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return aRet; } -Rectangle X11SalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +Rectangle X11SalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) { // FIXME: workareas return GetDisplayScreenPosSizePixel( nScreen ); } -rtl::OUString X11SalSystem::GetScreenName( unsigned int nScreen ) +rtl::OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen ) { rtl::OUString aScreenName; SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx index d6410b8..3d3f487 100644 --- a/vcl/win/source/app/salinfo.cxx +++ b/vcl/win/source/app/salinfo.cxx @@ -184,7 +184,7 @@ bool WinSalSystem::IsMultiDisplay() return false; } -unsigned int WinSalSystem::GetDefaultDisplayNumber() +unsigned int WinSalSystem::GetDisplayDefaultScreen() { initMonitors(); return m_nPrimary; @@ -196,13 +196,13 @@ Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle(); } -Rectangle WinSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +Rectangle WinSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) { initMonitors(); return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aWorkArea : Rectangle(); } -rtl::OUString WinSalSystem::GetScreenName( unsigned int nScreen ) +rtl::OUString WinSalSystem::GetDisplayScreenName( unsigned int nScreen ) { initMonitors(); return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aName : rtl::OUString(); commit ca93d98343a03026c7568abc2ddda838f10fcbde Author: Michael Meeks <michael.me...@suse.com> Date: Sat Jan 14 10:31:40 2012 +0000 vcl: rename ambiguous IsMultiDisplay to IsUnifiedDisplay, and simplify diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index e4cb167..5e70326 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -199,13 +199,13 @@ void SdStartPresentationDlg::InitMonitorSettings() } else { - sal_Bool bMultiscreen = false; + sal_Bool bUnifiedDisplay = false; sal_Int32 nPrimaryIndex = 0; Reference< XPropertySet > xMonProps( xMultiMon, UNO_QUERY ); if( xMonProps.is() ) try { - const OUString sPropName1( RTL_CONSTASCII_USTRINGPARAM( "MultiDisplay" ) ); - xMonProps->getPropertyValue( sPropName1 ) >>= bMultiscreen; + const OUString sPropName1( RTL_CONSTASCII_USTRINGPARAM( "IsUnifiedDisplay" ) ); + xMonProps->getPropertyValue( sPropName1 ) >>= bUnifiedDisplay; const OUString sPropName2( RTL_CONSTASCII_USTRINGPARAM( "DefaultDisplay" ) ); xMonProps->getPropertyValue( sPropName2 ) >>= nPrimaryIndex; } @@ -222,7 +222,7 @@ void SdStartPresentationDlg::InitMonitorSettings() maLBMonitor.InsertEntry( aName ); } - if( !bMultiscreen ) + if( bUnifiedDisplay ) maLBMonitor.InsertEntry( msAllMonitors ); sal_Int32 nSelected = ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue(); diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx index d85f7ae..0c67ccf 100644 --- a/vcl/aqua/source/app/salsys.cxx +++ b/vcl/aqua/source/app/salsys.cxx @@ -51,16 +51,6 @@ unsigned int AquaSalSystem::GetDisplayScreenCount() return pScreens ? [pScreens count] : 1; } -bool AquaSalSystem::IsMultiDisplay() -{ - return false; -} - -unsigned int AquaSalSystem::GetDefaultDisplayNumber() -{ - return 0; -} - Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) { NSArray* pScreens = [NSScreen screens]; diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx index 60f5c21..74d9fc0 100644 --- a/vcl/headless/svpdummies.cxx +++ b/vcl/headless/svpdummies.cxx @@ -70,16 +70,6 @@ unsigned int SvpSalSystem::GetDisplayScreenCount() return 1; } -unsigned int SvpSalSystem::GetDefaultDisplayNumber() -{ - return 0; -} - -bool SvpSalSystem::IsMultiDisplay() -{ - return false; -} - Rectangle SvpSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) { Rectangle aRect; diff --git a/vcl/inc/aqua/salsys.h b/vcl/inc/aqua/salsys.h index dc8b6ca..bc09765 100644 --- a/vcl/inc/aqua/salsys.h +++ b/vcl/inc/aqua/salsys.h @@ -45,8 +45,6 @@ public: // get info about the display virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx index 54c7ef4..045214e 100644 --- a/vcl/inc/headless/svpdummies.hxx +++ b/vcl/inc/headless/svpdummies.hxx @@ -81,8 +81,6 @@ class SvpSalSystem : public SalSystem virtual ~SvpSalSystem(); // get info about the display virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); virtual rtl::OUString GetScreenName( unsigned int nScreen ); diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h index e586c8d..81522e8 100644 --- a/vcl/inc/ios/salsys.h +++ b/vcl/inc/ios/salsys.h @@ -39,8 +39,6 @@ public: // get info about the display virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx index 1a53ec9..24af20a 100644 --- a/vcl/inc/salsys.hxx +++ b/vcl/inc/salsys.hxx @@ -75,20 +75,20 @@ public: @returns the number of active screens */ virtual unsigned int GetDisplayScreenCount() = 0; - /* Queries whether multiple screens are truly separate + /* Queries whether multiple screens are part of one bigger display - @returns true if screens are distinct and windows cannot - be moved between them or span multiple of them - false if screens form up one big display + @returns true if screens form one bug display + false if screens are distinct and windows cannot + be moved between, or span multiple screens */ - virtual bool IsMultiDisplay() = 0; + virtual bool IsUnifiedDisplay() { return true; } /* Queries the default screen number. The default screen is the screen on which windows will appear if no special positioning is made. @returns the default screen number */ - virtual unsigned int GetDefaultDisplayNumber() = 0; + virtual unsigned int GetDefaultDisplayNumber() { return 0; } /* Gets relative position and size of the screens attached to the display @param nScreen diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 2b5627c..cbd1341 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -155,7 +155,6 @@ public: virtual int CaptureMouse( SalFrame* pFrame ); #if GTK_CHECK_VERSION(3,0,0) - bool IsXinerama() { return !m_pSys->IsMultiDisplay(); } int GetDefaultScreenNumber() { return m_pSys->GetDefaultDisplayNumber(); } int GetScreenCount() { return m_pSys->GetDisplayScreenCount(); } Size GetScreenSize( int screen ); diff --git a/vcl/inc/unx/gtk/gtksys.hxx b/vcl/inc/unx/gtk/gtksys.hxx index c310e17..4836f8b 100644 --- a/vcl/inc/unx/gtk/gtksys.hxx +++ b/vcl/inc/unx/gtk/gtksys.hxx @@ -41,7 +41,7 @@ public: virtual ~GtkSalSystem(); static GtkSalSystem *GetSingleton(); - virtual bool IsMultiDisplay(); + virtual bool IsUnifiedDisplay(); virtual unsigned int GetDisplayScreenCount(); virtual unsigned int GetDefaultDisplayNumber(); virtual rtl::OUString GetScreenName (unsigned int nScreen); diff --git a/vcl/inc/unx/x11/x11sys.hxx b/vcl/inc/unx/x11/x11sys.hxx index 403625f..d030d84 100644 --- a/vcl/inc/unx/x11/x11sys.hxx +++ b/vcl/inc/unx/x11/x11sys.hxx @@ -44,7 +44,7 @@ public: // overload pure virtual methods virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); + virtual bool IsUnifiedDisplay(); virtual unsigned int GetDefaultDisplayNumber(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index a111e3f..3bdfd90 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -282,16 +282,16 @@ public: static unsigned int GetScreenCount(); static Rectangle GetScreenPosSizePixel( unsigned int nScreen ); - // IsMultiDisplay returns: - // true: different screens are separate and windows cannot be moved - // between them (e.g. Xserver with multiple screens) - // false: screens form up one large display area + // IsUnifiedDisplay returns: + // true: screens form up one large display area // windows can be moved between single screens // (e.g. Xserver with Xinerama, Windows) - SAL_DLLPRIVATE static bool IsMultiDisplay(); - // if IsMultiDisplay() == false the return value will be + // false: different screens are separate and windows cannot be moved + // between them (e.g. Xserver with multiple screens) + SAL_DLLPRIVATE static bool IsUnifiedDisplay(); + // if IsUnifiedDisplay() == true the return value will be // nearest screen of the target rectangle - // in case of IsMultiDisplay() == true the return value + // in case of IsUnifiedDisplay() == false the return value // will always be GetDefaultDisplayNumber() SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& ); SAL_DLLPRIVATE static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen ); diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h index 30d5506..8eb002a 100644 --- a/vcl/inc/win/salsys.h +++ b/vcl/inc/win/salsys.h @@ -69,7 +69,6 @@ public: virtual ~WinSalSystem(); virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); virtual unsigned int GetDefaultDisplayNumber(); virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx index fbc7bb4..92114c5 100644 --- a/vcl/ios/source/app/salsys.cxx +++ b/vcl/ios/source/app/salsys.cxx @@ -51,16 +51,6 @@ unsigned int IosSalSystem::GetDisplayScreenCount() return pScreens ? [pScreens count] : 1; } -bool IosSalSystem::IsMultiDisplay() -{ - return false; -} - -unsigned int IosSalSystem::GetDefaultDisplayNumber() -{ - return 0; -} - Rectangle IosSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) { NSArray* pScreens = [UIScreen screens]; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 16381ea..4df93e8 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1258,10 +1258,10 @@ rtl::OUString Application::GetScreenName( unsigned int nScreen ) return pSys ? pSys->GetScreenName( nScreen ) : rtl::OUString(); } -bool Application::IsMultiDisplay() +bool Application::IsUnifiedDisplay() { SalSystem* pSys = ImplGetSalSystem(); - return pSys ? pSys->IsMultiDisplay() : false; + return pSys ? pSys->IsUnifiedDisplay() : true; } unsigned int Application::GetDefaultDisplayNumber() @@ -1295,7 +1295,7 @@ unsigned long calcDistSquare( const Point& i_rPoint, const Rectangle& i_rRect ) unsigned int Application::GetBestScreen( const Rectangle& i_rRect ) { - if( IsMultiDisplay() ) + if( !IsUnifiedDisplay() ) return GetDefaultDisplayNumber(); const unsigned int nScreens = GetScreenCount(); diff --git a/vcl/source/components/display.cxx b/vcl/source/components/display.cxx index 41368f7..2451620 100644 --- a/vcl/source/components/display.cxx +++ b/vcl/source/components/display.cxx @@ -58,7 +58,7 @@ public: DisplayInfo( sal_uInt32 nDisplay ); // XPropertySet - virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (RuntimeException); + virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (RuntimeException); virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException); virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); @@ -67,14 +67,14 @@ public: virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); // XPropertySetInfo - virtual Sequence< Property > SAL_CALL getProperties( ) throw (RuntimeException); + virtual Sequence< Property > SAL_CALL getProperties() throw (RuntimeException); virtual Property SAL_CALL getPropertyByName( const OUString& aName ) throw (UnknownPropertyException, RuntimeException); virtual ::sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw (RuntimeException); // XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException); + virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException); + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException); private: sal_uInt32 mnDisplay; @@ -92,7 +92,7 @@ DisplayInfo::DisplayInfo( sal_uInt32 nDisplay ) } // XPropertySet -Reference< XPropertySetInfo > SAL_CALL DisplayInfo::getPropertySetInfo( ) throw (RuntimeException) +Reference< XPropertySetInfo > SAL_CALL DisplayInfo::getPropertySetInfo() throw (RuntimeException) { return this; } @@ -129,7 +129,7 @@ void SAL_CALL DisplayInfo::addVetoableChangeListener( const OUString&, const Ref void SAL_CALL DisplayInfo::removeVetoableChangeListener( const OUString&, const Reference< XVetoableChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {} // XPropertySetInfo -Sequence< Property > SAL_CALL DisplayInfo::getProperties( ) throw (RuntimeException) +Sequence< Property > SAL_CALL DisplayInfo::getProperties() throw (RuntimeException) { Sequence< Property > aProps(2); aProps[0] = getPropertyByName( OUString::createFromAscii( pScreenAreaName ) ); @@ -152,7 +152,7 @@ Property SAL_CALL DisplayInfo::getPropertyByName( const OUString& aName ) throw } // XServiceInfo -OUString SAL_CALL DisplayInfo::getImplementationName( ) throw (RuntimeException) +OUString SAL_CALL DisplayInfo::getImplementationName() throw (RuntimeException) { return OUString(RTL_CONSTASCII_USTRINGPARAM("vcl::DisplayInfo")); } @@ -168,7 +168,7 @@ OUString SAL_CALL DisplayInfo::getImplementationName( ) throw (RuntimeException return sal_False; } -Sequence< OUString > SAL_CALL DisplayInfo::getSupportedServiceNames( ) throw (RuntimeException) +Sequence< OUString > SAL_CALL DisplayInfo::getSupportedServiceNames() throw (RuntimeException) { OUString aServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DisplayInfo")); return Sequence< OUString >(&aServiceName, 1); @@ -182,7 +182,7 @@ public: DisplayAccess (); // XPropertySet - virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (RuntimeException); + virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (RuntimeException); virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException); virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); @@ -191,7 +191,7 @@ public: virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException); // XPropertySetInfo - virtual Sequence< Property > SAL_CALL getProperties( ) throw (RuntimeException); + virtual Sequence< Property > SAL_CALL getProperties() throw (RuntimeException); virtual Property SAL_CALL getPropertyByName( const OUString& aName ) throw (UnknownPropertyException, RuntimeException); virtual ::sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw (RuntimeException); @@ -200,13 +200,13 @@ public: virtual Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException); // XElementAccess - virtual Type SAL_CALL getElementType( ) throw (RuntimeException); - virtual ::sal_Bool SAL_CALL hasElements( ) throw (RuntimeException); + virtual Type SAL_CALL getElementType() throw (RuntimeException); + virtual ::sal_Bool SAL_CALL hasElements() throw (RuntimeException); // XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException); + virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException); + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException); }; Sequence< OUString > DisplayAccess_getSupportedServiceNames() @@ -229,11 +229,11 @@ DisplayAccess::DisplayAccess() { } -static const char* pMultiDisplayName = "MultiDisplay"; +static const char* pUnifiedDisplayName = "IsUnifiedDisplay"; static const char* pDefaultDisplayName = "DefaultDisplay"; // XPropertySet -Reference< XPropertySetInfo > SAL_CALL DisplayAccess::getPropertySetInfo( ) throw (RuntimeException) +Reference< XPropertySetInfo > SAL_CALL DisplayAccess::getPropertySetInfo() throw (RuntimeException) { return this; } @@ -246,9 +246,9 @@ void SAL_CALL DisplayAccess::setPropertyValue( const OUString& /*aPropertyName* Any SAL_CALL DisplayAccess::getPropertyValue( const OUString& PropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { Any aRet; - if( PropertyName.equalsAscii( pMultiDisplayName ) ) + if( PropertyName.equalsAscii( pUnifiedDisplayName ) ) { - aRet <<= sal_Bool( Application::IsMultiDisplay() ); + aRet <<= sal_Bool( Application::IsUnifiedDisplay() ); } else if( PropertyName.equalsAscii( pDefaultDisplayName ) ) { @@ -266,17 +266,17 @@ void SAL_CALL DisplayAccess::addVetoableChangeListener( const OUString&, const R void SAL_CALL DisplayAccess::removeVetoableChangeListener( const OUString&, const Reference< XVetoableChangeListener >& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) {} // XPropertySetInfo -Sequence< Property > SAL_CALL DisplayAccess::getProperties( ) throw (RuntimeException) +Sequence< Property > SAL_CALL DisplayAccess::getProperties() throw (RuntimeException) { Sequence< Property > aProps(2); - aProps[0] = getPropertyByName( OUString::createFromAscii( pMultiDisplayName ) ); + aProps[0] = getPropertyByName( OUString::createFromAscii( pUnifiedDisplayName ) ); aProps[1] = getPropertyByName( OUString::createFromAscii( pDefaultDisplayName ) ); return aProps; } Property SAL_CALL DisplayAccess::getPropertyByName( const OUString& aName ) throw (UnknownPropertyException, RuntimeException) { - if( aName.equalsAscii( pMultiDisplayName ) ) + if( aName.equalsAscii( pUnifiedDisplayName ) ) return Property( aName, 0, ::getCppuType( (sal_Bool const *)0 ), PropertyAttribute::READONLY ); if( aName.equalsAscii( pDefaultDisplayName ) ) @@ -286,7 +286,7 @@ Property SAL_CALL DisplayAccess::getPropertyByName( const OUString& aName ) thro ::sal_Bool SAL_CALL DisplayAccess::hasPropertyByName( const OUString& Name ) throw (RuntimeException) { - return Name.equalsAscii( pMultiDisplayName ) || + return Name.equalsAscii( pUnifiedDisplayName ) || Name.equalsAscii( pDefaultDisplayName ); } @@ -305,7 +305,7 @@ Any SAL_CALL DisplayAccess::getByIndex( ::sal_Int32 Index ) throw (IndexOutOfBou } // XElementAccess -Type SAL_CALL DisplayAccess::getElementType( ) throw (RuntimeException) +Type SAL_CALL DisplayAccess::getElementType() throw (RuntimeException) { return XPropertySet::static_type(); } @@ -316,7 +316,7 @@ Type SAL_CALL DisplayAccess::getElementType( ) throw (RuntimeException) } // XServiceInfo -OUString SAL_CALL DisplayAccess::getImplementationName( ) throw (RuntimeException) +OUString SAL_CALL DisplayAccess::getImplementationName() throw (RuntimeException) { return DisplayAccess_getImplementationName(); } @@ -332,7 +332,7 @@ OUString SAL_CALL DisplayAccess::getImplementationName( ) throw (RuntimeExcepti return sal_False; } -Sequence< OUString > SAL_CALL DisplayAccess::getSupportedServiceNames( ) throw (RuntimeException) +Sequence< OUString > SAL_CALL DisplayAccess::getSupportedServiceNames() throw (RuntimeException) { return DisplayAccess_getSupportedServiceNames(); } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index d4e1b1f..32d7021 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -270,7 +270,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, if( bRTL ) // create a rect that can be compared to desktop coordinates devRectRTL = pW->ImplOutputToUnmirroredAbsoluteScreenPixel( normRect ); - if( Application::GetScreenCount() > 1 && ! Application::IsMultiDisplay() ) + if( Application::GetScreenCount() > 1 && Application::IsUnifiedDisplay() ) aScreenRect = Application::GetScreenPosSizePixel( Application::GetBestScreen( bRTL ? devRectRTL : devRect ) ); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index baa6bdb..15b5cac 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -3726,7 +3726,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong Size aSz = ImplCalcSize( pWin ); long nMaxHeight = pWin->GetDesktopRectPixel().GetHeight(); - if( Application::GetScreenCount() > 1 && ! Application::IsMultiDisplay() ) + if( Application::GetScreenCount() > 1 && Application::IsUnifiedDisplay() ) { Window* pDeskW = pWindow->GetWindow( WINDOW_REALPARENT ); if( ! pDeskW ) diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index c9f44f4..f087921 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -614,10 +614,8 @@ static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, Window* i_pConfigureWin ) { Rectangle aScreenRect; - if( Application::IsMultiDisplay() ) - { + if( !Application::IsUnifiedDisplay() ) aScreenRect = Application::GetScreenPosSizePixel( GetScreenNumber() ); - } else { aScreenRect = Application::GetScreenPosSizePixel( 0 ); diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index a5b134e..98c012a 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -104,9 +104,9 @@ unsigned int GtkSalSystem::GetDisplayScreenCount() return G_MAXINT - nMonitor; } -bool GtkSalSystem::IsMultiDisplay() +bool GtkSalSystem::IsUnifiedDisplay() { - return gdk_display_get_n_screens (mpDisplay) > 1; + return gdk_display_get_n_screens (mpDisplay) == 1; } namespace { diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx index 522aeec..c2c7388 100644 --- a/vcl/unx/x11/x11sys.cxx +++ b/vcl/unx/x11/x11sys.cxx @@ -60,11 +60,11 @@ unsigned int X11SalSystem::GetDisplayScreenCount() return pSalDisp->IsXinerama() ? pSalDisp->GetXineramaScreens().size() : pSalDisp->GetScreenCount(); } -bool X11SalSystem::IsMultiDisplay() +bool X11SalSystem::IsUnifiedDisplay() { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); unsigned int nScreenCount = pSalDisp->GetScreenCount(); - return pSalDisp->IsXinerama() ? false : (nScreenCount > 1); + return pSalDisp->IsXinerama() ? true : (nScreenCount == 1); } unsigned int X11SalSystem::GetDefaultDisplayNumber() commit e9202ffeccdf6f669184f3f869d2e5b121bea9f3 Author: Michael Meeks <michael.me...@suse.com> Date: Fri Jan 13 21:42:32 2012 +0000 Remove unused SalDisplay::IsLocal diff --git a/unusedcode.easy b/unusedcode.easy index b906bb9..7acfd21 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -194,7 +194,6 @@ SVGExport::GetGlyphPlacement() const SVGExport::IsUseGradient() const SVGExport::popClip() SVGExport::pushClip(basegfx::B2DPolyPolygon const&) -SalDisplay::IsLocal() SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, unsigned int, OutputDevice const*) SalGraphics::DrawNativeControlText(unsigned int, unsigned int, Rectangle const&, unsigned int, ImplControlValue const&, rtl::OUString const&, OutputDevice const*) SalGraphics::drawAlphaBitmap(SalTwoRect const&, SalBitmap const&, SalBitmap const&) diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 8fd0507..b8d6cd3 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -304,10 +304,6 @@ protected: srv_vendor_t meServerVendor; SalWM eWindowManager_; - sal_Bool bLocal_; // Server==Client? Init - // in SalDisplay::IsLocal() - sal_Bool mbLocalIsValid; // bLocal_ is valid ? - // until x bytes XLIB_Cursor aPointerCache_[POINTER_COUNT]; @@ -374,8 +370,6 @@ public: XLIB_Cursor GetPointer( int ePointerStyle ); virtual int CaptureMouse( SalFrame *pCapture ); - sal_Bool IsLocal(); - void Remove( XEvent *pEvent ); virtual void initScreen( int nScreen ) const; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 75882cc..aec8b53 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -227,122 +227,6 @@ static sal_Bool sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI } // --------------------------------------------------------------------------- - -// check wether displaystring is in format N.M or N. or just N -// with N and M beeing natural numbers -static sal_Bool -sal_IsDisplayNumber( const char *pDisplayString ) -{ - if ( ! isdigit(*pDisplayString) ) - return sal_False; - while ( isdigit(*(++pDisplayString)) ) - ; /* do nothing */ - - if ( *pDisplayString == '.' ) - { - while ( isdigit(*(++pDisplayString)) ) - ; /* do nothing */ - } - - return (*pDisplayString == '\0'); -} - -// check whether host1 and host2 point to the same ip address -static sal_Bool -sal_EqualHosts( const OUString& Host1, const OUString& Host2) -{ - oslSocketAddr pHostAddr1; - oslSocketAddr pHostAddr2; - sal_Bool bEqualAddress = sal_False; - - if ( Host1.toChar() >= '0' && Host1.toChar() <= '9' ) - pHostAddr1 = osl_createInetSocketAddr( Host1.pData, 0 ); - else - pHostAddr1 = osl_resolveHostname( Host1.pData ); - - if ( Host2.toChar() >= '0' && Host2.toChar() <= '9' ) - pHostAddr2 = osl_createInetSocketAddr( Host2.pData, 0 ); - else - pHostAddr2 = osl_resolveHostname( Host2.pData ); - - if( pHostAddr1 && pHostAddr2 ) - bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? sal_True : sal_False; - - if( pHostAddr1 ) - osl_destroySocketAddr( pHostAddr1 ); - if( pHostAddr2 ) - osl_destroySocketAddr( pHostAddr2 ); - - return bEqualAddress; -} - -static sal_Bool -sal_IsLocalDisplay( Display *pDisplay ) -{ - const char *pDisplayString = DisplayString( pDisplay ); - - // no string, no idea - if ( pDisplayString == NULL || pDisplayString[ 0 ] == '\0') - return sal_False; - - // check for ":x.y" - if ( pDisplayString[ 0 ] == ':' ) - return sal_IsDisplayNumber( pDisplayString + 1 ); - - // check for fixed token which all mean localhost:x.y - const char pLocal[] = "localhost:"; - const int nLocalLen = sizeof(pLocal) - 1; - if ( strncmp(pDisplayString, pLocal, nLocalLen) == 0 ) - return sal_IsDisplayNumber( pDisplayString + nLocalLen ); - - const char pUnix[] = "unix:"; - const int nUnixLen = sizeof(pUnix) - 1; - if ( strncmp(pDisplayString, pUnix, nUnixLen) == 0 ) - return sal_IsDisplayNumber( pDisplayString + nUnixLen ); - - const char pLoopback[] = "127.0.0.1:"; - const int nLoopbackLen= sizeof(pLoopback) - 1; - if ( strncmp(pDisplayString, pLoopback, nLoopbackLen) == 0 ) - return sal_IsDisplayNumber( pDisplayString + nLoopbackLen ); - - // compare local hostname to displaystring, both may be ip address or - // hostname - sal_Bool bEqual = sal_False; - char *pDisplayHost = strdup( pDisplayString ); - char *pPtr = strrchr( pDisplayHost, ':' ); - - if( pPtr != NULL ) - { - const OUString& rLocalHostname( GetGenericData()->GetHostname() ); - if( rLocalHostname.getLength() ) - { - *pPtr = '\0'; - OUString aDisplayHostname( pDisplayHost, strlen( pDisplayHost ), osl_getThreadTextEncoding() ); - bEqual = sal_EqualHosts( rLocalHostname, aDisplayHostname ); - bEqual = bEqual && sal_IsDisplayNumber( pPtr + 1 ); - } - } - free( pDisplayHost ); - - return bEqual; -} - -// --------------------------------------------------------------------------- -// IsLocal means soffice is running on the same host as the xserver -// since it is not called very often and sal_IsLocalDisplay() is relative -// expensive bLocal_ is initialized on first call - -sal_Bool SalDisplay::IsLocal() -{ - if ( ! mbLocalIsValid ) - { - bLocal_ = sal_IsLocalDisplay( pDisp_ ); - mbLocalIsValid = sal_True; - } - return (sal_Bool)bLocal_; -} - -// --------------------------------------------------------------------------- extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display ) { @@ -812,10 +696,6 @@ void SalDisplay::Init() SetServerVendor(); X11SalBitmap::ImplCreateCache(); - bLocal_ = sal_False; /* dont care, initialize later by - calling SalDisplay::IsLocal() */ - mbLocalIsValid = sal_False; /* bLocal_ is not yet initialized */ - // - - - - - - - - - - Synchronize - - - - - - - - - - - - - if( getenv( "SAL_SYNCHRONIZE" ) ) XSynchronize( pDisp_, True ); commit 3d13d919dfa7e0123dd6feebf2bd0a9883a4e866 Author: Michael Meeks <michael.me...@suse.com> Date: Fri Jan 13 21:37:43 2012 +0000 vcl: hide / make internal misc. vcl display handling methods. diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 6daf5c6..a111e3f 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -274,26 +274,29 @@ public: static String GetAppName(); static bool LoadBrandBitmap (const char* pName, BitmapEx &rBitmap); + // default name of the application for message dialogs and printing static void SetDisplayName( const UniString& rDisplayName ); static UniString GetDisplayName(); + static unsigned int GetScreenCount(); + static Rectangle GetScreenPosSizePixel( unsigned int nScreen ); + // IsMultiDisplay returns: // true: different screens are separate and windows cannot be moved // between them (e.g. Xserver with multiple screens) // false: screens form up one large display area // windows can be moved between single screens // (e.g. Xserver with Xinerama, Windows) - static bool IsMultiDisplay(); - static Rectangle GetScreenPosSizePixel( unsigned int nScreen ); - static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen ); - static rtl::OUString GetScreenName( unsigned int nScreen ); - static unsigned int GetDefaultDisplayNumber(); + SAL_DLLPRIVATE static bool IsMultiDisplay(); // if IsMultiDisplay() == false the return value will be // nearest screen of the target rectangle // in case of IsMultiDisplay() == true the return value // will always be GetDefaultDisplayNumber() - static unsigned int GetBestScreen( const Rectangle& ); + SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& ); + SAL_DLLPRIVATE static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen ); + SAL_DLLPRIVATE static unsigned int GetDefaultDisplayNumber(); + SAL_DLLPRIVATE static rtl::OUString GetScreenName( unsigned int nScreen ); static const LocaleDataWrapper& GetAppLocaleDataWrapper(); commit 0ac5eb5f14cc1bdb410846fba36aef8ab858a862 Author: Michael Meeks <michael.me...@suse.com> Date: Fri Jan 13 17:15:46 2012 +0000 vcl: isolate new attempt to count monitors as screens to gtk3 fdo#43458 It turns out this new idea of mapping xinerama screens, and xrandr monitors into a flat integer space is nice, but when we confuse xrandr monitor 2 (idx 1) with X screen 1 (there is only one screen) we bit the dust. Many thanks to Cor Nouws for remote debugging assistance diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 4f0d71c..2b5627c 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -154,10 +154,12 @@ public: GdkCursor *getCursor( PointerStyle ePointerStyle ); virtual int CaptureMouse( SalFrame* pFrame ); +#if GTK_CHECK_VERSION(3,0,0) bool IsXinerama() { return !m_pSys->IsMultiDisplay(); } int GetDefaultScreenNumber() { return m_pSys->GetDefaultDisplayNumber(); } int GetScreenCount() { return m_pSys->GetDisplayScreenCount(); } Size GetScreenSize( int screen ); +#endif virtual void initScreen( int nScreen ) const; GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event, diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 06d29d5..f778354 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -4160,10 +4160,12 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint return sal_False; } +#if GTK_CHECK_VERSION(3,0,0) Size GtkSalDisplay::GetScreenSize( int nScreen ) { Rectangle aRect = m_pSys->GetDisplayScreenPosSizePixel( nScreen ); return Size( aRect.GetWidth(), aRect.GetHeight() ); } +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits