diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2014-03-26 15:39:36 +0000 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2014-03-26 16:13:32 +0000 |
commit | b43650e084def54cd839a2bde694ac2942d8ae4c (patch) | |
tree | 91356357e3f0c72af41b5eace2881045012b2d36 | |
parent | c76881ff7eb9845d7fb0c7506ea34703930e5cb2 (diff) | |
download | mupdf-b43650e084def54cd839a2bde694ac2942d8ae4c.tar.xz |
iOS: fix build and update to use mujs
-rw-r--r-- | platform/ios/Classes/MuDocRef.m | 8 | ||||
-rw-r--r-- | platform/ios/MuPDF.xcodeproj/project.pbxproj | 12 | ||||
-rw-r--r-- | platform/ios/build_libs.sh | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/platform/ios/Classes/MuDocRef.m b/platform/ios/Classes/MuDocRef.m index 4909fb32..4c054ab2 100644 --- a/platform/ios/Classes/MuDocRef.m +++ b/platform/ios/Classes/MuDocRef.m @@ -1,4 +1,5 @@ #include "common.h" +#include "mupdf/pdf.h" #import "MuDocRef.h" @implementation MuDocRef @@ -11,7 +12,14 @@ dispatch_sync(queue, ^{}); doc = fz_open_document(ctx, aFilename); if (!doc) + { self = nil; + } + else + { + pdf_document *idoc = pdf_specifics(doc); + if (idoc) pdf_enable_js(idoc); + } } return self; } diff --git a/platform/ios/MuPDF.xcodeproj/project.pbxproj b/platform/ios/MuPDF.xcodeproj/project.pbxproj index bb5f7a46..82aa03af 100644 --- a/platform/ios/MuPDF.xcodeproj/project.pbxproj +++ b/platform/ios/MuPDF.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ 96C8ED181779A9AE00A30AF4 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED111779A9AE00A30AF4 /* libfreetype.a */; }; 96C8ED191779A9AE00A30AF4 /* libjbig2dec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */; }; 96C8ED1A1779A9AF00A30AF4 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED131779A9AE00A30AF4 /* libjpeg.a */; }; - 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-jscore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */; }; + 96C8ED1B1779A9AF00A30AF4 /* libmujs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED141779A9AE00A30AF4 /* libmujs.a */; }; 96C8ED1C1779A9AF00A30AF4 /* libmupdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED151779A9AE00A30AF4 /* libmupdf.a */; }; 96C8ED1D1779A9AF00A30AF4 /* libopenjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED161779A9AE00A30AF4 /* libopenjpeg.a */; }; 96C8ED1E1779A9AF00A30AF4 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED171779A9AE00A30AF4 /* libz.a */; }; @@ -35,7 +35,6 @@ DA1C68B317E86A500061F586 /* MuDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68A717E864180061F586 /* MuDocumentController.m */; }; DA1C68B517E86A500061F586 /* MuAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68A917E864CB0061F586 /* MuAppDelegate.m */; }; DA1C68C417E8969C0061F586 /* common.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68C317E8969C0061F586 /* common.m */; }; - DA300CA41847A64C004F92BB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA300CA31847A64C004F92BB /* JavaScriptCore.framework */; }; DA442E2D183B796F008EF49B /* ic_pen.png in Resources */ = {isa = PBXBuildFile; fileRef = DA442E2C183B796F008EF49B /* ic_pen.png */; }; DA442E30183B9F13008EF49B /* MuInkView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA442E2F183B9F13008EF49B /* MuInkView.m */; }; DA4C0622187B1EA200755D0D /* MuTextFieldController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4C0620187B1EA200755D0D /* MuTextFieldController.m */; }; @@ -88,7 +87,7 @@ 96C8ED111779A9AE00A30AF4 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfreetype.a; sourceTree = BUILT_PRODUCTS_DIR; }; 96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjbig2dec.a; sourceTree = BUILT_PRODUCTS_DIR; }; 96C8ED131779A9AE00A30AF4 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjpeg.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmupdf-js-jscore.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 96C8ED141779A9AE00A30AF4 /* libmujs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmujs.a; sourceTree = BUILT_PRODUCTS_DIR; }; 96C8ED151779A9AE00A30AF4 /* libmupdf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmupdf.a; sourceTree = BUILT_PRODUCTS_DIR; }; 96C8ED161779A9AE00A30AF4 /* libopenjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopenjpeg.a; sourceTree = BUILT_PRODUCTS_DIR; }; 96C8ED171779A9AE00A30AF4 /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libz.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -163,11 +162,10 @@ buildActionMask = 2147483647; files = ( 968E1E411779A54F0050CEA3 /* UIKit.framework in Frameworks */, - DA300CA41847A64C004F92BB /* JavaScriptCore.framework in Frameworks */, 968E1E431779A54F0050CEA3 /* Foundation.framework in Frameworks */, 968E1E451779A54F0050CEA3 /* CoreGraphics.framework in Frameworks */, 96C8ED1C1779A9AF00A30AF4 /* libmupdf.a in Frameworks */, - 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-jscore.a in Frameworks */, + 96C8ED1B1779A9AF00A30AF4 /* libmujs.a in Frameworks */, 96C8ED181779A9AE00A30AF4 /* libfreetype.a in Frameworks */, 96C8ED191779A9AE00A30AF4 /* libjbig2dec.a in Frameworks */, 96C8ED1A1779A9AF00A30AF4 /* libjpeg.a in Frameworks */, @@ -197,7 +195,7 @@ children = ( 968E1E3D1779A54F0050CEA3 /* MuPDF.app */, 96C8ED151779A9AE00A30AF4 /* libmupdf.a */, - 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */, + 96C8ED141779A9AE00A30AF4 /* libmujs.a */, 96C8ED111779A9AE00A30AF4 /* libfreetype.a */, 96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */, 96C8ED131779A9AE00A30AF4 /* libjpeg.a */, @@ -414,7 +412,7 @@ ); outputPaths = ( "$(DERIVED_FILE_DIR)/libmupdf.a", - "$(DERIVED_FILE_DIR)/libmupdf-js-jscore.a", + "$(DERIVED_FILE_DIR)/libmujs.a", "$(DERIVED_FILE_DIR)/libfreetype.a", "$(DERIVED_FILE_DIR)/libjbig2dec.a", "$(DERIVED_FILE_DIR)/libjpeg.a", diff --git a/platform/ios/build_libs.sh b/platform/ios/build_libs.sh index cc262ef7..966a0b7e 100644 --- a/platform/ios/build_libs.sh +++ b/platform/ios/build_libs.sh @@ -23,7 +23,7 @@ done OUT=build/$build-$OS-$(echo $ARCHS | tr ' ' '-') echo Compiling libraries for $ARCHS. -make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" JSCORE_PRESENT="yes" third libs || exit 1 +make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" third libs || exit 1 echo Copying library to $BUILT_PRODUCTS_DIR/. mkdir -p "$BUILT_PRODUCTS_DIR" |