summaryrefslogtreecommitdiff
path: root/platform/android
AgeCommit message (Collapse)Author
2016-04-06Update platform/android/viewer/ReadMe.txtRobin Watts
Update description to cover the fact that we no longer need cygwin, and to strongly suggest using the Android Studio supplied SDK/NDKs.
2016-04-06Bump version number.Tor Andersson
2016-03-31Initialize disabled document writing flags to zeroSebastian Rasmussen
Also remove redundant assignments. Fixes http://bugs.ghostscript.com/show_bug.cgi?id=695968
2016-03-31android: Add new example viewer.Tor Andersson
Thanks to Fred Ross-Perry.
2016-03-31Reorganize java and android source.Tor Andersson
platform/java and platform/android are reorganized: platform/java The new JNI Java classes, mupdf_native.{c,h}, Makefile and Makejar. platform/java/example The example desktop viewer classes. platform/android/viewer The original demo viewer. ndk-build is used to build libmupdf_java.so, making reference to mupdf_native.{c,h} in platform/java.
2016-03-23Exclude AndroidDrawDevice from the Android app build.fredrossperry
2016-03-11Bug 696634: Android: Allow filenames including hash.Robin Watts
We were converting from a File to a filename then to a Uri using Uri.parse, but Uri.parse has problems with hash marks. Instead convert direct from File to Uri.
2016-02-29jni: Various cleanups.Tor Andersson
jni: Various cleanups. Fix gcc and clang warnings. Android specific functions are guarded by HAVE_ANDROID define. The java guts of the android stuff is removed for now, to be added back in later. Set up a makefile and simple tests to build for desktop java. Rerig device classes to: Device, NativeDevice, JavaDevice and DrawDevice. Add Pixmap class. Regularize naming. General cleanups and abbreviate naming. Use to_JavaClass and from_JavaClass rather than fz_mupdf_struct_from_JavaClass and JavaClass_from_fz_mupdf_struct. Check for exceptions thrown by java devices and path processor. Tweak constructors and finalizers to remove the JavaDevice subclass. Use toString when rethrowing java exceptions as fitz exceptions.
2016-02-29jni: Update build files for moved java sources.Tor Andersson
2016-02-29jni: Move java bindings to platform/java.Tor Andersson
Move the platform independent java code from platform/android to platform/java. The plan is that we can call 'make mupdf.jar' (or 'nmake mupdf.jar') there, and then use the resultant mupdf.jar/mupdf_native.h files in whatever platform specific project (such as the android bindings) we like. Keep the android specific class (AndroidDrawDevice) in the usual place in platform/android. Update the android ant script to include mupdf.jar.
2016-02-29jni: First attempt at generic JNI bindings.Robin Watts
The purpose of JNI bindings is to allow MuPDF to be driven from Java. There are several possible use cases here. Firstly, and most simply a java application can ask the core of MuPDF to open a document and render it using the existing devices to produce output on a standard Java bitmap. Secondly, a java application might want to drive the device interface itself, making use of the standard MuPDF devices (such as using the rendering engine to render high quality graphics). Thirdly, a java application might want to implement its own device and then call MuPDF to run the document to that device (perhaps to do custom text or image extraction). The first of these cases requires a simple reflection of the main document and standard device classes in JNI. The second of these cases requires the actual device interface itself to be made available as a java interface, together with the ability to construct and manipulate data types like paths, text and fonts so the Java code can build the required objects to pass to implementers of the device interface. The final case requires a reflection layer whereby calls through the device interface in C can be turned into method calls to a Java interface. All of this is attempted in this commit. Some highlights: For each type in the C (such as fz_colorspace) we have a corresponding java class (such as ColorSpace). Where the 'fz_' types are reference counted (such as an fz_colorspace), the java objects (such as ColorSpace) simply take a reference to a pointer to the underlying fz type. Java accessor methods are then provided to manipulate these types. Where the 'fz_' types are not reference counted (such as an fz_rect), the data is actually contained within the Java object itself (such as Rect, RectI and Transform). We add a VS jni project. This doesn't do anything except make the files accessible for editing in the IDE. As much as possible, the Java layers do nothing (other than some programmer friendly type overloading), construction (unavoidable, as can't be done in JNI) and boiler-plate destruction. All the smartness is done in the C. Due to Java and C's differing approach to constness, we need to be careful that a java device does not destructively alter objects passed to it. For example, consider running a display list through a device implemented in java. If the java device were to change a Font object passed to it, this might affect other objects in the display list that shared the same underlying fz_font. Possibly we can achieve this by having an 'isConst' flag on java objects that are created from device calls and passed to the Java device (see the Text class, for an attempt at this currently). This could alternatively be achieved by cloning every such piece of data (see the path code for an example of this approach), but this is probably slow. Better to clone 'just in time' as the first write operation is done to the object.
2016-01-29Update Android build with HarfbuzzRobin Watts
2016-01-18Enable warnings in Android ndk-build.Robin Watts
2016-01-05Remove fz_page argument from fz_annot function calls.Tor Andersson
2015-12-28Drop 'jsimp' abstraction and use mujs directly.Tor Andersson
2015-12-18Remove fz_save_document and use pdf_save_document directly instead.Tor Andersson
In preparation of adding pdf_write_document that writes a document to a fz_output stream.
2015-12-15Rename fz_write_x to fz_save_pixmap_as_x or fz_save_bitmap_as_x.Tor Andersson
Separate naming of functions that save complete files to disk from functions that write data to streams.
2015-12-14Android: Try and minimise warnings in JNI code.Robin Watts
Push the pointer->long and long->pointer casting through 2 static inline functions.
2015-12-11Rename structured text structs and functions to 'stext'.Tor Andersson
Less risk of confusion with the text type used in the device interface.
2015-10-21Bump version number.Tor Andersson
2015-10-15android: Update ThirdParty.mk to work with new freetype version.Tor Andersson
2015-10-14Add proper support for when a combobox widget has options that are 2-element ↵Michael Vrhel
arrays The list box and combo box can have values that are 2-element arrays. The first element is the "export" value and the second element is the value that should be shown in the list box UI. This fix ensures that we get the proper value to show in the UI. Also, it adds the option to get the export values. These are needed if you wish to update the field dictionary's V (value) entry, which is the currently selected values(s). This fix works well with gsview. The other viewers will now display the proper content in their UI, (unlike before this fix) but may need a bit more work to ensure that the proper V (value) is updated with changes in the selections. In addition, we add selection rectangles to the selected list box items.
2015-09-29Android JNI code: Whitespace fixesRobin Watts
2015-09-29Support for proofingfredrossperry
- use core.fileFormat to decide whether a proof file is being viewed, - don't show the proofing button except for PDF files. - in a proofing activity, show the page that was being viewed when the proof was requested. - Add extra two arguments to fz_write_gproof_file in the Android build.
2015-09-29Android: Changes to improve handling out-of-memory errors.fredrossperry
Probably related to bug 695507.
2015-09-29Added build.gradle file for use with Android Studiofredrossperry
2015-08-21GProof: Return Android style RGB color values from the JNI.Robin Watts
Android wants colors to be BGRA, not RGBA, so accomodate this.
2015-08-21GProof: Fix Android JNI functions for multipage files.Robin Watts
Explicitly pass the page number into separation related functions.
2015-08-17Add JNI interface to MuPDFCore to read/write separations on a page.Robin Watts
Get separation information out to the Java level.
2015-07-20Improved Android debugging support.Robin Watts
If we build with DEBUG set, the native section will be built with debugging enabled. The debuggable flag in AndroidManifest still needs to be edited manually, but it's set explicitly false here so we can grep for it. Also, send stdout/stderr to text files in DEBUG builds. The path for this may not work on all phones (it certainly works on the LG G3, running Lollipop), but it won't hurt on anything.
2015-07-20Tweak Android MuPDF build to respect SUPPORT_GPROOF.Robin Watts
MuPDFCore now supports a gprfSupported method that returns true iff we compiled the core with SUPPORT_GPROOF and a libgs.so is available.
2015-07-20Add Proofing button to Android UI.Robin Watts
Hit the proofing button, and we create a new temporary .gproof file. We invoke a new version of MuPDF on that. When that finishes control returns to us, and we delete the .gproof file. Currently the new version of MuPDF loads the .gproof file, but fails to generate any pages from it, as we have no version of ghostscript on the system. Generating this new ghostscript is the next job.
2015-07-20First cut at gprf document handler.Robin Watts
Doesn't actually trigger generation from ghostscript, or load images from files generated by ghostscript yet.
2015-05-07Update version number to 1.7a for the bugfix release.Tor Andersson
2015-04-14android: Add EPUB support to file chooser. Fix crash on non-pdf documents.Tor Andersson
2015-04-14Split fz_meta into separate querying functions.Tor Andersson
Add fz_has_permission function to fz_document. Add fz_lookup_metadata function to fz_document. Remove fz_meta function from fz_document.
2015-04-07Fix whitespace.Tor Andersson
2015-04-07Tweak CHANGES and README for release 1.7.Robin Watts
Update FZ_VERSION to 1.7 Update Android app version.
2015-04-03Bug 693481: Android: Allow panning while zoomingRobin Watts
Adopt (slightly modified) version of Kenny Lam's patch to allow panning while zooming. This more closely matches how a web view behaves.
2015-04-03Bug 694388: Android: Don't call requestLayout more than we need to.Robin Watts
Thanks to Goncalo Ferreira for spotting this.
2015-03-26Android: Tweak MuPDFReaderView enum definition.Robin Watts
Given that MuPDFReaderView has a public setMode call, ensure that the enum with the Mode values in is public too. Thanks to Jeremy Dixon for pointing out the issue.
2015-03-26Bug 695811: Adopt Freds patch for Android crashes with strange filenames.Robin Watts
I can't claim to entirely understand why one formulation works and the other doesn't, but it seems a harmless enough fix that apparently works.
2015-03-25Update Android code to use new PDF_NAME formulation.Robin Watts
2015-02-25Fix Android builds.Robin Watts
Update android Core.mk file for html document handler, and fix a stray fz_free_page that didn't get updated.
2015-02-17Add ctx parameter and remove embedded contexts for API regularity.Tor Andersson
Purge several embedded contexts: Remove embedded context in fz_output. Remove embedded context in fz_stream. Remove embedded context in fz_device. Remove fz_rebind_stream (since it is no longer necessary). Remove embedded context in svg_device. Remove embedded context in XML parser. Add ctx argument to fz_document functions. Remove embedded context in fz_document. Remove embedded context in pdf_document. Remove embedded context in pdf_obj. Make fz_page independent of fz_document in the interface. We shouldn't need to pass the document to all functions handling a page. If a page is tied to the source document, it's redundant; otherwise it's just pointless. Fix reference counting oddity in fz_new_image_from_pixmap.
2015-02-17Rename fz_close_* and fz_free_* to fz_drop_*.Tor Andersson
Rename fz_close to fz_drop_stream. Rename fz_close_archive to fz_drop_archive. Rename fz_close_output to fz_drop_output. Rename fz_free_* to fz_drop_*. Rename pdf_free_* to pdf_drop_*. Rename xps_free_* to xps_drop_*.
2015-02-17Reference count fz_document.Tor Andersson
2015-01-22Fix android scrolling bug.Robin Watts
Spotted by "Pogon". The code to choose between horizontal and vertical scrolling was broken due to a missing ! in a condition. Cut and Paste error.
2014-11-26Change incorrect loglevel of some messages from error to infomax
2014-09-30Bump version number.Tor Andersson