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/XWindowPeer.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");
752 mnCompositionCharRects(0),
754 mnIsTopWindow(sal_uInt16(~0)),
756 mbEnableNativeWidget(false)
766 : maPaintIdle(
"vcl::Window maPaintIdle" ),
767 maResizeIdle(
"vcl::Window maResizeIdle" )
844 while ( pReleaseOutDev )
851 if ( pReleaseOutDev )
945 "Window::Window(): pParent == NULL" );
1053 if ( pSystemParentData )
1061 "Could not create system window!",
1062 Reference< XInterface >() );
1195 if ( nSymHeight > nTextWidth )
1196 nTextWidth = nSymHeight;
1197 else if ( nSymHeight+5 > nTextWidth )
1198 nTextWidth = nSymHeight+5;
1211 tools::Rectangle aCtrlRegion(
Point(),
Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) );
1216 aBoundingRgn, aContentRgn ) )
1220 if( aContentRgn.
GetHeight() - nTextHeight > (nTextHeight+4)/4 )
1231 static const char* pNoNWF = getenv(
"SAL_NO_NWF" );
1234 mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF);
1246 if (bWindowInvalidate)
1270 if (
this == &rSrcDev )
1271 pSrcDevChecked =
nullptr;
1273 pSrcDevChecked = &rSrcDev;
1275 pSrcDevChecked =
nullptr;
1277 pSrcDevChecked = &rSrcDev;
1279 return pSrcDevChecked;
1292 if (
mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics )
1294 mpWindowImpl->mpFrameWindow->GetOutDev()->mbInitClipRegion =
true;
1304 mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics->ResetClipRegion();
1305 return mpWindowImpl->mpFrameWindow->GetOutDev()->mpGraphics;
1316 bool bBecameReallyVisible = !
mpWindowImpl->mbReallyVisible;
1420 bool bSysChild =
false;
1465 bool bNewPos =
false;
1466 bool bNewSize =
false;
1467 bool bCopyBits =
false;
1472 std::unique_ptr<vcl::Region> pOverlapRegion;
1473 std::unique_ptr<vcl::Region> pOldRegion;
1478 Size( nOldOutWidth, nOldOutHeight ) );
1479 pOldRegion.reset(
new vcl::Region( aOldWinRect ) );
1489 bool bnXRecycled =
false;
1501 if ( nWidth !=
GetOutDev()->mnOutWidth )
1512 if ( nHeight !=
GetOutDev()->mnOutHeight )
1557 if ( bCopyBits && !pOverlapRegion )
1561 *pOverlapRegion,
false,
true );
1574 if ( bCopyBits && !pOverlapRegion )
1578 *pOverlapRegion,
false,
true );
1586 if ( !(bNewPos || bNewSize) )
1589 bool bUpdateSysObjPos =
false;
1600 mpWindowImpl->mpClientWindow->mpWindowImpl->mnTopBorder,
1616 mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove =
true;
1642 bool bUpdateSysObjClip =
false;
1645 if ( bNewPos || bNewSize )
1652 if ( bNewPos || (
GetOutDev()->mnOutWidth > nOldOutWidth) || (
GetOutDev()->mnOutHeight > nOldOutHeight) )
1656 bool bInvalidate =
false;
1657 bool bParentPaint =
true;
1659 bParentPaint =
mpWindowImpl->mpParent->IsPaintEnabled();
1666 if ( !pOverlapRegion->IsEmpty() )
1668 pOverlapRegion->Move(
GetOutDev()->mnOutOffX - nOldOutOffX,
GetOutDev()->mnOutOffY - nOldOutOffY );
1669 aRegion.
Exclude( *pOverlapRegion );
1675 Size( nOldOutWidth, nOldOutHeight ) ),
1683 const bool bSelectClipRegion = pOutDev->
SelectClipRegion( aRegion, pGraphics );
1684 if ( bSelectClipRegion )
1687 nOldOutOffX, nOldOutOffY,
1688 nOldOutWidth, nOldOutHeight,
1698 if ( !pOverlapRegion->IsEmpty() )
1713 aRegion.
Exclude( *pOldRegion );
1724 (
GetOutDev()->mnOutWidth < nOldOutWidth) || (
GetOutDev()->mnOutHeight < nOldOutHeight) )
1736 if ( bUpdateSysObjClip )
1738 if ( bUpdateSysObjPos )
1753 if ( rInputContext == pFocusWin->
mpWindowImpl->mpFrameData->maOldInputContext )
1756 pFocusWin->
mpWindowImpl->mpFrameData->maOldInputContext = rInputContext;
1762 aNewContext.
mpFont =
nullptr;
1763 if (!rFontName.isEmpty())
1778 rFont, aSize,
static_cast<float>(aSize.
Height()) );
1779 if ( pFontInstance )
1780 aNewContext.
mpFont = pFontInstance;
1880 if ( rStr.isEmpty() )
1910 OUString aStrHelpId( OStringToOUString(
GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
1918 if( !aStrHelpId.isEmpty() )
1919 pHelp->
Start( aStrHelpId,
this );
2005 !
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame &&
2034 mpWindowImpl->mpBorderWindow->SetBorderStyle( nBorderStyle );
2094 std::unique_ptr<ExtTextInputAttr[]> pAttr(
new ExtTextInputAttr[rText.getLength()]);
2095 for (
int i = 0;
i < rText.getLength(); ++
i) {
2157 if ( pRect && (nCompositionLength > 0) )
2167 rAllChildren.push_back(
this );
2181 rRenderContext.
SetFont(aFont);
2198 bool bRealVisibilityChanged =
false;
2209 bool bOldUpdate =
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
2211 mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate =
true;
2213 mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
2233 bRealVisibilityChanged =
mpWindowImpl->mbReallyVisible;
2261 const int workaround_border = 5;
2264 aBounds.
AdjustTop( -workaround_border );
2267 aInvRegion = aBounds;
2322 bRealVisibilityChanged = !
mpWindowImpl->mbReallyVisible;
2349 pApp->InitFinished();
2376 mpWindowImpl->mpFrame->GetClientSize( nOutWidth, nOutHeight );
2399 if ( !bRealVisibilityChanged )
2410 SAL_WARN(
"vcl.layout",
"WTF no windowimpl");
2415 if(
mpWindowImpl->mpFrameData->maResizeIdle.IsActive() )
2419 mpWindowImpl->mpFrameData->maResizeIdle.Invoke(
nullptr );
2429 sal_Int32& rRightBorder, sal_Int32& rBottomBorder )
const
2460 mpWindowImpl->mpBorderWindow->Enable( bEnable,
false );
2488 pChild->
Enable( bEnable, bChild );
2504 mpWindowImpl->mpBorderWindow->EnableInput( bEnable,
false );
2560 if( pExcludeWindow )
2591 pFrameWin = pFrameWin->
mpWindowImpl->mpFrameData->mpNextFrame;
2598 ::std::vector< VclPtr<vcl::Window> >& rList =
mpWindowImpl->mpFrameData->maOwnerDrawList;
2599 for (
auto const& elem : rList)
2607 elem->EnableInput( bEnable );
2616 mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways,
false );
2643 mpWindowImpl->mpBorderWindow->SetActivateMode( nMode );
2697 sal_uInt16 nSysFlags=0;
2734 pWinParent->
mpWindowImpl->mpFrame->GetUnmirroredGeometry();
2737 myWidth = aSysGeometry.
width();
2743 - myWidth - 1 - aSysGeometry.
x();
2766 if( nWidth < aMinSize.
Width() )
2767 nWidth = aMinSize.
Width();
2768 if( nHeight < aMinSize.
Height() )
2769 nHeight = aMinSize.
Height();
2771 if( nWidth > aMaxSize.
Width() )
2772 nWidth = aMaxSize.
Width();
2773 if( nHeight > aMaxSize.
Height() )
2774 nHeight = aMaxSize.
Height();
2778 pWindow->
mpWindowImpl->mpFrame->SetPosSize( nX, nY, nWidth, nHeight, nSysFlags );
2782 pWindow->
mpWindowImpl->mpFrame->GetClientSize(nWidth, nHeight);
2806 mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrame->GetWorkArea( rRect );
2832 offx -=
mpWindowImpl->mpParent->GetOutDev()->mnOutOffX;
2837 offx +=
mpWindowImpl->mpParent->GetOutDev()->mnOutOffX;
2849 return Point( rPos.X()+offx, rPos.Y() +
GetOutDev()->mnOutOffY );
2856 return Point( rPos.X()-offx, rPos.Y() -
GetOutDev()->mnOutOffY );
2874 p.AdjustX( -(g.
x()) );
2875 p.AdjustY( -(g.
y()) );
2887 p1.setX( g.
x()+g.
width()-p1.X() );
2892 p2.setX( g.
x()+g.
width()-p2.X() );
2904 p1.AdjustY(-g.
y() );
2905 p1.setX( g.
x()+g.
width()-p1.X() );
2910 p2.setX( g.
x()+g.
width()-p2.X() );
2931 aPos.AdjustX(g.
x() );
2932 aPos.AdjustY(g.
y() );
2942 if( pRelativeWindow )
2965 ImplScroll( aRect, nHorzScroll, nVertScroll, nFlags );
3055 if ( pWindow && pWindow !=
this )
3099 OUString aStrHelpId( OStringToOUString(
GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
3100 bool bStrHelpId = !aStrHelpId.isEmpty();
3102 if ( !
mpWindowImpl->maHelpText.getLength() && bStrHelpId )
3114 else if(
mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
3116 static const char* pEnv = getenv(
"HELP_DEBUG" );
3119 OUString aTxt =
mpWindowImpl->maHelpText +
"\n------------------\n" + aStrHelpId;
3127 return *
mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
3141 SAL_WARN_IF( !pWrapper,
"vcl.window",
"SetComponentInterface: No Wrapper!" );
3166 SAL_WARN_IF( !pWrapper,
"vcl.window",
"SetComponentInterface: No Wrapper!" );
3180 return s_aLOKWindowsMap;
3201 GetLOKWindowsMap().emplace(
mpWindowImpl->mnLOKWindowId,
this);
3211 const auto it = GetLOKWindowsMap().find(nWindowId);
3212 if (it != GetLOKWindowsMap().
end())
3220 return GetLOKWindowsMap().empty();
3233ILibreOfficeKitNotifier::~ILibreOfficeKitNotifier()
3240 for (
auto it = GetLOKWindowsMap().
begin(); it != GetLOKWindowsMap().end();)
3242 WindowImpl* pWindowImpl = it->second->ImplGetWindowImpl();
3247 it = GetLOKWindowsMap().erase(it);
3278std::string_view windowTypeName(
WindowType nWindowType)
3280 switch (nWindowType)
3371 rJsonWriter.
put(
"type", windowTypeName(
GetType()));
3375 rJsonWriter.
put(
"visible",
false);
3379 auto childrenNode = rJsonWriter.
startArray(
"children");
3384 pChild->DumpAsPropertyTree(rJsonWriter);
3385 sal_Int32 nLeft = pChild->get_grid_left_attach();
3386 sal_Int32 nTop = pChild->get_grid_top_attach();
3387 if (nLeft != -1 && nTop != -1)
3389 rJsonWriter.
put(
"left", nLeft);
3390 rJsonWriter.
put(
"top", nTop);
3393 sal_Int32 nWidth = pChild->get_grid_width();
3395 rJsonWriter.
put(
"width", nWidth);
3397 pChild = pChild->mpWindowImpl->mpNext;
3401 mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);
3451 return static_cast<XClipboard*
>(
nullptr);
3467 sal_uInt16 highlight,
3479 Color aSelectionFillCol( aSelectionBorderCol );
3487 if( !bDark && !bBright &&
abs( c2-c1 ) < 75 )
3492 if( b > 50 ) b -= 40;
3495 aSelectionBorderCol = aSelectionFillCol;
3507 sal_uInt16 nPercent = 0;
3517 if( bChecked && highlight == 2 )
3530 else if( bChecked || highlight == 1 )
3551 if( highlight == 3 )
3600 return (
mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
3607 while( pFrameWindow )
3609 pFrameWindow->
mpWindowImpl->mpFrameData->mnModalMode++;
3610 while( pParent && pParent->
mpWindowImpl->mpFrameWindow == pFrameWindow )
3614 pFrameWindow = pParent ? pParent->
mpWindowImpl->mpFrameWindow.get() :
nullptr;
3621 while( pFrameWindow )
3623 pFrameWindow->
mpWindowImpl->mpFrameData->mnModalMode--;
3624 while( pParent && pParent->
mpWindowImpl->mpFrameWindow == pFrameWindow )
3628 pFrameWindow = pParent ? pParent->
mpWindowImpl->mpFrameWindow.get() :
nullptr;
3653 bool bDecorated =
false;
3672 pFrameWin = pFrameWin->
mpWindowImpl->mpFrameData->mpNextFrame;
3684 static const char* pNoNWF = getenv(
"SAL_NO_NWF" );
3685 if( pNoNWF && *pNoNWF )
3699 mpWindowImpl->mpBorderWindow->ImplGetWinData()->mbEnableNativeWidget = bEnable;
3721 Sequence< Any > aArg{
3722 Any(
reinterpret_cast<sal_Int64
>(
this)),
3725 Any(Reference< css::awt::XWindow >(
3736 css::rendering::CanvasFactory::create( xContext ) );
3737 Reference<XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.
get());
3738 Reference< css::rendering::XCanvas > xCanvas;
3740 if(xCanvasFactory.is())
3751 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3753 OUString(
"com.sun.star.rendering.SpriteCanvas.MultiScreen" ) :
3754 OUString(
"com.sun.star.rendering.Canvas.MultiScreen" ),
3763 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
3765 OUString(
"com.sun.star.rendering.SpriteCanvas" ) :
3766 OUString(
"com.sun.star.rendering.Canvas" ),
3792 uno::Reference<accessibility::XAccessibleEditableText> lcl_GetxText(
vcl::Window *pFocusWin)
3794 uno::Reference<accessibility::XAccessibleEditableText> xText;
3797 uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->
GetAccessible() );
3798 if (xAccessible.is())
3801 catch(
const uno::Exception&)
3814 uno::Reference<accessibility::XAccessibleEditableText> xText = lcl_GetxText(
this);
3817 sal_Int32 nPosition = xText->getCaretPosition();
3819 sal_Int32 nDeletePos = rSelection.
Min();
3820 sal_Int32 nDeleteEnd = rSelection.
Max();
3825 if (nDeleteEnd > xText->getCharacterCount())
3826 nDeleteEnd = xText->getCharacterCount();
3828 xText->deleteText(nDeletePos, nDeleteEnd);
3830 if (nDeletePos < nPosition)
3832 if (nDeleteEnd <= nPosition)
3833 nPosition = nPosition - (nDeleteEnd - nDeletePos);
3835 nPosition = nDeletePos;
3837 if (xText->getCharacterCount() >= nPosition)
3838 xText->setCaretPosition( nPosition );
3938 static OUString empty;
3949 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::XWindowPeer > GetWindowInterface(vcl::Window *pWindow)=0
virtual void WindowDestroyed(vcl::Window *pWindow)=0
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
virtual void SetWindowInterface(vcl::Window *pWindow, const css::uno::Reference< css::awt::XWindowPeer > &xIFace)=0
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
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 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
void SetFakeFocus(bool bFocus)
Set this when you need to act as if the window has focus even if it doesn't.
void GrabFocusToDocument()
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
SAL_DLLPRIVATE bool ImplSetClipFlag(bool bSysObjOnlySmaller=false)