Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
18c052d6
Kaydet (Commit)
18c052d6
authored
Eyl 22, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
LOKit: add "destroy" and "saveAs" to android JNI
Change-Id: I08542b736e49cb9262323e9fe6188b1976d47935
üst
67ad72f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
9 deletions
+49
-9
Document.java
android/Bootstrap/src/org/libreoffice/kit/Document.java
+4
-0
Office.java
android/Bootstrap/src/org/libreoffice/kit/Office.java
+2
-2
lokandroid.cxx
desktop/source/lib/lokandroid.cxx
+43
-7
No files found.
android/Bootstrap/src/org/libreoffice/kit/Document.java
Dosyayı görüntüle @
18c052d6
...
@@ -24,6 +24,8 @@ public class Document {
...
@@ -24,6 +24,8 @@ public class Document {
this
.
handle
=
handle
;
this
.
handle
=
handle
;
}
}
public
native
void
destroy
();
public
native
int
getPart
();
public
native
int
getPart
();
public
native
void
setPart
(
int
partIndex
);
public
native
void
setPart
(
int
partIndex
);
...
@@ -40,6 +42,8 @@ public class Document {
...
@@ -40,6 +42,8 @@ public class Document {
private
native
int
getDocumentTypeNative
();
private
native
int
getDocumentTypeNative
();
private
native
void
saveAs
(
String
url
,
String
format
,
String
options
);
private
native
void
paintTileNative
(
ByteBuffer
buffer
,
int
canvasWidth
,
int
canvasHeight
,
int
tilePositionX
,
int
tilePositionY
,
int
tileWidth
,
int
tileHeight
);
private
native
void
paintTileNative
(
ByteBuffer
buffer
,
int
canvasWidth
,
int
canvasHeight
,
int
tilePositionX
,
int
tilePositionY
,
int
tileWidth
,
int
tileHeight
);
public
int
getDocumentType
()
{
public
int
getDocumentType
()
{
...
...
android/Bootstrap/src/org/libreoffice/kit/Office.java
Dosyayı görüntüle @
18c052d6
...
@@ -9,8 +9,6 @@
...
@@ -9,8 +9,6 @@
package
org
.
libreoffice
.
kit
;
package
org
.
libreoffice
.
kit
;
import
android.util.Log
;
public
class
Office
{
public
class
Office
{
private
long
handle
;
private
long
handle
;
...
@@ -31,4 +29,6 @@ public class Office {
...
@@ -31,4 +29,6 @@ public class Office {
}
}
return
document
;
return
document
;
}
}
public
native
void
destroy
();
}
}
desktop/source/lib/lokandroid.cxx
Dosyayı görüntüle @
18c052d6
...
@@ -41,6 +41,17 @@ void setHandle(JNIEnv* pEnv, jobject aObject, T* aType)
...
@@ -41,6 +41,17 @@ void setHandle(JNIEnv* pEnv, jobject aObject, T* aType)
pEnv
->
SetLongField
(
aObject
,
getHandleField
(
pEnv
,
aObject
),
aHandle
);
pEnv
->
SetLongField
(
aObject
,
getHandleField
(
pEnv
,
aObject
),
aHandle
);
}
}
const
char
*
copyJavaString
(
JNIEnv
*
pEnv
,
jstring
aJavaString
)
{
const
char
*
pClone
=
NULL
;
const
char
*
pTemp
=
pEnv
->
GetStringUTFChars
(
aJavaString
,
NULL
);
pClone
=
strdup
(
pTemp
);
pEnv
->
ReleaseStringUTFChars
(
aJavaString
,
pTemp
);
return
pClone
;
}
extern
"C"
SAL_JNI_EXPORT
jstring
JNICALL
Java_org_libreoffice_kit_Office_getError
(
JNIEnv
*
pEnv
,
jobject
aObject
)
extern
"C"
SAL_JNI_EXPORT
jstring
JNICALL
Java_org_libreoffice_kit_Office_getError
(
JNIEnv
*
pEnv
,
jobject
aObject
)
{
{
LibreOfficeKit
*
pLibreOfficeKit
=
getHandle
<
LibreOfficeKit
>
(
pEnv
,
aObject
);
LibreOfficeKit
*
pLibreOfficeKit
=
getHandle
<
LibreOfficeKit
>
(
pEnv
,
aObject
);
...
@@ -53,21 +64,29 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_initializ
...
@@ -53,21 +64,29 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_initializ
pEnv
->
SetLongField
(
aObject
,
getHandleField
(
pEnv
,
aObject
),
aLokHandle
);
pEnv
->
SetLongField
(
aObject
,
getHandleField
(
pEnv
,
aObject
),
aLokHandle
);
}
}
extern
"C"
SAL_JNI_EXPORT
jlong
JNICALL
Java_org_libreoffice_kit_Office_documentLoadNative
(
JNIEnv
*
pEnv
,
jobject
aObject
,
jstring
documentPath
)
extern
"C"
SAL_JNI_EXPORT
void
JNICALL
Java_org_libreoffice_kit_Office_destroy
(
JNIEnv
*
pEnv
,
jobject
aObject
)
{
{
const
char
*
aCloneDocumentPath
;
LibreOfficeKit
*
pLibreOfficeKit
=
getHandle
<
LibreOfficeKit
>
(
pEnv
,
aObject
);
pLibreOfficeKit
->
pClass
->
destroy
(
pLibreOfficeKit
);
const
char
*
aCharDocumentPath
=
pEnv
->
GetStringUTFChars
(
documentPath
,
NULL
);
}
aCloneDocumentPath
=
strdup
(
aCharDocumentPath
);
pEnv
->
ReleaseStringUTFChars
(
documentPath
,
aCharDocumentPath
);
extern
"C"
SAL_JNI_EXPORT
jlong
JNICALL
Java_org_libreoffice_kit_Office_documentLoadNative
(
JNIEnv
*
pEnv
,
jobject
aObject
,
jstring
documentPath
)
{
const
char
*
aCloneDocumentPath
=
copyJavaString
(
pEnv
,
documentPath
);
LibreOfficeKit
*
pLibreOfficeKit
=
getHandle
<
LibreOfficeKit
>
(
pEnv
,
aObject
);
LibreOfficeKit
*
pLibreOfficeKit
=
getHandle
<
LibreOfficeKit
>
(
pEnv
,
aObject
);
LibreOfficeKitDocument
*
pDocument
=
pLibreOfficeKit
->
pClass
->
documentLoad
(
pLibreOfficeKit
,
aCloneDocumentPath
);
LibreOfficeKitDocument
*
pDocument
=
pLibreOfficeKit
->
pClass
->
documentLoad
(
pLibreOfficeKit
,
aCloneDocumentPath
);
return
(
jlong
)
(
intptr_t
)
pDocument
;
return
(
jlong
)
pDocument
;
}
}
/* Document */
/* Document */
extern
"C"
SAL_JNI_EXPORT
void
JNICALL
Java_org_libreoffice_kit_Document_destroy
(
JNIEnv
*
pEnv
,
jobject
aObject
)
{
LibreOfficeKitDocument
*
pDocument
=
getHandle
<
LibreOfficeKitDocument
>
(
pEnv
,
aObject
);
pDocument
->
pClass
->
destroy
(
pDocument
);
}
extern
"C"
SAL_JNI_EXPORT
void
JNICALL
Java_org_libreoffice_kit_Document_setPart
extern
"C"
SAL_JNI_EXPORT
void
JNICALL
Java_org_libreoffice_kit_Document_setPart
(
JNIEnv
*
pEnv
,
jobject
aObject
,
jint
aPart
)
(
JNIEnv
*
pEnv
,
jobject
aObject
,
jint
aPart
)
{
{
...
@@ -145,4 +164,21 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_org_libreoffice_kit_Document_getDoc
...
@@ -145,4 +164,21 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_org_libreoffice_kit_Document_getDoc
return
nWidth
;
return
nWidth
;
}
}
extern
"C"
SAL_JNI_EXPORT
jint
JNICALL
Java_org_libreoffice_kit_Office_saveAs
(
JNIEnv
*
pEnv
,
jobject
aObject
,
jstring
sUrl
,
jstring
sFormat
,
jstring
sOptions
)
{
LibreOfficeKitDocument
*
pDocument
=
getHandle
<
LibreOfficeKitDocument
>
(
pEnv
,
aObject
);
const
char
*
pUrl
=
pEnv
->
GetStringUTFChars
(
sUrl
,
NULL
);
const
char
*
pFormat
=
pEnv
->
GetStringUTFChars
(
sFormat
,
NULL
);
const
char
*
pOptions
=
pEnv
->
GetStringUTFChars
(
sOptions
,
NULL
);
int
result
=
pDocument
->
pClass
->
saveAs
(
pDocument
,
pUrl
,
pFormat
,
pOptions
);
pEnv
->
ReleaseStringUTFChars
(
sUrl
,
pUrl
);
pEnv
->
ReleaseStringUTFChars
(
sFormat
,
pFormat
);
pEnv
->
ReleaseStringUTFChars
(
sOptions
,
pOptions
);
return
result
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment