Kaydet (Commit) fc06f801 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 2e64d3ed
......@@ -312,6 +312,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);
......@@ -385,6 +386,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;
......@@ -958,6 +960,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)
......
......@@ -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,
......
......@@ -143,6 +143,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)
{
......
......@@ -33,6 +33,13 @@ typedef enum
}
LibreOfficeKitPartMode;
typedef enum
{
LOK_TILEMODE_RGBA,
LOK_TILEMODE_ARGB
}
LibreOfficeKitTileMode;
typedef enum
{
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment