remove Application::GetWorkAreaPosSizePixel

This internal API has always been problematic because we cannot
support it under the Linux toolkits, where it has in fact always
just returned the size of the screen.

Change-Id: I406bcbca8a4161b4261ef46940823bb07c6ad18b
Reviewed-on: https://gerrit.libreoffice.org/4976
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
This commit is contained in:
Noel Grandin 2013-07-19 08:20:14 +02:00 committed by Michael Meeks
parent 86b8b3b7e0
commit ab5eaec098
17 changed files with 3 additions and 82 deletions

View File

@ -892,7 +892,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
{
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay );
Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
awt::Rectangle aWindowRect = xHWindow->getPosSize();
if (( aWindowRect.Width < aWorkRect.GetWidth()) && ( aWindowRect.Height < aWorkRect.GetHeight() ))

View File

@ -2454,7 +2454,7 @@ sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContaine
// calculate the maximum size we have for the container window
sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
Rectangle aWorkArea = Application::GetWorkAreaPosSizePixel( nDisplay );
Rectangle aWorkArea = Application::GetScreenPosSizePixel( nDisplay );
if (( aWorkArea.GetWidth() > 0 ) && ( aWorkArea.GetHeight() > 0 ))
{

View File

@ -256,7 +256,6 @@ public:
// in case of IsUnifiedDisplay() == false the return value
// will always be GetDisplayDefaultScreen()
SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& );
static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen );
// This returns the LCD screen number for a laptop, or the primary
// external VGA display for a desktop machine - it is where a presenter
// console should be rendered if there are other (non-built-in) screens

View File

@ -228,7 +228,6 @@ public:
The Display Screen number is counted the same way that
<code>Application::GetScreenPosSizePixel</code>,
<code>Application::GetWorkAreaPosSizePixel</code>,
<code>Application::GetDisplayScreenName</code>
and of course <code>SystemWindow::SetScreenNumber</code>
are counted in.
@ -250,7 +249,6 @@ public:
The Display Screen number is counted the same way that
<code>Application::GetScreenPosSizePixel</code>,
<code>Application::GetWorkAreaPosSizePixel</code>,
<code>Application::GetDisplayScreenName</code>
and of course <code>SystemWindow::GetScreenNumber</code>
are counted in.

View File

@ -61,25 +61,6 @@ Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
return aRet;
}
Rectangle AquaSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
{
NSArray* pScreens = [NSScreen screens];
Rectangle aRet;
NSScreen* pScreen = nil;
if( pScreens && nScreen < [pScreens count] )
pScreen = [pScreens objectAtIndex: nScreen];
else
pScreen = [NSScreen mainScreen];
if( pScreen )
{
NSRect aFrame = [pScreen visibleFrame];
aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
}
return aRet;
}
OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen )
{
NSArray* pScreens = [NSScreen screens];

View File

@ -64,11 +64,6 @@ Rectangle SvpSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
return aRect;
}
Rectangle SvpSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
{
return GetDisplayScreenPosSizePixel( nScreen );
}
OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
{
return "VirtualScreen " + OUString::valueOf(sal_Int32(nScreen));

View File

@ -37,7 +37,6 @@ public:
// get info about the display
virtual unsigned int GetDisplayScreenCount();
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual OUString GetDisplayScreenName( unsigned int nScreen );
virtual int ShowNativeMessageBox( const OUString& rTitle,

View File

@ -66,7 +66,6 @@ public:
// get info about the display
virtual unsigned int GetDisplayScreenCount();
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual OUString GetDisplayScreenName( unsigned int nScreen );
virtual int ShowNativeDialog( const OUString& rTitle,

View File

@ -78,14 +78,6 @@ public:
size: size of the screen
*/
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
/* Gets position and size of the work area of a screen attached to the display
@param nScreen
The screen number to be queried
@returns position and size relative to the scree
*/
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) = 0;
/* Gets the name of a screen
@param nScreen

View File

@ -31,7 +31,6 @@ public:
virtual unsigned int GetDisplayBuiltInScreen();
virtual OUString GetDisplayScreenName (unsigned int nScreen);
virtual Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen);
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen);
virtual int ShowNativeDialog (const OUString& rTitle,
const OUString& rMessage,
const std::list< OUString >& rButtons,

View File

@ -37,7 +37,6 @@ public:
virtual bool IsUnifiedDisplay();
virtual unsigned int GetDisplayBuiltInScreen();
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual OUString GetDisplayScreenName( unsigned int nScreen );
virtual int ShowNativeDialog( const OUString& rTitle,
const OUString& rMessage,

View File

@ -33,19 +33,16 @@ class WinSalSystem : public SalSystem
OUString m_aName;
OUString m_aDeviceName;
Rectangle m_aArea;
Rectangle m_aWorkArea;
sal_Int32 m_nStateFlags;
DisplayMonitor() : m_nStateFlags( 0 ) {}
DisplayMonitor( const OUString& rName,
const OUString& rDevName,
const Rectangle& rArea,
const Rectangle& rWorkArea,
DWORD nStateFlags )
: m_aName( rName ),
m_aDeviceName( rDevName ),
m_aArea( rArea ),
m_aWorkArea( rWorkArea ),
m_nStateFlags( nStateFlags )
{
}
@ -62,7 +59,6 @@ public:
virtual unsigned int GetDisplayScreenCount();
virtual unsigned int GetDisplayBuiltInScreen();
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual OUString GetDisplayScreenName( unsigned int nScreen );
virtual int ShowNativeMessageBox( const OUString& rTitle,
const OUString& rMessage,

View File

@ -1322,12 +1322,6 @@ Rectangle Application::GetScreenPosSizePixel( unsigned int nScreen )
return pSys ? pSys->GetDisplayScreenPosSizePixel( nScreen ) : Rectangle();
}
Rectangle Application::GetWorkAreaPosSizePixel( unsigned int nScreen )
{
SalSystem* pSys = ImplGetSalSystem();
return pSys ? pSys->GetDisplayScreenWorkAreaPosSizePixel( nScreen ) : Rectangle();
}
namespace {
unsigned long calcDistSquare( const Point& i_rPoint, const Rectangle& i_rRect )
{

View File

@ -3710,7 +3710,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
if( ! pDeskW )
pDeskW = pWindow;
Point aDesktopTL( pDeskW->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) );
nMaxHeight = Application::GetWorkAreaPosSizePixel(
nMaxHeight = Application::GetScreenPosSizePixel(
Application::GetBestScreen( Rectangle( aDesktopTL, aRect.GetSize() ) )
).GetHeight();
}

View File

@ -246,14 +246,6 @@ Rectangle GtkSalSystem::GetDisplayScreenPosSizePixel (unsigned int nScreen)
return Rectangle (Point(aRect.x, aRect.y), Size(aRect.width, aRect.height));
}
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.
// surely gtk+ should have API to get this for us (?)
return GetDisplayScreenPosSizePixel( nScreen );
}
OUString GtkSalSystem::GetDisplayScreenName(unsigned int nScreen)
{
gchar *pStr;

View File

@ -84,12 +84,6 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
return aRet;
}
Rectangle X11SalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
{
// FIXME: workareas
return GetDisplayScreenPosSizePixel( nScreen );
}
OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen )
{
OUString aScreenName;

View File

@ -73,10 +73,6 @@ sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, s
aInfo.rcMonitor.top ),
Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left,
aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) );
rMon.m_aWorkArea = Rectangle( Point( aInfo.rcWork.left,
aInfo.rcWork.top ),
Size( aInfo.rcWork.right - aInfo.rcWork.left,
aInfo.rcWork.bottom - aInfo.rcWork.top ) );
if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 )
m_nPrimary = it->second;
}
@ -103,14 +99,9 @@ bool WinSalSystem::initMonitors()
m_aMonitors.push_back( DisplayMonitor( OUString(),
OUString(),
Rectangle( Point(), Size( w, h ) ),
Rectangle( Point(), Size( w, h ) ),
0 ) );
m_aDeviceNameToMonitor[ OUString() ] = 0;
m_nPrimary = 0;
RECT aWorkRect;
if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
aWorkRect.right, aWorkRect.bottom );
}
else
{
@ -135,7 +126,6 @@ bool WinSalSystem::initMonitors()
m_aMonitors.push_back( DisplayMonitor( aDeviceString,
aDeviceName,
Rectangle(),
Rectangle(),
aDev.StateFlags ) );
}
}
@ -182,12 +172,6 @@ Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle();
}
Rectangle WinSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
{
initMonitors();
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aWorkArea : Rectangle();
}
OUString WinSalSystem::GetDisplayScreenName( unsigned int nScreen )
{
initMonitors();