diff options
author | Tor Lillqvist <tml@collabora.com> | 2023-02-28 18:23:06 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2023-03-01 08:28:21 +0000 |
commit | 91afabee6bece4cbf61a8f32a6e6a69becd857ae (patch) | |
tree | bc64d53f5f2d47256fd5db62af2efd3082047c91 /include | |
parent | 25a01778f998618d9a4d0de9da5784e0e60e3259 (diff) |
Improve the LibreOfficeKit Document::paintThumbnail() API
No implementation yet.
Change-Id: Ie1dc955bc8b589bd336af0545a2270cbe84a8b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148028
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 7 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 24 |
2 files changed, 27 insertions, 4 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 4de2380998b4..09d3e91e8640 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -501,10 +501,13 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setViewTimezone(). void (*setViewTimezone) (LibreOfficeKitDocument* pThis, int nId, const char* timezone); + /// @see lok::Document::paintThumbnail(). void (*paintThumbnail) (LibreOfficeKitDocument* pThis, unsigned char* pBuffer, - int x, - int y); + int bufferWidth, + int bufferHeight, + int width, + const char* pURL); #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 17fc518fbe13..04a3b82e6eca 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -886,9 +886,29 @@ public: mpDoc->pClass->setViewTimezone(mpDoc, nId, timezone); } - void paintThumbnail(unsigned char* pBuffer, int x, int y) + /** + * Create a thumbnail of a location in the document. + * + * @param pBuffer Where the thumbnail is painted. Same format as a tile painted + * by paintTile(). + * @param bufferWidth number of pixels in a row of pBuffer. + * @param bufferHeight number of pixels in a column of pBuffer. + * @param width logical width of the rendered rectangle, in TWIPs. + * @param pURL Just the fragment part of a URL, indicating the location in the document + * to render as a thumbnail. As returned by extractRequest(), or null, meaning the start + * of the document. + * + * Note that there is no parameter for the logical height of the + * rendered rectangle. The aspect ratio of the rendered rectangle + * is determined by the bufferWidth and bufferHeight parameters. + */ + void paintThumbnail(unsigned char* pBuffer, + int bufferWidth, + int bufferHeight, + int width, + const char* pURL) { - return mpDoc->pClass->paintThumbnail(mpDoc, pBuffer, x, y); + return mpDoc->pClass->paintThumbnail(mpDoc, pBuffer, bufferWidth, bufferHeight, width, pURL); } #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY |