summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-06-29 16:13:42 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2021-06-30 22:34:41 +0200
commit54d7fc9ea9d56ec16ec4f641a3dbf01f64233297 (patch)
tree14b24121b47eaee1cdd0e7e5d4c33ca1e7c380ef
parentce9e6972148c657994beb74f671e51bec5be6689 (diff)
svp: add ostream<< for SvpSalFrame
... and also store the window title. Change-Id: I20d8b30f6e8e5c48740fe569d9689a117db11e6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118129 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--vcl/headless/svpframe.cxx3
-rw-r--r--vcl/inc/headless/svpframe.hxx20
2 files changed, 22 insertions, 1 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index ab82a90a4faa..c7a1d8f50845 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -187,8 +187,9 @@ void SvpSalFrame::PostPaint() const
}
}
-void SvpSalFrame::SetTitle( const OUString& )
+void SvpSalFrame::SetTitle(const OUString& sTitle)
{
+ m_sTitle = sTitle;
}
void SvpSalFrame::SetIcon( sal_uInt16 )
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 145ccf5b3655..4c6dd98e2ca9 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -54,6 +54,8 @@ class SvpSalFrame : public SalFrame
std::vector< SvpSalGraphics* > m_aGraphics;
static SvpSalFrame* s_pFocusFrame;
+ OUString m_sTitle;
+
public:
SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
@@ -64,6 +66,11 @@ public:
void LoseFocus();
void PostPaint() const;
+ OUString title() const { return m_sTitle; }
+ SalFrameStyleFlags style() const { return m_nStyle; }
+ bool isVisible() const { return m_bVisible; }
+ bool hasFocus() const { return s_pFocusFrame == this; }
+
// SalFrame
virtual SalGraphics* AcquireGraphics() override;
virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
@@ -120,6 +127,19 @@ private:
basegfx::B2IVector GetSurfaceFrameSize() const;
};
+template <typename charT, typename traits>
+inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream,
+ const SvpSalFrame& frame)
+{
+ stream << &frame << " (vis " << frame.isVisible() << " focus " << frame.hasFocus();
+ stream << " style " << std::hex << std::setfill('0') << std::setw(8) << static_cast<sal_uInt32>(frame.style());
+ OUString sTitle = frame.title();
+ if (!sTitle.isEmpty())
+ stream << " '" << sTitle << "'";
+ stream << ")";
+ return stream;
+}
+
#endif // INCLUDED_VCL_INC_HEADLESS_SVPFRAME_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */