46#include <com/sun/star/accessibility/AccessibleRelation.hpp>
47#include <com/sun/star/accessibility/AccessibleRole.hpp>
175 if ( !
GetOutDev()->IsDeviceOutputNecessary() )
228 pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
231 Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY );
232 if( GetOutDev()->ImplIsAntiparallel() )
238 MouseEvent aMEvt( ScreenToOutputPixel( aMousePos ),
240 mpWindowImpl->mpFrameData->mnMouseCode,
241 mpWindowImpl->mpFrameData->mnMouseCode );
262 if ( pTrackWin.
get() !=
this )
303 if ( pTrackWin.
get() !=
this )
432 double n = double(nCalc * rZoom);
520 Color aTextColor(rDefaultColor);
560 Color aColor(rDefaultColor);
586 MapMode aPtMapMode(MapUnit::MapPoint);
587 aFontSize = pDev->
LogicToPixel( aFontSize, aPtMapMode );
609 if (!pScrl || !nN || pScrl->
Inactive())
613 double scrolled = nN;
622 if(isMultiplyByLineSize){
627 tools::Long magnitude = o3tl::saturating_cast<tools::Long>(
abs(nN));
630 nNewPos = nNewPos - change;
632 scrolled = double(change);
634 if(isMultiplyByLineSize){
649 if ( pHScrl || pVScrl )
683 if (!
pData->IsDeltaPixel())
685 double nScrollLines =
pData->GetScrollLines();
687 double* partialScroll =
pData->IsHorz()
692 if (
pData->GetDelta() < 0 )
698 nLines = *partialScroll +
pData->GetNotchDelta() * nScrollLines;
703 *partialScroll = nLines - scrolled;
712 double deltaXInPixels = double(deltaPoint.
X());
713 double deltaYInPixels = double(deltaPoint.
Y());
719 double ratioX = deltaXInPixels / double(winSize.
getWidth());
729 deltaXInLogic /= lineSizeX;
739 bool const isMultiplyByLineSize =
true;
741 bool const isMultiplyByLineSize =
false;
750 double ratioY = deltaYInPixels / double(winSize.
getHeight());
760 deltaYInLogic /= lineSizeY;
770 bool const isMultiplyByLineSize =
true;
772 bool const isMultiplyByLineSize =
false;
813 pVScrl,
pData->GetDeltaY() );
893 return pFrame ? pFrame->
GetWindow() :
nullptr;
1020 return const_cast<Dialog *
>(
dynamic_cast<const Dialog*
>(pWindow));
1311 bool queue_ungrouped_resize(
vcl::Window const *pOrigWindow)
1313 bool bSomeoneCares =
false;
1320 bSomeoneCares =
true;
1324 bSomeoneCares =
true;
1329 return bSomeoneCares;
1358 bool bSomeoneCares = queue_ungrouped_resize(
this);
1368 std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->
m_xSizeGroup->get_widgets();
1373 queue_ungrouped_resize(pOther);
1388 if (!aSize.
IsEmpty() && !pParent->IsInInitShow()
1396 VclAlign toAlign(std::u16string_view rValue)
1400 if (rValue == u
"fill")
1402 else if (rValue == u
"start")
1404 else if (rValue == u
"end")
1406 else if (rValue == u
"center")
1414 if (rKey ==
"weight")
1417 if (rValue ==
u"thin")
1419 else if (rValue ==
u"ultralight")
1421 else if (rValue ==
u"light")
1423 else if (rValue ==
u"book")
1425 else if (rValue ==
u"normal")
1427 else if (rValue ==
u"medium")
1429 else if (rValue ==
u"semibold")
1431 else if (rValue ==
u"bold")
1433 else if (rValue ==
u"ultrabold")
1439 else if (rKey ==
"style")
1442 if (rValue ==
u"normal")
1444 else if (rValue ==
u"oblique")
1446 else if (rValue ==
u"italic")
1450 else if (rKey ==
"underline")
1456 else if (rKey ==
"scale")
1463 else if (rKey ==
"size")
1472 SAL_INFO(
"vcl.layout",
"unhandled font attribute: " << rKey);
1480 if ((rKey ==
"label") || (rKey ==
"title") || (rKey ==
"text") )
1484 else if (rKey ==
"visible")
1486 else if (rKey ==
"sensitive")
1488 else if (rKey ==
"resizable")
1491 nBits &= ~WB_SIZEABLE;
1496 else if (rKey ==
"xalign")
1501 float f = rValue.toFloat();
1502 assert(f == 0.0 || f == 1.0 || f == 0.5);
1512 else if (rKey ==
"justification")
1517 if (rValue ==
"left")
1519 else if (rValue ==
"right")
1521 else if (rValue ==
"center")
1526 else if (rKey ==
"yalign")
1531 float f = rValue.toFloat();
1532 assert(f == 0.0 || f == 1.0 || f == 0.5);
1542 else if (rKey ==
"wrap")
1545 nBits &= ~WB_WORDBREAK;
1550 else if (rKey ==
"height-request")
1552 else if (rKey ==
"width-request")
1554 else if (rKey ==
"hexpand")
1556 else if (rKey ==
"vexpand")
1558 else if (rKey ==
"halign")
1560 else if (rKey ==
"valign")
1562 else if (rKey ==
"tooltip-markup")
1564 else if (rKey ==
"tooltip-text")
1566 else if (rKey ==
"border-width")
1568 else if (rKey ==
"margin-start" || rKey ==
"margin-left")
1570 assert(rKey ==
"margin-start" &&
"margin-left deprecated in favor of margin-start");
1573 else if (rKey ==
"margin-end" || rKey ==
"margin-right")
1575 assert(rKey ==
"margin-end" &&
"margin-right deprecated in favor of margin-end");
1578 else if (rKey ==
"margin-top")
1580 else if (rKey ==
"margin-bottom")
1582 else if (rKey ==
"hscrollbar-policy")
1586 if (rValue ==
"always")
1588 else if (rValue ==
"automatic")
1592 else if (rKey ==
"vscrollbar-policy")
1596 if (rValue ==
"always")
1598 else if (rValue ==
"automatic")
1602 else if (rKey ==
"accessible-name")
1606 else if (rKey ==
"accessible-description")
1610 else if (rKey ==
"accessible-role")
1613 if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
1616 else if (rKey ==
"use-markup")
1619 SAL_WARN_IF(
toBool(rValue),
"vcl.layout",
"Use pango attributes instead of mark-up");
1621 else if (rKey ==
"has-focus")
1626 else if (rKey ==
"can-focus")
1638 SAL_INFO(
"vcl.layout",
"unhandled property: " << rKey);
1686 if (aRet.
Width() == -1)
1704 const bool bIgnoreInHidden = pWindowImpl->
m_xSizeGroup->get_ignore_hidden();
1705 const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->
m_xSizeGroup->get_widgets();
1706 for (
auto const& window : rWindows)
1711 if (bIgnoreInHidden && !pOther->
IsVisible())
1812 return pWindowImpl->
mbFill;
1818 pWindowImpl->
mbFill = bFill;
2006 std::vector<VclPtr<FixedText> >&
v =
mpWindowImpl->m_aMnemonicLabels;
2009 v.emplace_back(pLabel);
2015 std::vector<VclPtr<FixedText> >&
v =
mpWindowImpl->m_aMnemonicLabels;
2017 if (aFind ==
v.end())
static bool toBool(std::string_view rValue)
An auto-timer is a multi-shot timer re-emitting itself at interval until destroyed or stopped.
bool IsTransparent() const
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
const CommandGesturePanData * GetGesturePanData() const
const CommandScrollData * GetAutoScrollData() const
void RemoveWindow(const vcl::Window *pWin)
void AddWindow(const vcl::Window *pWin)
void set_mnemonic_widget(vcl::Window *pWindow)
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
static sal_Int32 GetScrollRepeat()
static sal_Int32 GetButtonStartRepeat()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
virtual void InitClipRegion()
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
void Invert(const tools::Rectangle &rRect, InvertFlags nFlags=InvertFlags::NONE)
SalGraphics * mpGraphics
Graphics context to draw on.
void SetTextColor(const Color &rColor)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
OutDevType GetOutDevType() const
bool SelectClipRegion(const vcl::Region &, SalGraphics *pGraphics=nullptr)
constexpr tools::Long Y() const
constexpr tools::Long X() const
A SalFrame is a system window (e.g. an X11 window).
virtual weld::Window * GetFrameWeld() const
vcl::Window * GetWindow() const
void Invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice &rOutDev)
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
sal_Int32 mnGridTopAttach
sal_Int32 mnGridLeftAttach
sal_Int32 mnOptimalWidthCache
sal_Int32 mnOptimalHeightCache
sal_Int32 mnHeightRequest
std::shared_ptr< VclSizeGroup > m_xSizeGroup
tools::Long GetFontHeight() const
void SetFontSize(const Size &)
void Merge(const Font &rFont)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFontHeight(tools::Long nHeight)
void SetUnderline(FontLineStyle)
const Size & GetFontSize() const
Size CalcOutputSize(const Size &rWinSz) const
SAL_DLLPRIVATE void ImplInvertFocus(const tools::Rectangle &rRect)
void SetDialogControlStart(bool bStart)
void SetStyle(WinBits nStyle)
bool IsToolbarFloatingWindow() const
bool IsNativeWidgetEnabled() const
bool IsReallyVisible() const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
ActivateModeFlags GetActivateMode() const
sal_Int32 get_padding() const
SAL_DLLPRIVATE bool ImplIsPushButton() const
GetFocusFlags GetGetFocusFlags() const
tools::Long GetOutOffXPixel() const
bool IsInputEnabled() const
void SetHelpText(const OUString &rHelpText)
const InputContext & GetInputContext() const
void SetControlForeground()
bool IsControlFont() const
WinBits GetPrevStyle() const
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool HandleScrollCommand(const CommandEvent &rCmd, Scrollable *pHScrl, Scrollable *pVScrl)
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
void SetZoomedPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
bool IsPaintEnabled() const
bool IsPaintTransparent() const
void set_halign(VclAlign eAlign)
WindowType GetType() const
SAL_DLLPRIVATE ::std::vector< VclPtr< vcl::Window > > & ImplGetOwnerDrawList()
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
void set_padding(sal_Int32 nPadding)
VCLXWindow * GetWindowPeer() const
virtual void SetSizePixel(const Size &rNewSize)
virtual void Tracking(const TrackingEvent &rTEvt)
static DockingManager * GetDockingManager()
Size get_preferred_size() const
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
tools::Long CalcZoom(tools::Long n) const
void set_border_width(sal_Int32 nBorderWidth)
void set_grid_left_attach(sal_Int32 nAttach)
Dialog * GetParentDialog() const
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
void set_height_request(sal_Int32 nHeightRequest)
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
static VclPtr< vcl::Window > SaveFocus()
void set_margin_bottom(sal_Int32 nWidth)
const Color & GetControlForeground() const
bool IsCompoundControl() const
void SetControlBackground()
bool IsUpdateMode() const
bool IsChildTransparentModeEnabled() const
bool set_font_attribute(const OUString &rKey, std::u16string_view rValue)
VclPackType get_pack_type() const
void set_margin_end(sal_Int32 nWidth)
void remove_mnemonic_label(FixedText *pLabel)
SAL_DLLPRIVATE bool ImplIsSplitter() const
sal_Int32 get_margin_end() const
void set_hexpand(bool bExpand)
vcl::Cursor * GetCursor() const
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
sal_Int32 get_grid_height() const
void set_grid_height(sal_Int32 nRows)
void Enable(bool bEnable=true, bool bChild=true)
bool IsCreatedWithToolkit() const
void SetAccessibleDescription(const OUString &rDescr)
virtual void SetOutputSizePixel(const Size &rNewSize)
bool IsControlForeground() const
const Fraction & GetZoom() const
static void EndSaveFocus(const VclPtr< vcl::Window > &xFocusWin)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
bool IsDialogControlStart() const
bool IsReallyShown() const
tools::Long GetOutOffYPixel() const
const std::vector< VclPtr< FixedText > > & list_mnemonic_labels() const
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
Size CalcWindowSize(const Size &rOutSz) const
const OUString & GetHelpId() const
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
vcl::Font GetControlFont() const
vcl::Font GetPointFont(vcl::RenderContext const &rRenderContext) const
SAL_DLLPRIVATE vcl::Window * ImplGetFirstOverlapWindow()
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set.
::OutputDevice const * GetOutDev() const
void set_pack_type(VclPackType ePackType)
bool IsInInitShow() const
Size get_ungrouped_preferred_size() const
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
virtual Size GetOptimalSize() const
void SetAccessibleName(const OUString &rName)
sal_Int32 get_margin_top() const
virtual void LogicInvalidate(const tools::Rectangle *pRectangle)
Notification about some rectangle of the output device got invalidated.Used for the main document win...
bool get_secondary() const
SAL_DLLPRIVATE vcl::Window * ImplGetTopmostFrameWindow()
bool IsAlwaysOnTopEnabled() const
void SetAccessibleRole(sal_uInt16 nRole)
SAL_DLLPRIVATE ImplWinData * ImplGetWinData() const
bool IsDockingWindow() const
sal_Int32 get_margin_start() const
void SetZoom(const Fraction &rZoom)
void SetParentUpdateMode(bool bUpdate)
void set_margin_top(sal_Int32 nWidth)
sal_Int32 get_height_request() const
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
tools::Long GetDrawPixel(::OutputDevice const *pDev, tools::Long nPixels) const
std::unique_ptr< WindowImpl > mpWindowImpl
SalFrame * ImplGetFrame() const
sal_Int32 get_grid_left_attach() const
sal_Int32 get_grid_top_attach() const
virtual void ShowFocus(const tools::Rectangle &rRect)
void set_width_request(sal_Int32 nWidthRequest)
bool IsSystemWindow() const
Point PixelToLogic(const Point &rDevicePt) const
sal_Int32 get_border_width() const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
DialogControlFlags GetDialogControlFlags() const
const Color & GetControlBackground() const
void remove_from_all_size_groups()
static SAL_DLLPRIVATE void ImplHandleScroll(Scrollable *pHScrl, double nX, Scrollable *pVScrl, double nY)
SAL_DLLPRIVATE ImplFrameData * ImplGetFrameData()
void SetCreatedWithToolkit(bool b)
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
sal_Int32 get_width_request() const
SAL_DLLPRIVATE bool ImplIsFloatingWindow() const
void set_secondary(bool bSecondary)
void StartAutoScroll(StartAutoScrollFlags nFlags)
void set_margin_start(sal_Int32 nWidth)
VclAlign get_halign() const
sal_Int32 get_margin_bottom() const
void set_expand(bool bExpand)
void EnableDocking(bool bEnable=true)
bool get_non_homogeneous() const
bool IsDefaultPos() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
weld::Window * GetFrameWeld() const
void set_grid_top_attach(sal_Int32 nAttach)
void SetQuickHelpText(const OUString &rHelpText)
void set_valign(VclAlign eAlign)
virtual void SetText(const OUString &rStr)
void set_fill(bool bFill)
vcl::Window * GetFrameWindow() const
tools::Rectangle GetOutputRectPixel() const
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
void add_mnemonic_label(FixedText *pLabel)
WindowExtendedStyle GetExtendedStyle() const
void InvertTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags)
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
void set_non_homogeneous(bool bNonHomogeneous)
bool IsDefaultSize() const
void SetType(WindowType nType)
virtual bool set_property(const OUString &rKey, const OUString &rValue)
Point ScreenToOutputPixel(const Point &rPos) const
void SetDialogControlFlags(DialogControlFlags nFlags)
void set_vexpand(bool bExpand)
bool IsMenuFloatingWindow() const
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
void set_grid_width(sal_Int32 nCols)
const OUString & GetQuickHelpText() const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
VclAlign get_valign() const
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
void SetUseFrameData(bool bUseFrameData)
PointerStyle GetPointer() const
SAL_DLLPRIVATE SalGraphics * ImplGetFrameGraphics() const
sal_Int32 get_grid_width() const
bool IsAlwaysEnableInput() const
returns the current AlwaysEnableInput state
void EnableChildTransparentMode(bool bEnable=true)
void SetCompoundControl(bool bCompound)
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
void EnablePaint(bool bEnable)
void SetHelpId(const OUString &)
void InvalidateSizeCache()
clear OptimalSize cache
bool IsMouseTransparent() const
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define COMMAND_WHEEL_PAGESCROLL
GraphicsSharedPtr mpGraphics
tools::Long FRound(double fVal)
bool isContainerWindow(const vcl::Window &rWindow)
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
sal_Int16 getRoleFromName(const OUString &roleName)
OUString convertMnemonicMarkup(std::u16string_view rIn)
tools::Long const nBorder
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
double toDouble(std::u16string_view str)
IMPL_LINK(ORoadmap, ImplClickHdl, HyperLabel *, CurHyperLabel, void)
static double lcl_HandleScrollHelper(Scrollable *pScrl, double nN, bool isMultiplyByLineSize)
static bool HasParentDockingWindow(const vcl::Window *pWindow)
HashMap_OWString_Interface aMap
SwNodeOffset abs(const SwNodeOffset &a)
VclPtr< ImplWheelWindow > mpWheelWindow
ImplSVWinData * mpWinData
StartAutoScrollFlags mnAutoScrollFlags
std::unique_ptr< AutoTimer > mpTrackTimer
StartTrackingFlags mnTrackFlags
VclPtr< vcl::Window > mpAutoScrollWin
VclPtr< vcl::Window > mpFocusWin
VclPtr< vcl::Window > mpTrackWin
std::optional< tools::Rectangle > mpTrackRect
std::optional< tools::Rectangle > mpFocusRect
ShowTrackFlags mnTrackFlags
ImplSVData * ImplGetSVData()
DockingManager * ImplGetDockingManager()
void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
WinBits const WB_SIZEABLE
WinBits const WB_NOTABSTOP
WinBits const WB_AUTOVSCROLL
WinBits const WB_AUTOHSCROLL
WinBits const WB_WORDBREAK