summaryrefslogtreecommitdiffstats
path: root/include
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 /include
parentWIN drop window state redundancies (diff)
downloadcore-e2a8b4a420ab0f726c43ec6c609d17211cd6ed11.tar.gz
core-e2a8b4a420ab0f726c43ec6c609d17211cd6ed11.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/WindowPosSize.hxx5
-rw-r--r--include/vcl/windowstate.hxx29
2 files changed, 32 insertions, 2 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: */