1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

covers from native plugins (in progress)

This commit is contained in:
Nikolay Pultsin 2012-03-27 16:15:33 +01:00
parent 5518e9ef78
commit 79a06410ae
2 changed files with 6 additions and 9 deletions

View file

@ -287,6 +287,6 @@ JNIEXPORT jboolean JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPl
}
extern "C"
JNIEXPORT jobject JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readCoverInternal(JNIEnv* env, jobject thiz, jobject file) {
return 0;
JNIEXPORT void JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readCoverInternal(JNIEnv* env, jobject thiz, jobject file, jobjectArray box) {
// TODO: implement
}

View file

@ -29,8 +29,6 @@ import org.geometerplus.fbreader.bookmodel.BookReadingException;
import org.geometerplus.fbreader.library.Book;
public class NativeFormatPlugin extends FormatPlugin {
private static Object ourCoversLock = new Object();
// No free method because all plugins' instances are freed by
// PluginCollection::deleteInstance method (C++)
@ -74,15 +72,14 @@ public class NativeFormatPlugin extends FormatPlugin {
@Override
public ZLSingleImage getRealImage() {
// Synchronized block is needed because we use temporary storage files
synchronized (ourCoversLock) {
return (ZLSingleImage)readCoverInternal(file);
}
final ZLImage[] box = new ZLImage[1];
readCoverInternal(file, box);
return (ZLSingleImage)box[0];
}
};
}
protected native ZLImage readCoverInternal(ZLFile file);
protected native void readCoverInternal(ZLFile file, ZLImage[] box);
/*
public static ZLImage createImage(String mimeType, String fileName, int offset, int length) {