desktop/source/lib/init.cxx | 7 +++++++ include/LibreOfficeKit/LibreOfficeKit.h | 3 +++ include/LibreOfficeKit/LibreOfficeKit.hxx | 10 ++++++++++ include/LibreOfficeKit/LibreOfficeKitEnums.h | 7 +++++++ 4 files changed, 27 insertions(+)
New commits: commit 0cf8aa992cfec36afea1668f3f9297def03ad43e Author: Miklos Vajna <[email protected]> Date: Mon Nov 23 09:32:37 2015 +0100 LOK: add Document::getTileMode() So that clients can know if they get old-style RGBA or new-style ARGB output in paintTile(). Change-Id: Icfde4b3259444b3524e64478ccd976664a3fe0ed (cherry picked from commit fc06f801ee79fd49d54c27121ae9b2904d99f09c) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 26a64d9..d3fc402 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -321,6 +321,7 @@ void doc_paintTile(LibreOfficeKitDocument* pThis, const int nCanvasWidth, const int nCanvasHeight, const int nTilePosX, const int nTilePosY, const int nTileWidth, const int nTileHeight); +static int doc_getTileMode(LibreOfficeKitDocument* pThis); static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, long* pWidth, long* pHeight); @@ -394,6 +395,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->getPartName = doc_getPartName; m_pDocumentClass->setPartMode = doc_setPartMode; m_pDocumentClass->paintTile = doc_paintTile; + m_pDocumentClass->getTileMode = doc_getTileMode; m_pDocumentClass->getDocumentSize = doc_getDocumentSize; m_pDocumentClass->initializeForRendering = doc_initializeForRendering; m_pDocumentClass->registerCallback = doc_registerCallback; @@ -965,6 +967,11 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, #endif } +static int doc_getTileMode(LibreOfficeKitDocument* /*pThis*/) +{ + return LOK_TILEMODE_RGBA; +} + static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, long* pWidth, long* pHeight) diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 93f7dca..5189cca 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -118,6 +118,9 @@ struct _LibreOfficeKitDocumentClass const int nTileWidth, const int nTileHeight); + /// @see lok::Document::getTileMode(). + int (*getTileMode) (LibreOfficeKitDocument* pThis); + /// @see lok::Document::getDocumentSize(). void (*getDocumentSize) (LibreOfficeKitDocument* pThis, long* pWidth, diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 0eeb5be..f907f70 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -140,6 +140,16 @@ public: nTilePosX, nTilePosY, nTileWidth, nTileHeight); } + /** + * Gets the tile mode: the pixel format used for the pBuffer of paintTile(). + * + * @return an element of the LibreOfficeKitTileMode enum. + */ + inline int getTileMode() + { + return mpDoc->pClass->getTileMode(mpDoc); + } + /// Get the document sizes in TWIPs. inline void getDocumentSize(long* pWidth, long* pHeight) { diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 7b23fcb..b713f0e 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -35,6 +35,13 @@ LibreOfficeKitPartMode; typedef enum { + LOK_TILEMODE_RGBA, + LOK_TILEMODE_ARGB +} +LibreOfficeKitTileMode; + +typedef enum +{ /** * Any tiles which are over the rectangle described in the payload are no * longer valid. _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
