summaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
2014-07-22Set default output filename in mujstest.Tor Andersson
2014-07-18Fix VS project "generated" "Clean" step for Debug builds.Ray Johnston
It was missing one level of ..\ so failed trying to delete platform/generated
2014-07-17Add feature testing device, and call it from mudraw with -T flag.Tor Andersson
Currently only tests for the presence of non-grayscale color.
2014-07-17Fix odd animation when opening a document on iOS.Matt Holgate
The background colour of the MuDocumentController's root view wasn't set, so the MuLibraryController was showing through until it had been removed from the screen. Fix by setting the background colour to gray - the same colour as the window.
2014-07-16Fix page changing when rotating the device.Matt Holgate
A bug in UIKit means our 'scrollViewDidScroll' method is called during screen rotation. This ended up corrupting our current page number because the width of the screen had changed at this point, but the pages hadn't yet been resized/repositioned (I assume). The workaround is to ignore calls to scrollViewDidScroll during rotation.
2014-07-16Remove iOS debug output.Matt Holgate
This debug output was listing the names of all the files to the iOS console every 3 seconds. Remove it.
2014-07-14Add the ability to hook a post-archive script into the build process.Matt Holgate
Used by the Testflight build. The post-archive step requires nastiness to pass the result of the script back to the caller via a temporary file. The reason for this is that a bug in Xcode means that failures from post-archive steps do not get propagated back to the user who called xcodebuild archive. Also, update the postbuild script to explicitly invoke bash (so we can avoid assuming /bin/sh is bash, and to avoid problems where executable permissions aren't set properly).
2014-07-10Convert Xcode schemes to shared schemes, so that they are tracked in git.Matt Holgate
It is recommended that you delete any personal schemes that have the same name as the shared ones, for example by cleaning your git tree with: cd platform/ios/MuPDF.xcodeproj && git clean -X -f -d (this will wipe out any .gitignore'd files in your tree - so be careful. Make sure you use an uppercase -X option; the lowercase version will wipe non-ignored files!).
2014-07-10Crashlytics support for official builds.Matt Holgate
Add hooks to allow us to pass in the Crashlytics SDK location and the API key from the command line. The SDK and API key will be held in a separate private repository. Should have no effect on regular builds.
2014-07-10Enable modules in iOS build.Matt Holgate
Speeds up compilation, and means we can avoid having to list all the system frameworks (so I've deleted them).
2014-07-08Fix #693228 - Android has counter intuitive finger dragging behaviourMatt Holgate
Patch from Michaël Cadilhac. Continue to pass events to panning GestureDetector when zooming (but do not act on the reported gesture). Previously we just stopped sending events to the GestureDetector until the start of the next gesture.
2014-07-07Fix disabled state of bar buttons on iPhone/iPod Touch.Matt Holgate
Previously on iOS 7, bar buttons didn't change visually when disabled. Also improves the look and feel - the buttons are now tinted in the highlighted state rather than showing a grey background. On iOS 7, the iPhone/iPad buttons style match. Tested on iOS 6 iPad/iPod and iOS 7 iPad/iPod.
2014-07-07Use tabs rather than spaces for the MuPDF project.Matt Holgate
2014-07-03Disable document interaction features when reflow enabled.Matt Holgate
The features do not work in reflow mode - Android already disables them.
2014-07-03Fix memory leak in MuDocRef.m.Matt Holgate
Remember to release self, if we're returning nil from the initialiser. Also, there is no need for fz_var(doc), because doc is an ivar and effectively equivalent to 'self->doc'.
2014-07-03Don't crash if a document fails to open on iOS.Matt Holgate
Handle exceptions from fz_open_document().
2014-07-03Android: Prevent editing of files opened from a memory buffer.Matt Holgate
Memory buffers are used for implementing content:// URLs, which are (in most cases) readonly. If we ever encounter a read/write content:// URL in the future, we could consider supporting saving to it. (An example of a content:// URI is an email attachment, where IPC is used to transfer the file from the email client, rather than relying on a local file).
2014-07-03Fix incorrect syntax for class names in JNI.Matt Holgate
Causes a crash on Android L/ART.
2014-07-02Handle the application/xps mimetype.Matt Holgate
I think this is non-standard, but some applications seem to use it. The email app on Android uses it, despite the fact the original email actually embedded it as application/octet-stream. I guess the email app is looking at the filename.
2014-07-02Pass mimetype when opening a document from a stream.Matt Holgate
Fixes opening non-PDF files from email programs that use a ContentProvider to supply attachments.
2014-07-02Fix opening files from Email app.Matt Holgate
On 2.3.x, opening files from the Android email app (not Gmail), was causing a crash due to a SecurityException. On 4.x, it was failing with an error message. I think we should have just been calling getContentResolver().openInputStream(uri) to get the file data, rather than reading the row from the content resolver and looking at the _data field. On 2.3.x querying this row caused a security error. On 4.x, we got back a _data field containing a path, but this path was internal to the email app, and not for our consumption. Previously we were calling openInputStream() only as a fallback; now we try it first, and fall back to the other method if that fails. I suspect we can delete the other code, but I can't test on the 3.x version of the Transformer Prime, so I'm leaving it be for now.
2014-07-01Fix bug #695346 - iOS app does not register to open CBZ files.Matt Holgate
Use the UTI 'public.cbz-archive' instead of the more generic 'public.zip-archive'. It's likely another app (or the OS) has an Exported UTI for 'public.zip-archive' which would take precedence over our Imported UTI and not have a 'cbz' extension. It's not entirely clear what the correct UTI to use for CBZs is (there are a few), but public.cbz-archive seems to be most likely candidate. Remove the 'zip' extension, as we probably don't want to load arbitrary zip files. Add mimetypes for all completeness, and separate OXPS from XPS as it has a different mimetype.
2014-07-01Bug #694104 - Allow using MuPDFReaderView from GUI layout tool.Matt Holgate
The GUI layout tool instantiates custom controls classes to display a preview in the IDE. It relies on the 2-argument constructor being implemented. Use a different means to get the window manager that works for non-activity contexts, and avoid creating gesture recognizers in this situation. Based on a patch supplied by Masaki Muranaka
2014-06-30Switch to Artifex Team.Matt Holgate
2014-06-27iOS - Fix #695217 - don't allow annotation of encrypted PDFsMatt Holgate
2014-06-27Fix #695217 - don't allow annotation of encrypted PDFsMatt Holgate
2014-06-26Fix some compiler warnings on Android.Matt Holgate
Use intptr_t when casting between a jlong and a pointer to suppress errors about different size words. Add a 'u' suffix to unsigned values output by the cmap dump utility.
2014-06-26Add missing fz_var() and fix potential memory leak.Matt Holgate
2014-06-26Fix deleting wrong file or crashing app if first file deleted.Matt Holgate
Correct an off-by-one error in the file deletion code.
2014-06-26Add missing 'period' to files launched via 'Open In' before file extension.Matt Holgate
Fixes bug #694711. As far as I could see, opening an XPS worked fine, the first time. However, if the same file was opened a second time, then it should have been saved with a number, e.g. foo(1).xps. However, the period was ommitted, so the file wasn't recognised as an XPS. This presumably wasn't an issue for PDF files, as PDF format is assumed by default (I am guessing).
2014-06-26Fix various Xcode analyzer warnings.Matt Holgate
Most were pretty harmless, and were addressed by renaming functions to match the Core Foundation naming conventions, but there was one actual memory leak, and some potential uses of uninitialised data.
2014-06-25Fix for pages being repeated when running on Android Honeycomb.Matt Holgate
Fixes bug #695191 - Mupdf Build49/armv7a & Android 3.1: cycles through subset of pages & page scrubber The problem here was that in Honeycomb, various bitmap operations (including drawing via JNI) do not update the bitmap generation count. When hardware acceleration is enabled, this means that the underlying GL layer is not aware that the bitmap has changed, and ends up reusing old textures. To workaround this, we erase the bitmap before drawing the page. Erase appears to be the only operation I could find (after pouring through the source), which actually increments the generation count. The other option would have been to disable hardware acceleration, but that was far less ideal.
2014-06-23Prevent the creation/destruction of the fz_cookies from trampling the ↵Matt Holgate
env/clazz pointers in globals. The env/clazz pointers are stashed in the globals structure so that they can be accessed by callback functions in mupdf.c (such as bufferStreamSeek()). The intention is that only one thread (i.e. the AsyncTask background thread) reads/writes these stashed pointers. Because cookies are created/destroyed in the main thread, we add a new version of get_globals() which doesn't trample these pointers.
2014-06-23Fix for bug #695229 - open document from byte array doesn't work, but saving ↵Matt Holgate
to file and open from file works Patch was supplied by gong_su@hotmail.com. Thanks!
2014-06-23Fix crash when dismissing 'Cannot open document' dialog with back button, ↵Matt Holgate
then pressing back button again. I've also added an onCancel() handler, so that the back button only needs to be pressed once to return to the file picker view. Spotted while looking at bug #693719 - Attached PDF file does not display (edit)
2014-06-20Improvement which should hopefully help with bug #693607 - MupdfActivity ↵Matt Holgate
crash when rotating the device. When cancelling a render async task, we now wait for it to actually finish before continuing. The benefit of this is that we should be able to guarantee that its Bitmap becomes eligible for GC before we continue to create any new bitmaps. This should hopefully help with the OOM errors seen when rotating the device and trying to create the new bitmaps. To prevent the UI thread from being blocked for too long while we're waiting for the async task to finish, we use a fz_cookie and set the 'abort' flag to request the render be stopped as soon as possible.
2014-06-18Add annotation to fix building from Eclipse.Matt Holgate
2014-06-18Fix bug #695132: MuPDF Library throwing sporadic exception on AndroidMatt Holgate
Android sometimes calls the 'getSelectedView()' method of an AdapterView. This can be made to happen more predicatably by enabling the Talkback accessibility feature. Remove the UnsupportedOperationException and just return null, as we the ReaderView does not have the concept of a selected page.
2014-06-18Fix for bug #694405 - iOS Pdf CrashMatt Holgate
If an iOS app uses too much memory, the OS asks it to free up some space. If it doesn't do so in a timely manner, it will get a second warning before being killed by the OS. In other platforms, where malloc() return NULL in OOM, the store scavenger releases memory when mallocs fail. In iOS, mallocs usually never return NULL because the app is killed before this can happen. Therefore, we need to initiate a scavenge from the low memory notification instead. We evict the store to 50% of its current size when a memory warning occurs when it is in the foreground, and 0% when a memory warning occurs whilst it is in the background. Having said this, I didn't manage to get a background warning to occur, presumably because we don't request background execution Therefore, I think in practice the OS just kills the process. However, this will be useful if we ever add background execution.
2014-06-17Fix for bug #694967 - MuPDF crashes after pressing the Back Button while it ↵Matt Holgate
renders a specific PDF Some async tasks were still trying to access the globals pointer, which had been nulled during shutdown, leading to a crash. Check for NULL and return cleanly in this case. Possibly we should also be calling AsyncTask.get() to wait for the tasks to finish, before nulling the global pointer?
2014-06-16Fix memento builds on android.Matt Holgate
2014-06-10Bump version number to 1.5.Tor Andersson
2014-05-29Fix 694093: add vertical variant of CJK fallback font.Tor Andersson
Replace the DroidSansFallback TTF files with a TTC that has two fonts: The original and a copy where the OpenType 'vert' substitution lookup has been pre-applied by copying the uniXXXX.vert glyph data to uniXXXX.
2014-05-28Save a bookmark before jumping when using the 'g' command.Tor Andersson
2014-05-27Fix 693494: Support media buttons for navigation on X11.Tor Andersson
2014-05-27Fix 694518: Implement continuous scrolling with keyboard.Sebastian Neuser
2014-05-27Set a faster default transition.Tor Andersson
2014-05-27Fix 694579: Implement "zoom to fit page".Sebastian Neuser
Add a new function pdfapp_autozoom to fit the page to the window by comparing the aspect ratios of the page and the window to choose whether to fit horizontally or vertically.
2014-05-22Fix windows VS builds.Robin Watts
Fix broken solution file and add project entries for new files.
2014-05-19Add an application agnostic memory handler for libjpegChris Liddell
This adds a custom memory management layer between libjpeg and the calling app - in such a way that the code can be shared between mupdf and Ghostscript/PDL.