Kaydet (Commit) 57722dfc authored tarafından Noel Grandin's avatar Noel Grandin

use BitmapEx in the screenshot stuff

part of the process of moving Bitmap usage to BitmapEx

Change-Id: I4f02f8aa60d19a3639d623a998491447adf79e15
Reviewed-on: https://gerrit.libreoffice.org/55031Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 86555baa
......@@ -159,8 +159,8 @@ private:
// local variables
Dialog& mrParentDialog;
Bitmap maParentDialogBitmap;
Bitmap maDimmedDialogBitmap;
BitmapEx maParentDialogBitmap;
BitmapEx maDimmedDialogBitmap;
Size maParentDialogSize;
// VirtualDevice for buffered interaction paints
......@@ -233,7 +233,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
// to make clear that maParentDialogBitmap is a background image, adjust
// luminance a bit for maDimmedDialogBitmap - other methods may be applied
maDimmedDialogBitmap.Adjust(-15);
maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0);
// init paint buffering VirtualDevice
mpVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::BITMASK);
......@@ -488,7 +488,7 @@ void ScreenshotAnnotationDlg_Impl::RepaintToBuffer(
if (mpVirtualBufferDevice)
{
// reset with original screenshot bitmap
mpVirtualBufferDevice->DrawBitmap(
mpVirtualBufferDevice->DrawBitmapEx(
Point(0, 0),
bUseDimmed ? maDimmedDialogBitmap : maParentDialogBitmap);
......
......@@ -35,7 +35,7 @@ private:
private:
/// helpers
void implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId);
void implSaveScreenshot(const BitmapEx& rScreenshot, const OString& rScreenshotId);
void saveScreenshot(VclAbstractDialog const & rDialog);
void saveScreenshot(Dialog& rDialog);
......
......@@ -35,6 +35,7 @@
namespace vcl { class Window; }
class Dialog;
class Bitmap;
class BitmapEx;
namespace weld
{
class DialogController;
......@@ -74,7 +75,7 @@ public:
// Screenshot interface
virtual std::vector<OString> getAllPageUIXMLDescriptions() const;
virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
virtual Bitmap createScreenshot() const;
virtual BitmapEx createScreenshot() const;
virtual OString GetScreenshotId() const { return OString(); };
};
......
......@@ -129,7 +129,7 @@ public:
// Screenshot interface
virtual std::vector<OString> getAllPageUIXMLDescriptions() const;
virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
Bitmap createScreenshot();
BitmapEx createScreenshot();
virtual short Execute();
bool IsInExecute() const { return mbInExecute; }
......
......@@ -68,7 +68,7 @@ public: \
virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; \
std::vector<OString> getAllPageUIXMLDescriptions() const override; \
bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; \
virtual Bitmap createScreenshot() const override; \
virtual BitmapEx createScreenshot() const override; \
virtual OString GetScreenshotId() const override; \
#define IMPL_ABSTDLG_BASE(Class) \
......@@ -91,7 +91,7 @@ bool Class::selectPageByUIXMLDescription(const OString& rUIXMLDescription) \
{ \
return pDlg->selectPageByUIXMLDescription(rUIXMLDescription); \
} \
Bitmap Class::createScreenshot() const \
BitmapEx Class::createScreenshot() const \
{ \
return pDlg->createScreenshot(); \
} \
......
......@@ -31,7 +31,7 @@ public: \
} \
virtual std::vector<OString> getAllPageUIXMLDescriptions() const override; \
virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; \
virtual Bitmap createScreenshot() const override; \
virtual BitmapEx createScreenshot() const override; \
virtual OString GetScreenshotId() const override; \
virtual ~Class() override; \
virtual short Execute() override ;
......@@ -39,7 +39,7 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
std::vector<OString> Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \
bool Class::selectPageByUIXMLDescription(const OString& rUIXMLDescription) { return pDlg->selectPageByUIXMLDescription(rUIXMLDescription); } \
Bitmap Class::createScreenshot() const { return pDlg->createScreenshot();} \
BitmapEx Class::createScreenshot() const { return pDlg->createScreenshot();} \
OString Class::GetScreenshotId() const { return pDlg->GetScreenshotId();} \
Class::~Class() \
{ \
......
......@@ -61,7 +61,7 @@ void ScreenshotTest::setUp()
}
}
void ScreenshotTest::implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId)
void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, const OString& rScreenshotId)
{
OUString aDirname, aBasename;
splitHelpId(rScreenshotId, aDirname, aBasename);
......@@ -87,7 +87,7 @@ void ScreenshotTest::implSaveScreenshot(const Bitmap& rScreenshot, const OString
void ScreenshotTest::saveScreenshot(VclAbstractDialog const & rDialog)
{
const Bitmap aScreenshot(rDialog.createScreenshot());
const BitmapEx aScreenshot(rDialog.createScreenshot());
if (!aScreenshot.IsEmpty())
{
......@@ -102,7 +102,7 @@ void ScreenshotTest::saveScreenshot(VclAbstractDialog const & rDialog)
void ScreenshotTest::saveScreenshot(Dialog& rDialog)
{
const Bitmap aScreenshot(rDialog.createScreenshot());
const BitmapEx aScreenshot(rDialog.createScreenshot());
if (!aScreenshot.IsEmpty())
{
......
......@@ -22,7 +22,7 @@
#include <rtl/ustring.hxx>
#include <osl/module.hxx>
#include <vcl/abstdlg.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
typedef VclAbstractDialogFactory* (*FuncPtrCreateDialogFactory)();
......@@ -76,10 +76,10 @@ bool VclAbstractDialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDesc
return true;
}
Bitmap VclAbstractDialog::createScreenshot() const
BitmapEx VclAbstractDialog::createScreenshot() const
{
// default returns empty bitmap
return Bitmap();
return BitmapEx();
}
// virtual
......
......@@ -965,7 +965,7 @@ void Dialog::ensureRepaint()
}
}
Bitmap Dialog::createScreenshot()
BitmapEx Dialog::createScreenshot()
{
// same prerequisites as in Execute()
setDeferredProperties();
......@@ -974,7 +974,7 @@ Bitmap Dialog::createScreenshot()
ToTop();
ensureRepaint();
return GetBitmap(Point(), GetOutputSizePixel());
return GetBitmapEx(Point(), GetOutputSizePixel());
}
short Dialog::Execute()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment