summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-28 18:07:44 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-10-02 10:57:15 +0530
commit9874cd5efae7fb45f68da0e5ebc7701fdad0414a (patch)
treef5895b5a779958e436117149bd25943e31e491c2 /include
parent706e4d198683f6c2075a91050d21a298ad186cc6 (diff)
lokdialog: Dialog invalidation support
For now, just invalidate the whole dialog whenever any of the controls in the dialog get invalidated. Since during dialog painting, many such invalidations are triggered, don't listen to them when we are painting. Change-Id: Ia8fc12cf9469691d60e91ef770d687e5ff01a7ef
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h6
-rw-r--r--include/comphelper/lok.hxx4
-rw-r--r--include/sfx2/basedlgs.hxx2
-rw-r--r--include/sfx2/lokhelper.hxx2
-rw-r--r--include/vcl/ctrl.hxx2
-rw-r--r--include/vcl/dialog.hxx7
6 files changed, 19 insertions, 4 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index c3b71f3f1aad..fdad6919e0e1 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -521,7 +521,11 @@ typedef enum
*
* Here all aproperties are same as described in svxruler.
*/
- LOK_CALLBACK_RULER_UPDATE = 35
+ LOK_CALLBACK_RULER_UPDATE = 35,
+ /**
+ * Dialog invalidation
+ */
+ LOK_CALLBACK_DIALOG_INVALIDATE = 36
}
LibreOfficeKitCallbackType;
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 253541a80cb6..7a293ca70352 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -52,6 +52,10 @@ COMPHELPER_DLLPUBLIC void setPartInInvalidation(bool bPartInInvalidation);
COMPHELPER_DLLPUBLIC bool isTiledPainting();
/// Set if we are doing tiled painting.
COMPHELPER_DLLPUBLIC void setTiledPainting(bool bTiledPainting);
+/// Check if we are painting the dialog.
+COMPHELPER_DLLPUBLIC bool isDialogPainting();
+/// Set if we are painting the dialog.
+COMPHELPER_DLLPUBLIC void setDialogPainting(bool bDialogPainting);
/// Set if we want no annotations rendering
COMPHELPER_DLLPUBLIC void setTiledAnnotations(bool bTiledAnnotations);
/// Check if annotations rendering is turned off
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index cb403c78a075..7609229db2a6 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -105,6 +105,8 @@ public:
SfxBindings& GetBindings()
{ return *pBindings; }
+ virtual void LogicInvalidate(const tools::Rectangle* pRectangle) override;
+
DECL_LINK(TimerHdl, Timer *, void);
};
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 9cf98fa40c88..514726ee1e0b 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -40,6 +40,8 @@ public:
static void notifyOtherViews(SfxViewShell* pThisView, int nType, const OString& rKey, const OString& rPayload);
/// Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell const* pOtherView, int nType, const OString& rKey, const OString& rPayload);
+ /// Emits a LOK_CALLBACK_DIALOG_INVALIDATE with 'invalidate' action
+ static void notifyDialogInvalidation(const OUString& rPayload);
/// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
static void notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload);
/// A special value to signify 'infinity'.
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index cb68cfe8f78a..8e2926ae1774 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -44,6 +44,8 @@ private:
SAL_DLLPRIVATE void ImplInitControlData();
+ virtual void LogicInvalidate(const tools::Rectangle* pRectangle) override;
+
Control (const Control &) = delete;
Control & operator= (const Control &) = delete;
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 457943c08d37..7a3aa4c0c1c0 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -72,10 +72,14 @@ private:
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag = InitFlag::Default );
+ OUString maID; // identifier for this dialog
public:
SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; }
virtual void doDeferredInit(WinBits nBits) override;
+ virtual void LogicInvalidate(const tools::Rectangle* pRectangle) override { (void)pRectangle; }
+ // Paints the current dialog to the given virtual device
+ void paintDialog(VirtualDevice& rDevice);
protected:
explicit Dialog( WindowType nType );
@@ -114,9 +118,6 @@ public:
virtual void PrePaint(vcl::RenderContext& rRenderContext) override;
virtual void PostPaint(vcl::RenderContext& rRenderContext) override;
- // Paints the current dialog to the given virtual device
- void paintDialog(VirtualDevice& rDevice);
-
// ensureRepaint - triggers Application::Yield until the dialog is
// completely repainted. Sometimes needed for dialogs showing progress
// during actions