summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-06-12 08:01:32 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2022-06-17 20:27:50 +0200
commite2a8b4a420ab0f726c43ec6c609d17211cd6ed11 (patch)
treea8949db67d7ae75a39ce8ca53da37a9b445df83a
parent8b6000f6075725b2e17b8fa745251ea96d7185f1 (diff)
Fix and add ostreams for vcl::WindowPosSize
... and inheriting classes. Follow-up on commit ea5a0918c8c32309821ab239c4b95f4d6a3b5c12 ("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>
-rw-r--r--include/vcl/WindowPosSize.hxx5
-rw-r--r--include/vcl/windowstate.hxx29
-rw-r--r--vcl/inc/salgeom.hxx2
3 files changed, 33 insertions, 3 deletions
diff --git a/include/vcl/WindowPosSize.hxx b/include/vcl/WindowPosSize.hxx
index ed52488be33a..6c5484c47b30 100644
--- a/include/vcl/WindowPosSize.hxx
+++ b/include/vcl/WindowPosSize.hxx
@@ -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;
}
diff --git a/include/vcl/windowstate.hxx b/include/vcl/windowstate.hxx
index 772d5c397f76..ed3cbf1a7f6e 100644
--- a/include/vcl/windowstate.hxx
+++ b/include/vcl/windowstate.hxx
@@ -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: */
diff --git a/vcl/inc/salgeom.hxx b/vcl/inc/salgeom.hxx
index 63675b6d9ceb..1b19931c5c50 100644
--- a/vcl/inc/salgeom.hxx
+++ b/vcl/inc/salgeom.hxx
@@ -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;