summaryrefslogtreecommitdiff
path: root/platform/android
AgeCommit message (Collapse)Author
2016-07-08android: Fix mixed tabs/spaces in DocViewActivity.java.Tor Andersson
2016-07-06Android example: modify to use new JNI, N-up page displayfredrossperry
- uses AndroidDrawDevice for rendering - very simple sample app - mupdf-specific functionality in a module called "mupdf" - N-up page display - page rendering in a background task Signed-off-by: fredrossperry <fredrossperry@gmail.com>
2016-07-06Android viewer - replace missing build.gradle filefredrossperry
also, change SUPPORT_GPROOF to FZ_ENABLE_GPRF
2016-07-06Android viewer: add mupdf_native.c to buildfredrossperry
This is because platform/android/example also uses the resulting shared library.
2016-06-23modified mupdf.c and mupdf_native.c to adapt to APIs that have recently changed.fredrossperry
2016-06-13Fix Android viewer build with js.Robin Watts
The recent js change requires a makefile tweak.
2016-06-13Bug 696822: Refuse to save a pdf file incrementally if it would break.Robin Watts
If a file cannot be saved incrementally, then don't accept that as an option. In practise this means if someone asks to save a file incrementally, and it was repaired, or it uses encryption then throw an error. Add a new function to ask if it's safe to save a file incrementally, and use that in the appropriate places.
2016-06-08Bug 696826: Android Viewer: Cope with null itemRobin Watts
It seems that we can end up with a null item in MuPDFReaderView onSingleTap. Add some simple checks to avoid this.
2016-06-06Android Viewer: Fix jni code w.r.t pixmap alpha API changes.Robin Watts
Need to specify that we are using alphas now.
2016-04-26svg: Add SVG parser.Tor Andersson
svg: Implement graphics state stack. svg: Use idmap for symbol and use elements. svg: Put viewport and viewBox in state stack. svg: Rebase to version 1.9 master.
2016-04-22thirdparty: Update to openjpeg 2.1.0.Sebastian Rasmussen
2016-04-21Bump patch-level.Tor Andersson
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.