summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-10-07 16:43:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-10-08 16:31:21 +0200
commit64fc5986607eaba5db627c546cb1321f00abc501 (patch)
tree9016569f3c8c3da8e744db3daeadd8e39714f739 /include
parent1c68ab312c5473ce642f75fc35a1edd6be187489 (diff)
implement gtk dialog screenshotting
Change-Id: If4e570f775bd1e29dfb75cb7e5dd9d9dfc35e654 Reviewed-on: https://gerrit.libreoffice.org/80416 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/abstdlg.hxx2
-rw-r--r--include/vcl/dialog.hxx5
-rw-r--r--include/vcl/layout.hxx2
-rw-r--r--include/vcl/weld.hxx26
4 files changed, 31 insertions, 4 deletions
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index d9a5058c7e42..ccbc64a753a0 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -172,7 +172,7 @@ public:
// creates instance of ScreenshotAnnotationDlg from cui
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
- weld::Window* pParent, Dialog& rParentDialog) = 0;
+ weld::Dialog& rParentDialog) = 0;
// create info dialog to show tip-of-the-day
virtual VclPtr<AbstractTipOfTheDayDialog>
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index e2ddea74be78..cc5355d58132 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -110,6 +110,7 @@ public:
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
virtual void StateChanged( StateChangedType nStateChange ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
+ virtual void Command( const CommandEvent& rCEvt ) override;
virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
@@ -127,7 +128,7 @@ public:
// Screenshot interface
virtual std::vector<OString> getAllPageUIXMLDescriptions() const;
virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
- BitmapEx createScreenshot();
+ void createScreenshot(VirtualDevice& rOutput);
virtual short Execute();
bool IsInExecute() const { return mbInExecute; }
@@ -174,7 +175,7 @@ public:
void Activate() override;
-
+ void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink);
void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink);
void add_button(PushButton* pButton, int nResponse, bool bTransferOwnership);
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 0164b2b09df0..494cb708f292 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -50,7 +50,7 @@ protected:
virtual sal_uInt16 getDefaultAccessibleRole() const override;
- // evtl. support for screenshot context menu
+ // support for screenshot context menu
virtual void Command(const CommandEvent& rCEvt) override;
public:
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 5559833799fc..20c8d9e5751e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -10,6 +10,7 @@
#ifndef INCLUDED_VCL_WELD_HXX
#define INCLUDED_VCL_WELD_HXX
+#include <basegfx/range/b2irange.hxx>
#include <rtl/ustring.hxx>
#include <tools/color.hxx>
#include <tools/date.hxx>
@@ -419,6 +420,26 @@ public:
class Button;
+class VCL_DLLPUBLIC ScreenShotEntry
+{
+public:
+ ScreenShotEntry(const OString& rHelpId, const basegfx::B2IRange& rB2IRange)
+ : msHelpId(rHelpId)
+ , maB2IRange(rB2IRange)
+ {
+ }
+
+ const basegfx::B2IRange& getB2IRange() const { return maB2IRange; }
+
+ const OString& GetHelpId() const { return msHelpId; }
+
+private:
+ OString msHelpId;
+ basegfx::B2IRange maB2IRange;
+};
+
+typedef std::vector<ScreenShotEntry> ScreenShotCollection;
+
class VCL_DLLPUBLIC Dialog : virtual public Window
{
private:
@@ -446,6 +467,11 @@ public:
// undo previous dialog collapse
virtual void undo_collapse() = 0;
+ // render the dialog for a screenshot
+ virtual void draw(VirtualDevice& rOutput) = 0;
+ // collect positions of widgets and their help ids for screenshot purposes
+ virtual ScreenShotCollection collect_screenshot_data() = 0;
+
virtual void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink)
= 0;
};