diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-11-01 17:36:02 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-11-01 23:46:58 +0100 |
commit | c98867a5600a83ae2ecef99dd77071b324c30c57 (patch) | |
tree | 1c28251d948db737c7bb165660d035317e15d640 /ios | |
parent | 6ebc8af2d3764575ac49af5755770fe31f9a5b3e (diff) | |
download | mupdf-c98867a5600a83ae2ecef99dd77071b324c30c57.tar.xz |
Rename About.pdf and add high-res icon.
Diffstat (limited to 'ios')
-rw-r--r-- | ios/About.pdf (renamed from ios/howto.pdf) | bin | 131735 -> 131735 bytes | |||
-rw-r--r-- | ios/Icon@2x.png | bin | 0 -> 16336 bytes | |||
-rw-r--r-- | ios/MuPDF.xcodeproj/project.pbxproj | 26 | ||||
-rw-r--r-- | ios/main.m | 38 | ||||
-rw-r--r-- | ios/mupdf_icon.png | bin | 2756 -> 0 bytes |
5 files changed, 35 insertions, 29 deletions
diff --git a/ios/howto.pdf b/ios/About.pdf Binary files differindex 763c467e..763c467e 100644 --- a/ios/howto.pdf +++ b/ios/About.pdf diff --git a/ios/Icon@2x.png b/ios/Icon@2x.png Binary files differnew file mode 100644 index 00000000..c62a076d --- /dev/null +++ b/ios/Icon@2x.png diff --git a/ios/MuPDF.xcodeproj/project.pbxproj b/ios/MuPDF.xcodeproj/project.pbxproj index f9e93bf5..7655aff2 100644 --- a/ios/MuPDF.xcodeproj/project.pbxproj +++ b/ios/MuPDF.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 96476B4614599D9400EA67C0 /* loading.png in Resources */ = {isa = PBXBuildFile; fileRef = 96476B4514599D9400EA67C0 /* loading.png */; }; - 9683F619145F4F84000E1607 /* howto.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 9683F618145F4F84000E1607 /* howto.pdf */; }; + 9683F619145F4F84000E1607 /* About.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 9683F618145F4F84000E1607 /* About.pdf */; }; 968F2E9C14539C880085264E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F2E9B14539C880085264E /* UIKit.framework */; }; 968F2E9E14539C880085264E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F2E9D14539C880085264E /* Foundation.framework */; }; 968F2EA014539C880085264E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F2E9F14539C880085264E /* CoreGraphics.framework */; }; @@ -23,11 +23,12 @@ 968F2EC214539F350085264E /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F2EBA14539F350085264E /* libz.a */; }; 96BD2B38145AC485001CEBC3 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 96BD2B35145AC485001CEBC3 /* Icon-72.png */; }; 96BD2B39145AC485001CEBC3 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 96BD2B36145AC485001CEBC3 /* Icon.png */; }; + 96F2341514603FBA004A8A22 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 96F2341414603FBA004A8A22 /* Icon@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 96476B4514599D9400EA67C0 /* loading.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loading.png; sourceTree = "<group>"; }; - 9683F618145F4F84000E1607 /* howto.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = howto.pdf; sourceTree = "<group>"; }; + 9683F618145F4F84000E1607 /* About.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = About.pdf; sourceTree = "<group>"; }; 968F2E8E14539BEB0085264E /* build_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_libs.sh; sourceTree = "<group>"; }; 968F2E8F14539BEB0085264E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 968F2E9014539BEB0085264E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; @@ -45,6 +46,7 @@ 968F2EBA14539F350085264E /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libz.a; path = "../Debug-iphoneos/libz.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 96BD2B35145AC485001CEBC3 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; }; 96BD2B36145AC485001CEBC3 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; }; + 96F2341414603FBA004A8A22 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,11 +74,12 @@ 968F2E9214539BF10085264E /* Sources */ = { isa = PBXGroup; children = ( + 9683F618145F4F84000E1607 /* About.pdf */, 96BD2B36145AC485001CEBC3 /* Icon.png */, + 96F2341414603FBA004A8A22 /* Icon@2x.png */, 96BD2B35145AC485001CEBC3 /* Icon-72.png */, 968F2E8F14539BEB0085264E /* Info.plist */, 968F2E8E14539BEB0085264E /* build_libs.sh */, - 9683F618145F4F84000E1607 /* howto.pdf */, 96476B4514599D9400EA67C0 /* loading.png */, 968F2E9014539BEB0085264E /* main.m */, ); @@ -180,7 +183,8 @@ 96476B4614599D9400EA67C0 /* loading.png in Resources */, 96BD2B38145AC485001CEBC3 /* Icon-72.png in Resources */, 96BD2B39145AC485001CEBC3 /* Icon.png in Resources */, - 9683F619145F4F84000E1607 /* howto.pdf in Resources */, + 9683F619145F4F84000E1607 /* About.pdf in Resources */, + 96F2341514603FBA004A8A22 /* Icon@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -242,11 +246,8 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ..; INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../Library/Developer/Xcode/DerivedData/MuPDF-cvkrphzautzteofxxhlfmeyskiun/Build/Products/Debug-iphoneos\"", - ); + IPHONEOS_DEPLOYMENT_TARGET = 4.0; + LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -272,11 +273,8 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ..; INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../Library/Developer/Xcode/DerivedData/MuPDF-cvkrphzautzteofxxhlfmeyskiun/Build/Products/Debug-iphoneos\"", - ); + IPHONEOS_DEPLOYMENT_TARGET = 4.0; + LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -15,6 +15,7 @@ static dispatch_queue_t queue; static fz_glyph_cache *glyphcache = NULL; static UIImage *loadingImage = nil; static UIBarButtonItem *flexibleSpace = nil; +static NSString *docdir = nil; @interface MuLibraryController : UITableViewController { @@ -193,8 +194,6 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height { [self setTitle: @"MuPDF"]; - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *docdir = [paths objectAtIndex: 0]; NSError *error = nil; if (files) { @@ -204,7 +203,7 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: docdir error: &error]; if (error) - files = paths; + files = [NSArray arrayWithObjects: @"...error loading directory...", nil]; [files retain]; [[self tableView] reloadData]; @@ -237,13 +236,17 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: cellid]; if (!cell) cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: cellid] autorelease]; - NSString *value; int row = [indexPath row]; - if (row == 0) - value = @"How To Sync Files with iTunes"; - else - value = [files objectAtIndex: row - 1]; - [[cell textLabel] setText: value]; + if (row == 0) { + [[cell textLabel] setText: @"About MuPDF"]; + } else { + [[cell textLabel] setText: [files objectAtIndex: row - 1]]; + } + [[cell textLabel] setFont: [UIFont boldSystemFontOfSize: 20]]; +// [[cell textLabel] setBackgroundColor: [UIColor clearColor]]; +// [[cell contentView] setBackgroundColor: row & 1 ? +// [UIColor colorWithWhite: 1.0 alpha: 1] : +// [UIColor colorWithWhite: 0.9 alpha: 1]]; return cell; } @@ -252,7 +255,7 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height int row = [indexPath row]; NSString *filename; if (row == 0) - filename = @"../MuPDF.app/howto.pdf"; + filename = @"../MuPDF.app/About.pdf"; else filename = [files objectAtIndex: row - 1]; MuDocumentController *document = [[MuDocumentController alloc] initWithFile: filename]; @@ -348,8 +351,8 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height dispatch_sync(queue, ^{}); - strcpy(filename, [NSHomeDirectory() UTF8String]); - strcat(filename, "/Documents/"); + strcpy(filename, [docdir UTF8String]); + strcat(filename, "/"); strcat(filename, [nsfilename UTF8String]); printf("open xref '%s'\n", filename); @@ -458,9 +461,10 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height - (void) dealloc { - for (int i = 0; i < pdf_count_pages(xref); i++) - if (pageviews[i]) - [pageviews[i] release]; + if (xref) + for (int i = 0; i < pdf_count_pages(xref); i++) + if (pageviews[i]) + [pageviews[i] release]; pdf_xref *self_xref = xref; // don't use self after dealloc has finished dispatch_async(queue, ^{ @@ -728,6 +732,9 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height glyphcache = fz_new_glyph_cache(); + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + docdir = [[paths objectAtIndex: 0] retain]; + loadingImage = [[UIImage imageNamed: @"loading.png"] retain]; flexibleSpace = [[UIBarButtonItem alloc] @@ -735,6 +742,7 @@ static UIImage *renderPage(pdf_xref *xref, int number, float width, float height target: nil action: nil]; library = [[MuLibraryController alloc] initWithStyle: UITableViewStylePlain]; +// [[library tableView] setSeparatorStyle: UITableViewCellSeparatorStyleNone]; navigator = [[UINavigationController alloc] initWithRootViewController: library]; [[navigator navigationBar] setTranslucent: YES]; diff --git a/ios/mupdf_icon.png b/ios/mupdf_icon.png Binary files differdeleted file mode 100644 index b5e314de..00000000 --- a/ios/mupdf_icon.png +++ /dev/null |