Fix and add ostreams for vcl::WindowPosSize
... and inheriting classes.
Follow-up on commit ea5a0918c8
("VCL add vcl::WindowPosSize abstract class").
Change-Id: I4733cd4619f91fe1ba05c208a650be591ecf5d8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135806
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
parent
8b6000f607
commit
e2a8b4a420
3 changed files with 33 additions and 3 deletions
|
@ -124,9 +124,10 @@ public:
|
|||
void setPosSize(const Point& rPos, const Size& rSize) { setPosSize({ rPos, rSize }); }
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rGeom)
|
||||
inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rPosSize)
|
||||
{
|
||||
s << rGeom.width() << "x" << rGeom.height() << "@(" << rGeom.x() << "," << rGeom.y() << ")";
|
||||
s << rPosSize.width() << "x" << rPosSize.height() << "@(" << rPosSize.x() << "," << rPosSize.y()
|
||||
<< ")";
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,6 +115,35 @@ template <> struct typed_flags<vcl::WindowDataMask> : is_typed_flags<vcl::Window
|
|||
};
|
||||
}
|
||||
|
||||
namespace vcl
|
||||
{
|
||||
inline std::ostream& operator<<(std::ostream& s, const WindowData& rData)
|
||||
{
|
||||
if (rData.mask() & WindowDataMask::Width)
|
||||
s << rData.width() << "x";
|
||||
else
|
||||
s << "?x";
|
||||
if (rData.mask() & WindowDataMask::Height)
|
||||
s << rData.height() << "@(";
|
||||
else
|
||||
s << "?@(";
|
||||
if (rData.mask() & WindowDataMask::X)
|
||||
s << rData.x() << ",";
|
||||
else
|
||||
s << "?,";
|
||||
if (rData.mask() & WindowDataMask::Y)
|
||||
s << rData.y() << ")^";
|
||||
else
|
||||
s << "?)^";
|
||||
if (rData.mask() & WindowDataMask::State)
|
||||
s << "0x" << std::hex << static_cast<unsigned>(rData.state()) << std::dec;
|
||||
else
|
||||
s << "?";
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace vcl
|
||||
|
||||
#endif // INCLUDED_VCL_WINDOWSTATE_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
inline std::ostream& operator<<(std::ostream& s, const SalFrameGeometry& rGeom)
|
||||
{
|
||||
s << static_cast<const vcl::WindowPosSize*>(&rGeom) << ":{" << rGeom.leftDecoration() << ","
|
||||
s << *static_cast<const vcl::WindowPosSize*>(&rGeom) << ":{" << rGeom.leftDecoration() << ","
|
||||
<< rGeom.topDecoration() << "," << rGeom.rightDecoration() << "," << rGeom.bottomDecoration()
|
||||
<< "}s" << rGeom.screen();
|
||||
return s;
|
||||
|
|
Loading…
Reference in a new issue