summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-10-26 15:21:06 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-07 12:53:17 +0100
commite94ceb6eff0edd1699d21b8b860f6929236a90ef (patch)
tree0b61a594602e1f4c7bfd3b1c42d1516f7ebda2b5 /include
parent053d9247ce0818580658a7b6f5854f8b21754f7c (diff)
lokdialog: Implement hi-dpi support for the routed dialogs.
Change-Id: I770c605a049b7ac9c26c2773414eef8b6fc093a2
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h9
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx13
2 files changed, 19 insertions, 3 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 0799584d3097..f8021065af1e 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -309,6 +309,15 @@ struct _LibreOfficeKitDocumentClass
/// @see lok::Document::getPartInfo().
char* (*getPartInfo) (LibreOfficeKitDocument* pThis, int nPart);
+ /// Paints window with given id to the buffer with the give DPI scale
+ /// (every pixel is dpiscale-times larger).
+ /// @see lok::Document::paintWindow().
+ void (*paintWindowDPI) (LibreOfficeKitDocument* pThis, unsigned nWindowId,
+ unsigned char* pBuffer,
+ const int x, const int y,
+ const int width, const int height,
+ const double dpiscale);
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 232eada69821..51d072331762 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -164,16 +164,23 @@ public:
* @param y y-coordinate from where the dialog should start painting
* @param width The width of the dialog image to be painted
* @param height The height of the dialog image to be painted
+ * @param dpiscale The dpi scale value used by the client. Please note
+ * that the x, y, width, height are supposed to be the
+ * values with dpiscale applied (ie. dialog covering
+ * 100x100 "normal" pixels with dpiscale '2' will have
+ * 200x200 width x height), so that it is easy to compute
+ * the buffer sizes etc.
*/
void paintWindow(unsigned nWindowId,
unsigned char* pBuffer,
const int x,
const int y,
const int width,
- const int height)
+ const int height,
+ const double dpiscale = 1.0)
{
- return mpDoc->pClass->paintWindow(mpDoc, nWindowId, pBuffer,
- x, y, width, height);
+ return mpDoc->pClass->paintWindowDPI(mpDoc, nWindowId, pBuffer,
+ x, y, width, height, dpiscale);
}
/**