summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-09-17Android app: Update rgba -> bgra.Robin Watts
The separation class had a member renamed. Rename it here too.
2016-09-17Java bindings: Improve exception messagesRobin Watts
2016-09-16Remove unused variable.Robin Watts
2016-09-16Correct assertion in pdf-store.Robin Watts
We can use names as keys for colorspaces. These are not bound to a particular document.
2016-09-16Add some missing #ifdeffery for Memento.Robin Watts
2016-09-16More tweaking of gproof device gs invocation.Robin Watts
If USE_GS_API is defined, we use the gsapi interface to call gs. The gsapi interface is defined in iapi.h, which is not included in the mupdf source code. We therefore include a potted version of this API inline. To use the original, pass HAVE_IAPI_H at compile time.
2016-09-16MSVS: Make libfonts consistent with other projectsRobin Watts
Its output directory was set differently.
2016-09-16Bug 695988: Avoid sending image data multiple times.Robin Watts
If the same image is used repeatedly, then we currently send the data again and again. Instead, send each image as a reusable symbol and reuse it as required. This reduces the size of the output by over 50% for the example file, but unfortunately results in the example file killing both Firefox and Edge when we attempt to load it. The file seems entirely valid though, and this is a saving on sane files. There is a #define that can be made to revert to the old behaviour (SVG_SEND_REPEATED_IMAGES).
2016-09-16Call Memento_fin in java Document_destroy().Robin Watts
As reasonable a place to call it as we can hope for. If we ever have 2 documents open and we close 1 then it will dump more blocks than we like, but when we get to that stage we can worry about it then.
2016-09-16Silence some warnings.Robin Watts
2016-09-16MSVS: Correct paths to java files and add missing ones.Robin Watts
Not used, other than for the convenience of editing/searching.
2016-09-16Android JNI context fixes.Robin Watts
In the JNI code, we attach a cloned context onto each thread we encounter in thread local storage. When the thread shuts down, we should destroy that context. This can theoretically be achieved on pthreads by using the destructor registered to the tls slot. I have yet to see Android ever actually call this destructor yet though. No such mechanism exists for windows thread, so we'll just leak here for now. There is a potential fix for this, but it's hairy, so details are left in a comment in the code.
2016-09-16Improve fz_filter_store speed.Robin Watts
Now linear time rather than n^2.
2016-09-16Tweak store handling of PDF document destroy.Robin Watts
When we destroy a PDF document, currently we bin everything from the store. Instead, drop just the objects that are specifically tied to that document. Any object tied to the document has a pdf_obj with the required document pointer in it as the key.
2016-09-16Tweak gprf-doc.c to avoid warnings.Robin Watts
2016-09-16JNI: Handle the case where an object's native pointer is NULL.Sebastian Rasmussen
If Java code creates e.g. a Document object and later calls Document.destroy() and then keeps using the Document object the library would end up crashing because the native pointer was null. This case rather special case is now handled.
2016-09-16JNI: Do not fail on using null as a value in a dictionary.Sebastian Rasmussen
The underlying pdf_dict_put() converts into a null object.
2016-09-16JNI: Check if get_context has thrown exception,Sebastian Rasmussen
But do not check it twice.
2016-09-16JNI: Avoid throwing IllegalargumentException.Sebastian Rasmussen
2016-09-16JNI: Avoid getting context if not needed.Sebastian Rasmussen
2016-09-16JNI: Remove forgotten FIXME.Sebastian Rasmussen
This case can be handled gracefully since commit 2d3eca6dec6b8fc7a169b3fc357904069df6b6c4.
2016-09-16Extend store to cope with references used in keys.Robin Watts
The store is effectively a list of items, where each item is a (key, value) pair. The design is such that we can easily get into the state where the only reference to a value is that held by the store. Subsequent references can then be generated by things being 'found' from within the store. While the only reference to an object is that held by it being a value in the store, the store is free to evict it to save memory. Images present a complication to this design; images are stored both as values within the store (by the pdf agent, so that we do not regenerate images each time we meet them in the file), and as parts of the keys within the store. For example, once an image is decoded to give a pixmap, the pixmap is cached in the store. The key to look that pixmap up again includes a reference to the image from which the pixmap was generated. This means, that for document handlers such as gproof that do not place images in the store, we can end up with images that are kept around purely by dint of being used as references in store keys. There is no chance of the value (the decoded pixmap) ever being 'found' from the store as no one other than the key is holding a reference to the image required. Thus the images/pixmaps are never freed until the store is emptied. This commit offers a fix for this situation. Standard store items are based on an fz_storable type. Here we introduce a new fz_key_storable type derived from that. As well as keeping track of the number of references a given item has to it, it keeps a separate count of the number of references a given item has to it from keys in the store. On dropping a reference, we check to see if the number of references has become the same as the number of references from keys in the store. If it has, then we know that these keys can never be 'found' again. So we filter them out of the store, which drops the items.
2016-09-16Update gproof device to invoke gs better.Robin Watts
When invoking gs, pass in -gWIDTHxHEIGHT -dFitPage. This avoids any possible mismatch betwen the page size we expect and the page size that gs returns.
2016-09-16fz_unpack_tile now skips extra input components.Sebastian Rasmussen
This is useful when a TIFF image is grayscale but supplies more than a single component per sample.
2016-09-15JNI: Ensure that BufferInputStream position is in range.Sebastian Rasmussen
2016-09-15JNI: Catch fitz exceptions and convert to Java exceptions.Sebastian Rasmussen
2016-09-15JNI: Don't replace Java exception with one from fitz.Sebastian Rasmussen
The JNI interface throws exceptions of its own, keep those instead of replacing them.
2016-09-15JNI: Throw IllegalArgumentException for null arguments.Sebastian Rasmussen
2016-09-15JNI: Delete global ref to Separation class after use.Sebastian Rasmussen
2016-09-15JNI: Rename member variable to fit with usage.Sebastian Rasmussen
Page_getSeparation() does the corresponding conversion.
2016-09-15JNI: Check context in consistent way.Sebastian Rasmussen
Also there is no need to check self pointer since JVM does not even call the JNI binding for null pointers.
2016-09-15JNI: Fix compiler warning about unused variables.Sebastian Rasmussen
2016-09-14Redirect fprintf to android logcat in debug builds.Robin Watts
This makes debugging much simpler.
2016-09-14Rename helper function in mupdf_native.cRobin Watts
This avoids a symbol clash when using scripts/destatic.sh
2016-09-14Don't report addRef/dropRef events to Memento twice.Robin Watts
We call Memento_addRef etc in fz_keep_impXX functions, so don't call them in the callers too.
2016-09-14Fix typo in Memento header.Robin Watts
2016-09-14Android example - delete temp files after proofing, destroy the document and ↵fred ross-perry
pages after use.
2016-09-14Android example: add options argument in calls to Page.toStructuredTextfred ross-perry
2016-09-14Android example - Add proofing support.fred ross-perry
2016-09-14Android example - drawing ink annotationsfred ross-perry
This commit puts in the UI for drawing with color and line thickness. But it does not yet save this to the document.
2016-09-14Android example - add button for toggling annotations.Fred Ross-Perry
2016-09-14Android example - file toolbar icons, password dialogFred Ross-Perry
add five icons to the File toolbar (not yet functioning) add a dialog to collect the password from the user for protected documents.
2016-09-14Android example - hook up the back button to finish the activity.Fred Ross-Perry
2016-09-14Add scripts to remove/replace 'static' from functions.Robin Watts
Getting a backtrace out with missing functions makes the backtrace much less useful. Some backtrace routines (such as that used by Memento on Android) are incapable of resolving static functions. We therefore provide 2 scripts (scripts/destatic.sh and scripts/restatic.sh) that respectively remove and replace the 'static' from function definitions. The scripts do not affect "static inline" or "static const" definitions, and they are are restricted to working in the source directory (excluding source/tools), thirdparty/mujs and the platform/{java,android} directories. The transformed source should NOT be checked in. To avoid problems with clashing symbols, some functions are renamed or tweaked slightly in this patch.
2016-09-14Fix clang compiler warnings.Sebastian Rasmussen
2016-09-14Update android logging code within Memento.Robin Watts
Work around the problems in that androids logging only works in whole lines by buffering until we have one. Also, androids logging goes to a circular buffer that loses data when it overflows. Hack around this by adding a 1ms sleep after every line output.
2016-09-14Table should be static const.Robin Watts
2016-09-13Fix Memento Android backtrace code.Robin Watts
Thanks to Sebastian for pointing out that the demangling code wants a malloced block, cos it might realloc it. Drop back to the dumber version.
2016-09-13Update MuPDF Android build for Memento.Robin Watts
Call Memento_fin rather than piecemeal functions to ensure we get full details when available. Ensure we link with the required lib for backtracing to work in Memento builds.
2016-09-13Update Memento for Android.Robin Watts
Add backtrace abilities, and fix missing return value from android logging.