Kaydet (Commit) 6123d6a9 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

android: Add initializeForRendering to LOK

Change-Id: Ibf4721bf4358ef215efde09ef688b2551604bfa2
üst 766c1243
...@@ -59,4 +59,7 @@ public class Document { ...@@ -59,4 +59,7 @@ public class Document {
public void paintTile(ByteBuffer buffer, int canvasWidth, int canvasHeight, int tilePositionX, int tilePositionY, int tileWidth, int tileHeight) { public void paintTile(ByteBuffer buffer, int canvasWidth, int canvasHeight, int tilePositionX, int tilePositionY, int tileWidth, int tileHeight) {
paintTileNative(buffer, canvasWidth, canvasHeight, tilePositionX, tilePositionY, tileWidth, tileHeight); paintTileNative(buffer, canvasWidth, canvasHeight, tilePositionX, tilePositionY, tileWidth, tileHeight);
} }
public native void initializeForRendering();
} }
...@@ -197,6 +197,8 @@ void doc_paintTile(LibreOfficeKitDocument* pThis, ...@@ -197,6 +197,8 @@ void doc_paintTile(LibreOfficeKitDocument* pThis,
static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
long* pWidth, long* pWidth,
long* pHeight); long* pHeight);
static void doc_initializeForRendering(LibreOfficeKitDocument* pThis);
struct LibLODocument_Impl : public _LibreOfficeKitDocument struct LibLODocument_Impl : public _LibreOfficeKitDocument
{ {
...@@ -222,6 +224,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument ...@@ -222,6 +224,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass->setPartMode = doc_setPartMode; m_pDocumentClass->setPartMode = doc_setPartMode;
m_pDocumentClass->paintTile = doc_paintTile; m_pDocumentClass->paintTile = doc_paintTile;
m_pDocumentClass->getDocumentSize = doc_getDocumentSize; m_pDocumentClass->getDocumentSize = doc_getDocumentSize;
m_pDocumentClass->initializeForRendering = doc_initializeForRendering;
gDocumentClass = m_pDocumentClass; gDocumentClass = m_pDocumentClass;
} }
...@@ -608,6 +611,15 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, ...@@ -608,6 +611,15 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
} }
} }
static void doc_initializeForRendering(LibreOfficeKitDocument* pThis)
{
ITiledRenderable* pDoc = getTiledRenderable(pThis);
if (pDoc)
{
pDoc->initializeForTiledRendering();
}
}
static char* lo_getError (LibreOfficeKit *pThis) static char* lo_getError (LibreOfficeKit *pThis)
{ {
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
......
...@@ -165,6 +165,13 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_org_libreoffice_kit_Document_getDoc ...@@ -165,6 +165,13 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_org_libreoffice_kit_Document_getDoc
return nWidth; return nWidth;
} }
extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_initializeForRendering
(JNIEnv* pEnv, jobject aObject)
{
LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
pDocument->pClass->initializeForRendering(pDocument);
}
extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Office_saveAs extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Office_saveAs
(JNIEnv* pEnv, jobject aObject, jstring sUrl, jstring sFormat, jstring sOptions) (JNIEnv* pEnv, jobject aObject, jstring sUrl, jstring sFormat, jstring sOptions)
{ {
......
...@@ -113,6 +113,10 @@ struct _LibreOfficeKitDocumentClass ...@@ -113,6 +113,10 @@ struct _LibreOfficeKitDocumentClass
void (*getDocumentSize) (LibreOfficeKitDocument* pThis, void (*getDocumentSize) (LibreOfficeKitDocument* pThis,
long* pWidth, long* pWidth,
long* pHeight); long* pHeight);
// Initialize document for rendering.
void (*initializeForRendering) (LibreOfficeKitDocument* pThis);
#endif // LOK_USE_UNSTABLE_API #endif // LOK_USE_UNSTABLE_API
}; };
......
...@@ -87,6 +87,12 @@ public: ...@@ -87,6 +87,12 @@ public:
{ {
mpDoc->pClass->getDocumentSize(mpDoc, pWidth, pHeight); mpDoc->pClass->getDocumentSize(mpDoc, pWidth, pHeight);
} }
inline void initializeForRendering()
{
mpDoc->pClass->initializeForRendering(mpDoc);
}
#endif // LOK_USE_UNSTABLE_API #endif // LOK_USE_UNSTABLE_API
}; };
......
...@@ -83,6 +83,10 @@ public: ...@@ -83,6 +83,10 @@ public:
{ {
(void) ePartMode; (void) ePartMode;
} }
virtual void initializeForTiledRendering()
{
}
}; };
} // namespace vcl } // namespace vcl
......
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