22#include <rtl/strbuf.hxx>
62#include <com/sun/star/accessibility/AccessibleRelation.hpp>
63#include <com/sun/star/accessibility/XAccessible.hpp>
64#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
65#include <com/sun/star/awt/XVclWindowPeer.hpp>
66#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
67#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
68#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
69#include <com/sun/star/rendering/CanvasFactory.hpp>
70#include <com/sun/star/rendering/XSpriteCanvas.hpp>
74#include <osl/diagnose.h>
77#include <boost/property_tree/ptree.hpp>
108 ImplInit( pParent, nStyle,
nullptr );
111#if OSL_DEBUG_LEVEL > 0
114 OString lcl_createWindowInfo(
const vcl::Window* pWindow)
128 return OString::Concat(
" ") +
129 typeid( *pWindow ).name() +
133 RTL_TEXTENCODING_UTF8
146 "vcl::Window child should have its parent disposed first" );
172 if(
p != rList.end() )
177 Reference < XComponent > xDnDComponent(
mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
179 if( xDnDComponent.is() )
180 xDnDComponent->dispose();
187 if(
mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
189 Reference< XDragGestureRecognizer > xDragGestureRecognizer(
mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
190 if( xDragGestureRecognizer.is() )
192 xDragGestureRecognizer->removeDragGestureListener(
193 Reference< XDragGestureListener > (
mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
196 mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener(
mpWindowImpl->mpFrameData->mxDropTargetListener );
197 mpWindowImpl->mpFrameData->mxDropTargetListener.clear();
201 Reference< XComponent > xComponent(
mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
205 if( xComponent.is() )
206 xComponent->dispose();
223 Reference< XComponent> xC(
mpWindowImpl->mxAccessible, UNO_QUERY );
234 "Window::~Window(): Window is in TrackingMode");
236 "Window::~Window(): Window has the mouse captured");
244#if OSL_DEBUG_LEVEL > 0
247 OStringBuffer aErrorStr;
253 OStringBuffer aTempStr =
"Window (" +
254 lcl_createWindowInfo(
this) +
255 ") with live children destroyed: ";
259 aTempStr.append(lcl_createWindowInfo(pTempWin));
262 OSL_FAIL( aTempStr.getStr() );
274 aErrorStr.append(lcl_createWindowInfo(pTempWin));
282 lcl_createWindowInfo(
this) +
283 ") with live SystemWindows destroyed: " +
285 OSL_FAIL(aTempStr.getStr());
297 aErrorStr.append(lcl_createWindowInfo(pTempWin));
299 pTempWin = pTempWin->
mpWindowImpl->mpFrameData->mpNextFrame;
303 OString aTempStr =
"Window (" +
304 lcl_createWindowInfo(
this) +
305 ") with live SystemWindows destroyed: " +
307 OSL_FAIL( aTempStr.getStr() );
313 OStringBuffer aTempStr =
"Window (" +
314 lcl_createWindowInfo(
this) +
315 ") with live SystemWindows destroyed: ";
319 aTempStr.append(lcl_createWindowInfo(pTempWin));
322 OSL_FAIL( aTempStr.getStr() );
339 OString aTempStr =
"Window (" +
340 lcl_createWindowInfo(
this) +
341 ") still in TaskPanelList!";
342 OSL_FAIL( aTempStr.getStr() );
367 SAL_WARN(
"vcl",
"Window (" <<
GetText() <<
") not found in TaskPanelList");
376 for (
auto const& mnemonicLabel : aMnemonicLabels)
393 bool bHasFocusedChild =
false;
397 bHasFocusedChild =
true;
398#if OSL_DEBUG_LEVEL > 0
399 OUString aTempStr =
"Window (" +
GetText() +
400 ") with focused child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !";
414 pOverlapWindow->
mpWindowImpl->mpLastFocusWindow =
nullptr;
439 pOverlapWindow->
mpWindowImpl->mpLastFocusWindow =
nullptr;
444 if ( pOverlapWindow !=
nullptr &&
445 pOverlapWindow->
mpWindowImpl->mpLastFocusWindow ==
this )
446 pOverlapWindow->
mpWindowImpl->mpLastFocusWindow =
nullptr;
461 if (
mpWindowImpl->mpFrameData->mpMouseMoveWin ==
this )
463 if (
mpWindowImpl->mpFrameData->mpMouseDownWin ==
this )
515 sal_Int32 nWindows = 0;
517 while ( pSysWin && pSysWin->
mpWindowImpl->mpFrameData->mpNextFrame.get() !=
this )
519 pSysWin = pSysWin->
mpWindowImpl->mpFrameData->mpNextFrame;
525 assert (
mpWindowImpl->mpFrameData->mpNextFrame.get() != pSysWin);
529 SAL_WARN(
"vcl.window",
"Window " <<
this <<
" marked as frame window, "
530 "is missing from list of " << nWindows <<
" frames");
537 assert (
mpWindowImpl->mpFrameData->mnFocusId ==
nullptr);
538 assert (
mpWindowImpl->mpFrameData->mnMouseMoveId ==
nullptr);
735 static bool bDoubleBuffer = getenv(
"VCL_DOUBLEBUFFERING_FORCE_ENABLE");
751 mnCompositionCharRects(0),
753 mnIsTopWindow(sal_uInt16(~0)),
755 mbEnableNativeWidget(false)
765 : maPaintIdle(
"vcl::Window maPaintIdle" ),
766 maResizeIdle(
"vcl::Window maResizeIdle" )
843 while ( pReleaseOutDev )
850 if ( pReleaseOutDev )
944 "Window::Window(): pParent == NULL" );
1052 if ( pSystemParentData )
1060 "Could not create system window!",
1061 Reference< XInterface >() );
1194 if ( nSymHeight > nTextWidth )
1195 nTextWidth = nSymHeight;
1196 else if ( nSymHeight+5 > nTextWidth )
1197 nTextWidth = nSymHeight+5;
1210 tools::Rectangle aCtrlRegion(
Point(),
Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) );
1215 aBoundingRgn, aContentRgn ) )
1219 if( aContentRgn.
GetHeight() - nTextHeight > (nTextHeight+4)/4 )
1230 static const char* pNoNWF = getenv(
"SAL_NO_NWF" );
1233 mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF);
1245 if (bWindowInvalidate)
1269 if (
this == &rSrcDev )
1270 pSrcDevChecked =
nullptr;
1272 pSrcDevChecked = &rSrcDev;
1274 pSrcDevChecked =
nullptr;
1276 pSrcDevChecked = &rSrcDev;
1278 return pSrcDevChecked;
1291 if (
mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics )
1293 mpWindowImpl->mpFrameWindow->GetOutDev()->mbInitClipRegion =
true;
1303 mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics->ResetClipRegion();
1304 return mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics;
1315 bool bBecameReallyVisible = !
mpWindowImpl->mbReallyVisible;
1419 bool bSysChild =
false;
1464 bool bNewPos =
false;
1465 bool bNewSize =
false;
1466 bool bCopyBits =
false;
1471 std::unique_ptr<vcl::Region> pOverlapRegion;
1472 std::unique_ptr<vcl::Region> pOldRegion;
1477 Size( nOldOutWidth, nOldOutHeight ) );
1478 pOldRegion.reset(
new vcl::Region( aOldWinRect ) );
1488 bool bnXRecycled =
false;
1500 if ( nWidth !=
GetOutDev()->mnOutWidth )
1511 if ( nHeight !=
GetOutDev()->mnOutHeight )
1556 if ( bCopyBits && !pOverlapRegion )
1560 *pOverlapRegion,
false,
true );
1573 if ( bCopyBits && !pOverlapRegion )
1577 *pOverlapRegion,
false,
true );
1585 if ( !(bNewPos || bNewSize) )
1588 bool bUpdateSysObjPos =
false;
1599 mpWindowImpl->mpClientWindow->mpWindowImpl->mnTopBorder,
1615 mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove =
true;
1641 bool bUpdateSysObjClip =
false;
1644 if ( bNewPos || bNewSize )
1651 if ( bNewPos || (
GetOutDev()->mnOutWidth > nOldOutWidth) || (
GetOutDev()->mnOutHeight > nOldOutHeight) )
1655 bool bInvalidate =
false;
1656 bool bParentPaint =
true;
1658 bParentPaint =
mpWindowImpl->mpParent->IsPaintEnabled();
1665 if ( !pOverlapRegion->IsEmpty() )
1667 pOverlapRegion->Move(
GetOutDev()->mnOutOffX - nOldOutOffX,
GetOutDev()->mnOutOffY - nOldOutOffY );
1668 aRegion.
Exclude( *pOverlapRegion );
1674 Size( nOldOutWidth, nOldOutHeight ) ),
1682 const bool bSelectClipRegion = pOutDev->
SelectClipRegion( aRegion, pGraphics );
1683 if ( bSelectClipRegion )
1686 nOldOutOffX, nOldOutOffY,
1687 nOldOutWidth, nOldOutHeight,
1697 if ( !pOverlapRegion->IsEmpty() )
1712 aRegion.
Exclude( *pOldRegion );
1723 (
GetOutDev()->mnOutWidth < nOldOutWidth) || (
GetOutDev()->mnOutHeight < nOldOutHeight) )
1735 if ( bUpdateSysObjClip )
1737 if ( bUpdateSysObjPos )
1752 if ( rInputContext == pFocusWin->
mpWindowImpl->mpFrameData->maOldInputContext )
1755 pFocusWin->
mpWindowImpl->mpFrameData->maOldInputContext = rInputContext;
1761 aNewContext.
mpFont =
nullptr;
1762 if (!rFontName.isEmpty())
1777 rFont, aSize,
static_cast<float>(aSize.
Height()) );
1778 if ( pFontInstance )
1779 aNewContext.
mpFont = pFontInstance;
1879 if ( rStr.isEmpty() )
1917 if( !aStrHelpId.isEmpty() )
1918 pHelp->
Start( aStrHelpId,
this );
2004 !
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame &&
2033 mpWindowImpl->mpBorderWindow->SetBorderStyle( nBorderStyle );
2093 std::unique_ptr<ExtTextInputAttr[]> pAttr(
new ExtTextInputAttr[rText.getLength()]);
2094 for (
int i = 0;
i < rText.getLength(); ++
i) {
2156 if ( pRect && (nCompositionLength > 0) )
2166 rAllChildren.push_back(
this );
2180 rRenderContext.
SetFont(aFont);
2197 bool bRealVisibilityChanged =
false;
2208 bool bOldUpdate =
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
2210 mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate =
true;
2212 mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
2232 bRealVisibilityChanged =
mpWindowImpl->mbReallyVisible;
2260 const int workaround_border = 5;
2263 aBounds.
AdjustTop( -workaround_border );
2266 aInvRegion = aBounds;
2321 bRealVisibilityChanged = !
mpWindowImpl->mbReallyVisible;
2348 pApp->InitFinished();
2375 mpWindowImpl->mpFrame->GetClientSize( nOutWidth, nOutHeight );
2398 if ( !bRealVisibilityChanged )
2409 SAL_WARN(
"vcl.layout",
"WTF no windowimpl");
2414 if(
mpWindowImpl->mpFrameData->maResizeIdle.IsActive() )
2418 mpWindowImpl->mpFrameData->maResizeIdle.Invoke(
nullptr );
2428 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
2459 mpWindowImpl->mpBorderWindow->Enable( bEnable,
false );
2487 pChild->
Enable( bEnable, bChild );
2503 mpWindowImpl->mpBorderWindow->EnableInput( bEnable,
false );
2559 if( pExcludeWindow )
2590 pFrameWin = pFrameWin->
mpWindowImpl->mpFrameData->mpNextFrame;
2597 ::std::vector< VclPtr<vcl::Window> >& rList =
mpWindowImpl->mpFrameData->maOwnerDrawList;
2598 for (
auto const& elem : rList)
2606 elem->EnableInput( bEnable );
2615 mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways,
false );
2642 mpWindowImpl->mpBorderWindow->SetActivateMode( nMode );
2696 sal_uInt16 nSysFlags=0;
2733 pWinParent->
mpWindowImpl->mpFrame->GetUnmirroredGeometry();
2736 myWidth = aSysGeometry.
width();
2742 - myWidth - 1 - aSysGeometry.
x();
2765 if( nWidth < aMinSize.
Width() )
2766 nWidth = aMinSize.
Width();
2767 if( nHeight < aMinSize.
Height() )
2768 nHeight = aMinSize.
Height();
2770 if( nWidth > aMaxSize.
Width() )
2771 nWidth = aMaxSize.
Width();
2772 if( nHeight > aMaxSize.
Height() )
2773 nHeight = aMaxSize.
Height();
2777 pWindow->
mpWindowImpl->mpFrame->SetPosSize( nX, nY, nWidth, nHeight, nSysFlags );
2781 pWindow->
mpWindowImpl->mpFrame->GetClientSize(nWidth, nHeight);
2805 mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrame->GetWorkArea( rRect );
2831 offx -=
mpWindowImpl->mpParent->GetOutDev()->mnOutOffX;
2836 offx +=
mpWindowImpl->mpParent->GetOutDev()->mnOutOffX;
2848 return Point( rPos.X()+offx, rPos.Y() +
GetOutDev()->mnOutOffY );
2855 return Point( rPos.X()-offx, rPos.Y() -
GetOutDev()->mnOutOffY );
2873 p.AdjustX( -(g.
x()) );
2874 p.AdjustY( -(g.
y()) );
2886 p1.setX( g.
x()+g.
width()-p1.X() );
2891 p2.setX( g.
x()+g.
width()-p2.X() );
2903 p1.AdjustY(-g.
y() );
2904 p1.setX( g.
x()+g.
width()-p1.X() );
2909 p2.setX( g.
x()+g.
width()-p2.X() );
2930 aPos.AdjustX(g.
x() );
2931 aPos.AdjustY(g.
y() );
2941 if( pRelativeWindow )
2964 ImplScroll( aRect, nHorzScroll, nVertScroll, nFlags );
3054 if ( pWindow && pWindow !=
this )
3099 bool bStrHelpId = !aStrHelpId.isEmpty();
3101 if ( !
mpWindowImpl->maHelpText.getLength() && bStrHelpId )
3113 else if(
mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
3115 static const char* pEnv = getenv(
"HELP_DEBUG" );
3118 OUString aTxt =
mpWindowImpl->maHelpText +
"\n------------------\n" + aStrHelpId;
3126 return *
mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
3140 SAL_WARN_IF( !pWrapper,
"vcl.window",
"SetComponentInterface: No Wrapper!" );
3165 SAL_WARN_IF( !pWrapper,
"vcl.window",
"SetComponentInterface: No Wrapper!" );
3179 return s_aLOKWindowsMap;
3200 GetLOKWindowsMap().emplace(
mpWindowImpl->mnLOKWindowId,
this);
3208 const auto it = GetLOKWindowsMap().find(nWindowId);
3209 if (it != GetLOKWindowsMap().
end())
3217 return GetLOKWindowsMap().empty();
3237 for (
auto it = GetLOKWindowsMap().
begin(); it != GetLOKWindowsMap().end();)
3239 WindowImpl* pWindowImpl = it->second->ImplGetWindowImpl();
3244 it = GetLOKWindowsMap().erase(it);
3275std::string_view windowTypeName(
WindowType nWindowType)
3277 switch (nWindowType)
3368 rJsonWriter.
put(
"type", windowTypeName(
GetType()));
3372 rJsonWriter.
put(
"visible",
false);
3376 auto childrenNode = rJsonWriter.
startArray(
"children");
3381 pChild->DumpAsPropertyTree(rJsonWriter);
3382 sal_Int32 nLeft = pChild->get_grid_left_attach();
3383 sal_Int32 nTop = pChild->get_grid_top_attach();
3384 if (nLeft != -1 && nTop != -1)
3386 rJsonWriter.
put(
"left", nLeft);
3387 rJsonWriter.
put(
"top", nTop);
3390 sal_Int32 nWidth = pChild->get_grid_width();
3392 rJsonWriter.
put(
"width", nWidth);
3394 pChild = pChild->mpWindowImpl->mpNext;
3400 rJsonWriter.
put(
"labelFor", pAccLabelFor->
get_id());
3404 rJsonWriter.
put(
"labelledBy", pAccLabelledBy->
get_id());
3406 mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);
3456 return static_cast<XClipboard*
>(
nullptr);
3472 sal_uInt16 highlight,
3484 Color aSelectionFillCol( aSelectionBorderCol );
3492 if( !bDark && !bBright &&
abs( c2-c1 ) < 75 )
3497 if( b > 50 ) b -= 40;
3500 aSelectionBorderCol = aSelectionFillCol;
3512 sal_uInt16 nPercent = 0;
3522 if( bChecked && highlight == 2 )
3535 else if( bChecked || highlight == 1 )
3556 if( highlight == 3 )
3605 return (
mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
3612 while( pFrameWindow )
3614 pFrameWindow->
mpWindowImpl->mpFrameData->mnModalMode++;
3615 while( pParent && pParent->
mpWindowImpl->mpFrameWindow == pFrameWindow )
3619 pFrameWindow = pParent ? pParent->
mpWindowImpl->mpFrameWindow.get() :
nullptr;
3626 while( pFrameWindow )
3628 pFrameWindow->
mpWindowImpl->mpFrameData->mnModalMode--;
3629 while( pParent && pParent->
mpWindowImpl->mpFrameWindow == pFrameWindow )
3633 pFrameWindow = pParent ? pParent->
mpWindowImpl->mpFrameWindow.get() :
nullptr;
3658 bool bDecorated =
false;
3677 pFrameWin = pFrameWin->
mpWindowImpl->mpFrameData->mpNextFrame;
3689 static const char* pNoNWF = getenv(
"SAL_NO_NWF" );
3690 if( pNoNWF && *pNoNWF )
3704 mpWindowImpl->mpBorderWindow->ImplGetWinData()->mbEnableNativeWidget = bEnable;
3726 Sequence< Any > aArg{
3727 Any(
reinterpret_cast<sal_Int64
>(
this)),
3730 Any(Reference< css::awt::XWindow >(
3741 css::rendering::CanvasFactory::create( xContext ) );
3742 Reference<XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.
get());
3743 Reference< css::rendering::XCanvas > xCanvas;
3745 if(xCanvasFactory.is())
3756 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3758 OUString(
"com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
3759 OUString(
"com.sun.star.rendering.Canvas.MultiScreen" ),
3768 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3770 OUString(
"com.sun.star.rendering.SpriteCanvas" ) :
3771 OUString(
"com.sun.star.rendering.Canvas" ),
3797 uno::Reference<accessibility::XAccessibleEditableText> lcl_GetxText(
vcl::Window *pFocusWin)
3799 uno::Reference<accessibility::XAccessibleEditableText> xText;
3802 uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->
GetAccessible() );
3803 if (xAccessible.is())
3806 catch(
const uno::Exception&)
3819 uno::Reference<accessibility::XAccessibleEditableText> xText = lcl_GetxText(
this);
3822 sal_Int32 nPosition = xText->getCaretPosition();
3824 sal_Int32 nDeletePos = rSelection.
Min();
3825 sal_Int32 nDeleteEnd = rSelection.
Max();
3830 if (nDeleteEnd > xText->getCharacterCount())
3831 nDeleteEnd = xText->getCharacterCount();
3833 xText->deleteText(nDeletePos, nDeleteEnd);
3835 if (nDeletePos < nPosition)
3837 if (nDeleteEnd <= nPosition)
3838 nPosition = nPosition - (nDeleteEnd - nDeletePos);
3840 nPosition = nDeletePos;
3842 if (xText->getCharacterCount() >= nPosition)
3843 xText->setCaretPosition( nPosition );
3943 static OUString empty;
3954 mxOwnerWindow(&rOwnerWindow)
uno::Reference< accessibility::XAccessibleEditableText > FindFocusedEditableText(uno::Reference< accessibility::XAccessibleContext > const &xContext)
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static unsigned int GetScreenCount()
Get the number of screens available for the display.
static void Abort(const OUString &rErrorText)
Ends the program prematurely with an error message.
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
static void RemoveMouseAndKeyEvents(vcl::Window *pWin)
Remove mouse and keypress events from a window... any also zoom and scroll events if the platform sup...
static Help * GetHelp()
Gets the application's help.
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
sal_uInt8 GetLuminance() const
void RGBtoHSB(sal_uInt16 &nHue, sal_uInt16 &nSaturation, sal_uInt16 &nBrightness) const
static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness)
void RemoveWindow(const vcl::Window *pWin)
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
HelpEventMode GetMode() const
const Point & GetMousePosPixel() const
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
VclPtr< vcl::Window > mpMenuBarWindow
ImplDockingWindowWrapper.
void Tracking(const TrackingEvent &rTEvt)
InputContextFlags GetOptions() const
const vcl::Font & GetFont() const
const vcl::KeyCode & GetKeyCode() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
tools::Rectangle GetOutputRectPixel() const
const vcl::Font & GetFont() const
virtual void ReleaseGraphics(bool bRelease=true)=0
Release the graphics device, and remove it from the graphics device list.
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames)
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
void SetFont(const vcl::Font &rNewFont)
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
std::shared_ptr< ImplFontCache > mxFontCache
virtual void dispose() override
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
std::unique_ptr< ImplOutDevData > mpOutDevData
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
void DrawRect(const tools::Rectangle &rRect)
virtual void ImplReleaseFonts()
SalGraphics * mpGraphics
Graphics context to draw on.
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
SAL_DLLPRIVATE void ImplDisposeCanvas()
css::uno::Any GetSystemGfxDataAny() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
AntialiasingFlags mnAntialiasing
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
virtual bool HasMirroredGraphics() const
const Color & GetLineColor() const
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
std::optional< AllSettings > moSettings
OutDevType GetOutDevType() const
bool SelectClipRegion(const vcl::Region &, SalGraphics *pGraphics=nullptr)
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
bool IsMapModeEnabled() const
const Color & GetFillColor() const
constexpr sal_uInt32 leftDecoration() const
constexpr sal_uInt32 bottomDecoration() const
constexpr sal_uInt32 topDecoration() const
constexpr sal_uInt32 rightDecoration() const
A SalFrame is a system window (e.g. an X11 window).
virtual void SetInputContext(SalInputContext *pContext)=0
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle)=0
void SetModalHierarchyHdl(const Link< bool, void > &rLink)
void SetCallback(vcl::Window *pWindow, SALFRAMEPROC pProc)
virtual void EndExtTextInput(EndExtTextInputFlags nFlags)=0
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
void setAntiAlias(bool bNew)
void CopyBits(const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
void CopyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, const OutputDevice &rOutDev)
virtual void DestroyFrame(SalFrame *pFrame)=0
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)=0
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle)=0
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
sal_Int32 GetTitleHeight() const
const Color & GetWindowColor() const
const Color & GetWindowTextColor() const
static sal_Int32 GetBorderSize()
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
const vcl::Font & GetAppFont() const
const vcl::Font & GetTitleFont() const
const Color & GetButtonTextColor() const
const Size & GetMinOutputSizePixel() const
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
const Size & GetMaxOutputSizePixel() const
TaskPaneList * GetTaskPaneList()
void RemoveWindow(vcl::Window *pWindow)
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual css::uno::Reference< css::awt::XVclWindowPeer > GetWindowInterface(vcl::Window *pWindow)=0
virtual void SetWindowInterface(vcl::Window *pWindow, const css::uno::Reference< css::awt::XVclWindowPeer > &xIFace)=0
virtual void WindowDestroyed(vcl::Window *pWindow)=0
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
A construction helper for a temporary VclPtr.
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
const Color & GetColor() const
bool mbCompoundControlHasFocus
sal_Int32 mnGridTopAttach
ControlPart mnNativeBackground
VclPtr< vcl::Window > mpRealParent
bool mbCreatedWithToolkit
VclPtr< vcl::Window > mpNext
std::unique_ptr< vcl::Region > mpChildClipRegion
ActivateModeFlags mnActivateMode
VclPtr< vcl::Window > mpBorderWindow
VclPtr< vcl::Window > mpFirstChild
VclPtr< vcl::Window > mpParent
sal_Int32 mnGridLeftAttach
bool mbMenuFloatingWindow
VclPtr< vcl::Window > mpOverlapWindow
sal_Int32 mnOptimalWidthCache
VclPtr< vcl::WindowOutputDevice > mxOutDev
int mnEventListenersIteratingCount
WindowExtendedStyle mnExtendedStyle
VclPtr< vcl::Window > mpFrameWindow
bool mbDrawSelectionBackground
ImplFrameData * mpFrameData
vcl::Region maWinClipRegion
vcl::Region * mpPaintRegion
sal_Int32 mnOptimalHeightCache
bool mbNativeFocusVisible
ImplPaintFlags mnPaintFlags
VCLXWindow * mpVCLXWindow
VclPtr< vcl::Window > mpClientWindow
bool mbDoubleBufferingRequested
VclPtr< vcl::Window > mpDlgCtrlDownWindow
GetFocusFlags mnGetFocusFlags
bool mbToolbarFloatingWindow
ParentClipMode mnParentClipMode
Color maControlBackground
std::unique_ptr< ImplAccessibleInfos > mpAccessibleInfos
int mnChildEventListenersIteratingCount
std::unique_ptr< ImplWinData > mpWinData
sal_Int32 mnHeightRequest
VclPtr< vcl::Window > mpNextOverlap
WindowImpl(const WindowImpl &)=delete
AlwaysInputMode meAlwaysInputMode
bool mbSuppressAccessibilityEvents
VclPtr< vcl::Window > mpLastChild
vcl::LOKWindowId mnLOKWindowId
ID of this specific window.
Color maControlForeground
VclPtr< vcl::Window > mpPrev
DialogControlFlags mnDlgCtrlFlags
VclPtr< vcl::Window > mpLastOverlap
VclPtr< vcl::Window > mpLastFocusWindow
VclPtr< vcl::Window > mpFirstOverlap
const vcl::ILibreOfficeKitNotifier * mpLOKNotifier
To emit the LOK callbacks eg. for dialog tunneling.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
SAL_DLLPRIVATE void ImplShow()
Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit template class makes sure that a static UNO...
css::uno::Reference< I > get()
void SetFontSize(const Size &)
const OUString & GetFamilyName() const
const Size & GetFontSize() const
virtual ~ILibreOfficeKitNotifier()
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
void Intersect(const tools::Rectangle &rRegion)
tools::Rectangle GetBoundRect() const
void Exclude(const tools::Rectangle &rRegion)
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate) override
virtual void DrawOutDevDirectProcess(const OutputDevice &rSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
virtual bool UsePolyPolygonForComplexGradient() override
virtual void dispose() override
virtual void ReleaseGraphics(bool bRelease=true) override
Release the graphics device, and remove it from the graphics device list.
virtual const OutputDevice * DrawOutDevDirectCheck(const OutputDevice &rSrcDev) const override
VclPtr< vcl::Window > mxOwnerWindow
virtual ~WindowOutputDevice() override
WindowOutputDevice(vcl::Window &rOwnerWindow)
virtual bool AcquireGraphics() const override
Acquire a graphics device that the output device uses to draw on.
virtual css::uno::Reference< css::rendering::XCanvas > ImplGetCanvas(bool bSpriteCanvas) const override
bool CanEnableNativeWidget() const override
Determine if native widgets can be enabled.
Color GetBackgroundColor() const override
css::awt::DeviceInfo GetDeviceInfo() const override
constexpr sal_Int32 y() const
constexpr sal_Int32 x() const
constexpr sal_Int32 width() const
static SAL_DLLPRIVATE void ImplInitAppFontData(vcl::Window const *pWindow)
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Point OutputToScreenPixel(const Point &rPos) const
virtual vcl::Window * getAccessibleRelationLabelFor() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
const Wallpaper & GetBackground() const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
void SetStyle(WinBits nStyle)
SAL_DLLPRIVATE void ImplPosSizeWindow(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
void SetFont(const vcl::Font &rNewFont)
void SetCursorRect(const tools::Rectangle *pRect=nullptr, tools::Long nExtTextInputWidth=0)
void SetUpdateMode(bool bUpdate)
SAL_DLLPRIVATE bool ImplIsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
SAL_DLLPRIVATE tools::Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel(const tools::Rectangle &rRect) const
static SAL_DLLPRIVATE void ImplNewInputContext()
void SetActivateMode(ActivateModeFlags nMode)
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
bool IsNativeWidgetEnabled() const
void SetInputContext(const InputContext &rInputContext)
SAL_DLLPRIVATE void ImplScroll(const tools::Rectangle &rRect, tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags)
bool IsReallyVisible() const
void SimulateKeyPress(sal_uInt16 nKeyCode) const
vcl::Window * GetParent() const
virtual void RequestHelp(const HelpEvent &rHEvt)
SAL_DLLPRIVATE void ImplStartToTop(ToTopFlags nFlags)
virtual void StateChanged(StateChangedType nStateChange)
virtual Selection GetSurroundingTextSelection() const
bool IsInputEnabled() const
void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier *pNotifier, bool bParent=false)
Interface to register for dialog / window tunneling.
bool IsMouseCaptured() const
bool HasActiveChildFrame() const
const InputContext & GetInputContext() const
bool HasChildPathFocus(bool bSystemWindow=false) const
SAL_DLLPRIVATE void ImplCallDeactivateListeners(vcl::Window *)
SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
tools::Rectangle GetDesktopRectPixel() const
virtual const Wallpaper & GetDisplayBackground() const
KeyIndicatorState GetIndicatorState() const
Query the states of keyboard indicators - Caps Lock, Num Lock and Scroll Lock.
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
SAL_DLLPRIVATE void ImplCalcOverlapRegion(const tools::Rectangle &rSourceRect, vcl::Region &rRegion, bool bChildren, bool bSiblings)
LanguageType GetInputLanguage() const
SAL_DLLPRIVATE void ImplExcludeWindowRegion(vcl::Region &rRegion)
SAL_DLLPRIVATE tools::Rectangle ImplUnmirroredAbsoluteScreenToOutputPixel(const tools::Rectangle &rRect) const
VclPtr< vcl::Window > GetFocusedWindow() const
bool IsBackground() const
const OUString & get_id() const
Get the ID of the window.
bool IsPaintTransparent() const
WindowType GetType() const
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
SAL_DLLPRIVATE ::std::vector< VclPtr< vcl::Window > > & ImplGetOwnerDrawList()
virtual void Tracking(const TrackingEvent &rTEvt)
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
SAL_DLLPRIVATE void ImplGenerateMouseMove()
virtual void Command(const CommandEvent &rCEvt)
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
SAL_DLLPRIVATE bool CompatNotify(NotifyEvent &rNEvt)
SAL_DLLPRIVATE void ImplInitWinClipRegion()
void SetCursor(vcl::Cursor *pCursor)
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
SAL_DLLPRIVATE bool ImplIsChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
void SetClipboard(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &xClipboard)
Sets a custom clipboard for the window's frame, instead of creating it on-demand using css::datatrans...
bool IsCompoundControl() const
void set_id(const OUString &rID)
Sets an ID.
SAL_DLLPRIVATE void ImplHideAllOverlaps()
SAL_DLLPRIVATE void ImplPointToLogic(vcl::RenderContext const &rRenderContext, vcl::Font &rFont) const
void ReleaseLOKNotifier()
Indicate that LOK is not going to use this dialog any more.
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
SAL_DLLPRIVATE void ImplInvalidate(const vcl::Region *rRegion, InvalidateFlags nFlags)
void remove_mnemonic_label(FixedText *pLabel)
void SetHelpHdl(const Link< vcl::Window &, bool > &rLink)
vcl::Window * GetAccessibleParentWindow() const
virtual Point GetPosPixel() const
void SetParent(vcl::Window *pNewParent)
SAL_DLLPRIVATE void ImplInsertWindow(vcl::Window *pParent)
SAL_DLLPRIVATE bool ImplUpdatePos()
SAL_DLLPRIVATE bool CompatPreNotify(NotifyEvent &rNEvt)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
SAL_DLLPRIVATE void ImplNotifyIconifiedState(bool bIconified)
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion(const vcl::Region &rRegion)
void Enable(bool bEnable=true, bool bChild=true)
Point NormalizedScreenToOutputPixel(const Point &rPos) const
SAL_DLLPRIVATE void ImplUpdateSysObjPos()
SAL_DLLPRIVATE void CollectChildren(::std::vector< vcl::Window * > &rAllChildren)
Add all children to rAllChildren recursively.
virtual ~Window() override
bool IsMapModeEnabled() const