summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-10 16:17:18 +0300
committerTor Lillqvist <tml@collabora.com>2018-10-10 16:25:20 +0300
commit1d279e9c9123d50788cefb186663ef3842aaa8c2 (patch)
tree2a9449cb1894ca63201919963b3ba893421d119d /include/LibreOfficeKit
parentd143e211b1416665d77cd1914dd7f6a6b0b4f72a (diff)
Move the iOS CGBitmapContextCreate() call do doc_paintTile()
Thus it now actually takes a buffer pointer also on iOS, like on Linux and Android. Less confusing, more uniform. Add a separate iOS-specific paintTileToCGContext() method to LibreOfficeKitDocumentClass that takes a CGContextRef. Adapt callers correspondingly. (The LibreOfficeLight code in particular needs the paintTileToCGContext().) Change-Id: I81084806d37b9aac9f2b2bc03d0c262e991eec81
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h12
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx28
2 files changed, 40 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 0799584d3097..0ae5c6ff1332 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -309,6 +309,18 @@ struct _LibreOfficeKitDocumentClass
/// @see lok::Document::getPartInfo().
char* (*getPartInfo) (LibreOfficeKitDocument* pThis, int nPart);
+#ifdef IOS
+ /// @see lok::Document::paintTileToCGContext().
+ void (*paintTileToCGContext) (LibreOfficeKitDocument* pThis,
+ void* rCGContext,
+ const int nCanvasWidth,
+ const int nCanvasHeight,
+ const int nTilePosX,
+ const int nTilePosY,
+ const int nTileWidth,
+ const int nTileHeight);
+#endif // IOS
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 232eada69821..3568c861f083 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -550,6 +550,34 @@ public:
mpDoc->pClass->postWindowExtTextInputEvent(mpDoc, nWindowId, nType, pText);
}
+#ifdef IOS
+ /**
+ * Renders a subset of the document to a Core Graphics context.
+ *
+ * Note that the buffer size and the tile size implicitly supports
+ * rendering at different zoom levels, as the number of rendered pixels and
+ * the rendered rectangle of the document are independent.
+ *
+ * @param rCGContext the CGContextRef, cast to a void*.
+ * @param nCanvasHeight number of pixels in a column of pBuffer.
+ * @param nTilePosX logical X position of the top left corner of the rendered rectangle, in TWIPs.
+ * @param nTilePosY logical Y position of the top left corner of the rendered rectangle, in TWIPs.
+ * @param nTileWidth logical width of the rendered rectangle, in TWIPs.
+ * @param nTileHeight logical height of the rendered rectangle, in TWIPs.
+ */
+ void paintTileToCGContext(void* rCGContext,
+ const int nCanvasWidth,
+ const int nCanvasHeight,
+ const int nTilePosX,
+ const int nTilePosY,
+ const int nTileWidth,
+ const int nTileHeight)
+ {
+ return mpDoc->pClass->paintTileToCGContext(mpDoc, rCGContext, nCanvasWidth, nCanvasHeight,
+ nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+ }
+#endif // IOS
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};