summaryrefslogtreecommitdiff
path: root/vcl/source/window/brdwin.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-18 18:27:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 12:56:51 +0200
commit9090dc1f3b27195f5defd35586ac79357992be21 (patch)
treed39f4b624ae337d5c9ce76eba8521b76e53afa05 /vcl/source/window/brdwin.cxx
parentc8cf2e0e088b74afa52564945a9c005b3b86bf7e (diff)
split OutputDevice from Window
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/brdwin.cxx')
-rw-r--r--vcl/source/window/brdwin.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index ec1e95c9db46..e343a7bd4ae1 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -155,13 +155,13 @@ void ImplBorderWindowView::ImplInitTitle(ImplBorderFrameData* pData)
{
if (pData->mnTitleType == BorderWindowTitleType::Small)
{
- pBorderWindow->SetPointFont(*pBorderWindow, rStyleSettings.GetFloatTitleFont() );
+ pBorderWindow->SetPointFont(*pBorderWindow->GetOutDev(), rStyleSettings.GetFloatTitleFont() );
pData->mnTitleHeight = rStyleSettings.GetFloatTitleHeight();
}
else // pData->mnTitleType == BorderWindowTitleType::Normal
{
// FIXME RenderContext
- pBorderWindow->SetPointFont(*pBorderWindow, rStyleSettings.GetTitleFont());
+ pBorderWindow->SetPointFont(*pBorderWindow->GetOutDev(), rStyleSettings.GetTitleFont());
pData->mnTitleHeight = rStyleSettings.GetTitleHeight();
}
tools::Long nTextHeight = pBorderWindow->GetTextHeight();
@@ -398,10 +398,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, tools::Long nWidth, to
mnHeight = nHeight;
mbNWFBorder = false;
- vcl::Window *pWin = nullptr, *pCtrl = nullptr;
- if (mpOutDev->GetOutDevType() == OUTDEV_WINDOW)
- pWin = static_cast<vcl::Window*>(mpOutDev.get());
-
+ vcl::Window *pWin = mpOutDev->GetOwnerWindow();
+ vcl::Window *pCtrl = nullptr;
if (pWin)
pCtrl = mpBorderWindow->GetWindow(GetWindowType::Client);
@@ -705,7 +703,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, c
{
Edit* pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
if (pEdit && !pEdit->SupportsDoubleBuffering())
- pCtrl->Paint(*pCtrl, tools::Rectangle()); // make sure the buttons are also drawn as they might overwrite the border
+ pCtrl->Paint(*pCtrl->GetOutDev(), tools::Rectangle()); // make sure the buttons are also drawn as they might overwrite the border
}
}
@@ -1735,7 +1733,7 @@ void ImplBorderWindow::Resize()
PosSizeFlags::Width | PosSizeFlags::Height );
// UpdateView
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
InvalidateBorder();
Window::Resize();
@@ -1783,7 +1781,7 @@ void ImplBorderWindow::InitView()
else
mpBorderView.reset(new ImplStdBorderWindowView( this ));
Size aSize = GetOutputSizePixel();
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
}
void ImplBorderWindow::UpdateView( bool bNewView, const Size& rNewOutSize )
@@ -1806,7 +1804,7 @@ void ImplBorderWindow::UpdateView( bool bNewView, const Size& rNewOutSize )
mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
aSize.AdjustWidth(nLeftBorder+nRightBorder );
aSize.AdjustHeight(nTopBorder+nBottomBorder );
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
}
vcl::Window* pClientWindow = ImplGetClientWindow();
@@ -1887,7 +1885,7 @@ void ImplBorderWindow::SetCloseButton()
{
SetStyle( GetStyle() | WB_CLOSEABLE );
Size aSize = GetOutputSizePixel();
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
InvalidateBorder();
}
@@ -1895,7 +1893,7 @@ void ImplBorderWindow::SetDockButton( bool bDockButton )
{
mbDockBtn = bDockButton;
Size aSize = GetOutputSizePixel();
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
InvalidateBorder();
}
@@ -1903,7 +1901,7 @@ void ImplBorderWindow::SetHideButton( bool bHideButton )
{
mbHideBtn = bHideButton;
Size aSize = GetOutputSizePixel();
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
InvalidateBorder();
}
@@ -1911,7 +1909,7 @@ void ImplBorderWindow::SetMenuButton( bool bMenuButton )
{
mbMenuBtn = bMenuButton;
Size aSize = GetOutputSizePixel();
- mpBorderView->Init( this, aSize.Width(), aSize.Height() );
+ mpBorderView->Init( GetOutDev(), aSize.Width(), aSize.Height() );
InvalidateBorder();
}