diff --git a/DemoProject-iPad/DemoProject.xcodeproj/project.pbxproj b/DemoProject-iPad/DemoProject.xcodeproj/project.pbxproj index 9af8ca7..0006b60 100755 --- a/DemoProject-iPad/DemoProject.xcodeproj/project.pbxproj +++ b/DemoProject-iPad/DemoProject.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 3A0BB4C211A9EA7400C6C3D4 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A90DB2D0DB0083E9F9 /* MainViewController.m */; }; 3A0BB4C311A9EA7400C6C3D4 /* FlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */; }; 3A0BB4C411A9EA7400C6C3D4 /* DemoTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A112DA1113A8E8E004D04A4 /* DemoTransition.m */; }; - 3A0BB4C511A9EA7400C6C3D4 /* EPGLTransitionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A112DA3113A8E8E004D04A4 /* EPGLTransitionView.m */; }; 3A0BB4C611A9EA7400C6C3D4 /* Demo2Transition.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7D0F6F117A423D00CFAD01 /* Demo2Transition.m */; }; 3A0BB4C811A9EA7400C6C3D4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 3A0BB4C911A9EA7400C6C3D4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -26,6 +25,7 @@ 3A0BB4D611A9EA7500C6C3D4 /* FlipsideView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A0BB4D311A9EA7500C6C3D4 /* FlipsideView.xib */; }; 3A0BB4D711A9EA7500C6C3D4 /* MainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A0BB4D411A9EA7500C6C3D4 /* MainView.xib */; }; 3A0BB4D811A9EA7500C6C3D4 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A0BB4D511A9EA7500C6C3D4 /* MainWindow.xib */; }; + 3A20F7BE12F87AD70015365E /* EPGLTransitionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A20F7BD12F87AD70015365E /* EPGLTransitionView.m */; }; 3A4826D211D93FE10059B460 /* Demo3Transition.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A4826D111D93FE10059B460 /* Demo3Transition.m */; }; /* End PBXBuildFile section */ @@ -52,11 +52,11 @@ 3A112DA0113A8E8E004D04A4 /* DemoTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DemoTransition.h; path = ../src/DemoTransition.h; sourceTree = SOURCE_ROOT; }; 3A112DA1113A8E8E004D04A4 /* DemoTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DemoTransition.m; path = ../src/DemoTransition.m; sourceTree = SOURCE_ROOT; }; 3A112DA2113A8E8E004D04A4 /* EPGLTransitionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EPGLTransitionView.h; path = ../src/EPGLTransitionView.h; sourceTree = SOURCE_ROOT; }; - 3A112DA3113A8E8E004D04A4 /* EPGLTransitionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EPGLTransitionView.m; path = ../src/EPGLTransitionView.m; sourceTree = SOURCE_ROOT; }; 3A112DA8113A8EB2004D04A4 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; 3A112DAD113A8ED3004D04A4 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 3A112DC1113A8F7B004D04A4 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 3A112DDF113A9345004D04A4 /* painting.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = painting.jpg; sourceTree = ""; }; + 3A20F7BD12F87AD70015365E /* EPGLTransitionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EPGLTransitionView.m; path = ../src/EPGLTransitionView.m; sourceTree = SOURCE_ROOT; }; 3A4826D011D93FE10059B460 /* Demo3Transition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Demo3Transition.h; path = ../src/Demo3Transition.h; sourceTree = SOURCE_ROOT; }; 3A4826D111D93FE10059B460 /* Demo3Transition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Demo3Transition.m; path = ../src/Demo3Transition.m; sourceTree = SOURCE_ROOT; }; 3A7D0F6E117A423D00CFAD01 /* Demo2Transition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Demo2Transition.h; path = ../src/Demo2Transition.h; sourceTree = SOURCE_ROOT; }; @@ -187,7 +187,7 @@ 3A4826D011D93FE10059B460 /* Demo3Transition.h */, 3A4826D111D93FE10059B460 /* Demo3Transition.m */, 3A112DA2113A8E8E004D04A4 /* EPGLTransitionView.h */, - 3A112DA3113A8E8E004D04A4 /* EPGLTransitionView.m */, + 3A20F7BD12F87AD70015365E /* EPGLTransitionView.m */, ); name = EPGLTransitionView; sourceTree = ""; @@ -264,9 +264,9 @@ 3A0BB4C211A9EA7400C6C3D4 /* MainViewController.m in Sources */, 3A0BB4C311A9EA7400C6C3D4 /* FlipsideViewController.m in Sources */, 3A0BB4C411A9EA7400C6C3D4 /* DemoTransition.m in Sources */, - 3A0BB4C511A9EA7400C6C3D4 /* EPGLTransitionView.m in Sources */, 3A0BB4C611A9EA7400C6C3D4 /* Demo2Transition.m in Sources */, 3A4826D211D93FE10059B460 /* Demo3Transition.m in Sources */, + 3A20F7BE12F87AD70015365E /* EPGLTransitionView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/FlipReader-iPad/Classes/FlipReaderAppDelegate.h b/FlipReader-iPad/Classes/FlipReaderAppDelegate.h new file mode 100644 index 0000000..a18324b --- /dev/null +++ b/FlipReader-iPad/Classes/FlipReaderAppDelegate.h @@ -0,0 +1,22 @@ +// +// FlipReaderAppDelegate.h +// FlipReader +// +// Created by Edward Patel on 2011-02-01. +// Copyright 2011 Memention AB. All rights reserved. +// + +#import + +@class FlipReaderViewController; + +@interface FlipReaderAppDelegate : NSObject { + UIWindow *window; + FlipReaderViewController *viewController; +} + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet FlipReaderViewController *viewController; + +@end + diff --git a/FlipReader-iPad/Classes/FlipReaderAppDelegate.m b/FlipReader-iPad/Classes/FlipReaderAppDelegate.m new file mode 100644 index 0000000..71c4006 --- /dev/null +++ b/FlipReader-iPad/Classes/FlipReaderAppDelegate.m @@ -0,0 +1,71 @@ +// +// FlipReaderAppDelegate.m +// FlipReader +// +// Created by Edward Patel on 2011-02-01. +// Copyright 2011 Memention AB. All rights reserved. +// + +#import "FlipReaderAppDelegate.h" +#import "FlipReaderViewController.h" + +@implementation FlipReaderAppDelegate + +@synthesize window; +@synthesize viewController; + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // Override point for customization after app launch. + [self.window addSubview:viewController.view]; + [self.window makeKeyAndVisible]; + + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ +} + + +- (void)dealloc { + [viewController release]; + [window release]; + [super dealloc]; +} + + +@end diff --git a/FlipReader-iPad/Classes/FlipReaderViewController.h b/FlipReader-iPad/Classes/FlipReaderViewController.h new file mode 100644 index 0000000..eb04511 --- /dev/null +++ b/FlipReader-iPad/Classes/FlipReaderViewController.h @@ -0,0 +1,19 @@ +// +// FlipReaderViewController.h +// FlipReader +// +// Created by Edward Patel on 2011-02-01. +// Copyright 2011 Memention AB. All rights reserved. +// + +#import + +#import "MyPDFView.h" + +@interface FlipReaderViewController : UIViewController { + MyPDFView *mpv; + int pageNumber; +} + +@end + diff --git a/FlipReader-iPad/Classes/FlipReaderViewController.m b/FlipReader-iPad/Classes/FlipReaderViewController.m new file mode 100644 index 0000000..1658637 --- /dev/null +++ b/FlipReader-iPad/Classes/FlipReaderViewController.m @@ -0,0 +1,127 @@ +// +// FlipReaderViewController.m +// FlipReader +// +// Created by Edward Patel on 2011-02-01. +// Copyright 2011 Memention AB. All rights reserved. +// + +#import "FlipReaderViewController.h" +#import "EPGLTransitionView.h" +#import "FlipTransitions.h" + +@implementation FlipReaderViewController + + +/* + // The designated initializer. Override to perform setup that is required before the view is loaded. + - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; + } + */ + +/* + // Implement loadView to create a view hierarchy programmatically, without using a nib. + - (void)loadView { + } + */ + + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; + + pageNumber = 0; + + CGRect rect = CGRectMake(0, 0, 1024, 768); + + mpv = [[MyPDFView alloc] initWithFrame:rect]; + [[self view] insertSubview:mpv atIndex:0]; + [mpv gotoPage:pageNumber]; + [mpv release]; + + UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRightAction:)]; + swipeRight.direction = UISwipeGestureRecognizerDirectionRight; + swipeRight.delegate = self; + [mpv addGestureRecognizer:swipeRight]; + + UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftAction:)]; + swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft; + swipeLeft.delegate = self; + [mpv addGestureRecognizer:swipeLeft]; +} + +- (void)swipeLeftAction:(id)sender { + if (pageNumber >= 312) + return; + + NSObject *transition = [[[FlipForward alloc] init] autorelease]; + + EPGLTransitionView *glview = [[[EPGLTransitionView alloc] + initWithView:self.view + delegate:transition] autorelease]; + + pageNumber += 2; + [mpv gotoPage:pageNumber]; + + [glview prepareTextureTo:self.view]; + + [glview setClearColorRed:0.0 + green:0.0 + blue:0.0 + alpha:1.0]; + + [glview startTransition]; +} + +- (void)swipeRightAction:(id)sender { + if (pageNumber <= 0) + return; + + NSObject *transition = [[[FlipBackward alloc] init] autorelease]; + + EPGLTransitionView *glview = [[[EPGLTransitionView alloc] + initWithView:self.view + delegate:transition] autorelease]; + + pageNumber -= 2; + [mpv gotoPage:pageNumber]; + + [glview prepareTextureTo:self.view]; + + [glview setClearColorRed:0.0 + green:0.0 + blue:0.0 + alpha:1.0]; + + [glview startTransition]; +} + + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + +@end diff --git a/FlipReader-iPad/Classes/MyPDFView.h b/FlipReader-iPad/Classes/MyPDFView.h new file mode 100644 index 0000000..bfac186 --- /dev/null +++ b/FlipReader-iPad/Classes/MyPDFView.h @@ -0,0 +1,17 @@ +// +// MyPDFView.h +// GoForth +// +// Created by Edward Patel on 2010-12-25. +// Copyright 2010 Memention AB. All rights reserved. +// + +#import + + +@interface MyPDFView : UIView { + CGPDFDocumentRef book; + int pageNumber; +} +- (void)gotoPage:(int)nextPage; +@end diff --git a/FlipReader-iPad/Classes/MyPDFView.m b/FlipReader-iPad/Classes/MyPDFView.m new file mode 100644 index 0000000..2e2e0b7 --- /dev/null +++ b/FlipReader-iPad/Classes/MyPDFView.m @@ -0,0 +1,70 @@ +// +// MyPDFView.m +// GoForth +// +// Created by Edward Patel on 2010-12-25. +// Copyright 2010 Memention AB. All rights reserved. +// + +#import "MyPDFView.h" + +@implementation MyPDFView + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + NSURL *bookURL = [[NSBundle mainBundle] URLForResource:@"thinking-forth-color" withExtension:@"pdf"]; + book = CGPDFDocumentCreateWithURL((CFURLRef)bookURL); + pageNumber = 1; + } + return self; +} + +- (void)gotoPage:(int)nextPage +{ + pageNumber = nextPage; + [self setNeedsDisplay]; +} + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + CGPDFPageRef page1; + CGPDFPageRef page2; + + page1 = CGPDFDocumentGetPage(book, pageNumber); + page2 = CGPDFDocumentGetPage(book, pageNumber+1); + + CGRect pageRect; + if (page1) + pageRect = CGPDFPageGetBoxRect(page1, kCGPDFMediaBox); + else + pageRect = CGPDFPageGetBoxRect(page2, kCGPDFMediaBox); + + CGRect frameRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); + CGFloat scaleFactorWidth = 0.5*frameRect.size.width/pageRect.size.width; + + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); + CGContextFillRect(context, frameRect); + CGContextSaveGState(context); + CGContextTranslateCTM(context, 0, rect.size.height); + CGContextScaleCTM(context, 1.0, -1.0); + CGContextScaleCTM(context, scaleFactorWidth, scaleFactorWidth); + if (page1) + CGContextDrawPDFPage(context, page1); + CGContextTranslateCTM(context, 0.5*rect.size.height*scaleFactorWidth, 0); + if (page2) + CGContextDrawPDFPage(context, page2); + CGContextMoveToPoint(context, 0.5*scaleFactorWidth, 0); + CGContextAddLineToPoint(context, 0.5*scaleFactorWidth, rect.size.width*scaleFactorWidth); + CGContextStrokePath(context); +} + +- (void)dealloc { + CGPDFDocumentRelease(book); + [super dealloc]; +} + +@end diff --git a/FlipReader-iPad/FlipReader-Info.plist b/FlipReader-iPad/FlipReader-Info.plist new file mode 100644 index 0000000..ffa7a11 --- /dev/null +++ b/FlipReader-iPad/FlipReader-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + + UIInterfaceOrientation + UIInterfaceOrientationLandscapeRight + UIStatusBarHidden + + + diff --git a/FlipReader-iPad/FlipReader.xcodeproj/project.pbxproj b/FlipReader-iPad/FlipReader.xcodeproj/project.pbxproj new file mode 100755 index 0000000..1d51a21 --- /dev/null +++ b/FlipReader-iPad/FlipReader.xcodeproj/project.pbxproj @@ -0,0 +1,298 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* FlipReaderAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* FlipReaderAppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 2899E5220DE3E06400AC0155 /* FlipReaderViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* FlipReaderViewController.xib */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28D7ACF80DDB3853001CB0EB /* FlipReaderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* FlipReaderViewController.m */; }; + 3A63317012F87F5B00678F4A /* EPGLTransitionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A63316D12F87F5B00678F4A /* EPGLTransitionView.m */; }; + 3A63317112F87F5B00678F4A /* FlipTransitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A63316F12F87F5B00678F4A /* FlipTransitions.m */; }; + 3AC5C84512F83D8700345C6E /* thinking-forth-color.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5C84312F83D8700345C6E /* thinking-forth-color.pdf */; }; + 3AC5C85C12F83E3900345C6E /* MyPDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AC5C85B12F83E3900345C6E /* MyPDFView.m */; }; + 3AC5C97412F84CB700345C6E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AC5C97312F84CB700345C6E /* OpenGLES.framework */; }; + 3AC5C97C12F84CDC00345C6E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AC5C97B12F84CDC00345C6E /* QuartzCore.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* FlipReaderAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlipReaderAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* FlipReaderAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlipReaderAppDelegate.m; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* FlipReader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlipReader.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 2899E5210DE3E06400AC0155 /* FlipReaderViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FlipReaderViewController.xib; sourceTree = ""; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* FlipReaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlipReaderViewController.h; sourceTree = ""; }; + 28D7ACF70DDB3853001CB0EB /* FlipReaderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlipReaderViewController.m; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* FlipReader_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlipReader_Prefix.pch; sourceTree = ""; }; + 3A63316C12F87F5B00678F4A /* EPGLTransitionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EPGLTransitionView.h; path = ../src/EPGLTransitionView.h; sourceTree = SOURCE_ROOT; }; + 3A63316D12F87F5B00678F4A /* EPGLTransitionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EPGLTransitionView.m; path = ../src/EPGLTransitionView.m; sourceTree = SOURCE_ROOT; }; + 3A63316E12F87F5B00678F4A /* FlipTransitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlipTransitions.h; path = ../src/FlipTransitions.h; sourceTree = SOURCE_ROOT; }; + 3A63316F12F87F5B00678F4A /* FlipTransitions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlipTransitions.m; path = ../src/FlipTransitions.m; sourceTree = SOURCE_ROOT; }; + 3AC5C84312F83D8700345C6E /* thinking-forth-color.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "thinking-forth-color.pdf"; sourceTree = ""; }; + 3AC5C85A12F83E3900345C6E /* MyPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyPDFView.h; sourceTree = ""; }; + 3AC5C85B12F83E3900345C6E /* MyPDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyPDFView.m; sourceTree = ""; }; + 3AC5C97312F84CB700345C6E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 3AC5C97B12F84CDC00345C6E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* FlipReader-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "FlipReader-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + 3AC5C97412F84CB700345C6E /* OpenGLES.framework in Frameworks */, + 3AC5C97C12F84CDC00345C6E /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 3AC5C85A12F83E3900345C6E /* MyPDFView.h */, + 3AC5C85B12F83E3900345C6E /* MyPDFView.m */, + 1D3623240D0F684500981E51 /* FlipReaderAppDelegate.h */, + 1D3623250D0F684500981E51 /* FlipReaderAppDelegate.m */, + 28D7ACF60DDB3853001CB0EB /* FlipReaderViewController.h */, + 28D7ACF70DDB3853001CB0EB /* FlipReaderViewController.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* FlipReader.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 3A63316C12F87F5B00678F4A /* EPGLTransitionView.h */, + 3A63316D12F87F5B00678F4A /* EPGLTransitionView.m */, + 3A63316E12F87F5B00678F4A /* FlipTransitions.h */, + 3A63316F12F87F5B00678F4A /* FlipTransitions.m */, + 3AC5C84012F83D6C00345C6E /* PDF */, + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* FlipReader_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2899E5210DE3E06400AC0155 /* FlipReaderViewController.xib */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* FlipReader-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3AC5C97312F84CB700345C6E /* OpenGLES.framework */, + 3AC5C97B12F84CDC00345C6E /* QuartzCore.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3AC5C84012F83D6C00345C6E /* PDF */ = { + isa = PBXGroup; + children = ( + 3AC5C84312F83D8700345C6E /* thinking-forth-color.pdf */, + ); + path = PDF; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* FlipReader */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "FlipReader" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FlipReader; + productName = FlipReader; + productReference = 1D6058910D05DD3D006BFB54 /* FlipReader.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FlipReader" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* FlipReader */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 2899E5220DE3E06400AC0155 /* FlipReaderViewController.xib in Resources */, + 3AC5C84512F83D8700345C6E /* thinking-forth-color.pdf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* FlipReaderAppDelegate.m in Sources */, + 28D7ACF80DDB3853001CB0EB /* FlipReaderViewController.m in Sources */, + 3AC5C85C12F83E3900345C6E /* MyPDFView.m in Sources */, + 3A63317012F87F5B00678F4A /* EPGLTransitionView.m in Sources */, + 3A63317112F87F5B00678F4A /* FlipTransitions.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = FlipReader_Prefix.pch; + INFOPLIST_FILE = "FlipReader-Info.plist"; + PRODUCT_NAME = FlipReader; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = FlipReader_Prefix.pch; + INFOPLIST_FILE = "FlipReader-Info.plist"; + PRODUCT_NAME = FlipReader; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PREBINDING = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "FlipReader" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FlipReader" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/FlipReader-iPad/FlipReaderViewController.xib b/FlipReader-iPad/FlipReaderViewController.xib new file mode 100644 index 0000000..39c5706 --- /dev/null +++ b/FlipReader-iPad/FlipReaderViewController.xib @@ -0,0 +1,333 @@ + + + + 1056 + 10J567 + 823 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 132 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 274 + {1024, 748} + + + 3 + MQA + + 2 + + + + 3 + + IBIPadFramework + + + + + YES + + + view + + + + 3 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + + + YES + FlipReaderViewController + UIResponder + {{342, 108}, {1024, 748}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 3 + + + + YES + + FlipReaderViewController + UIViewController + + IBProjectSource + Classes/FlipReaderViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIPrintFormatter.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + FlipReader.xcodeproj + 3 + 132 + + diff --git a/FlipReader-iPad/FlipReader_Prefix.pch b/FlipReader-iPad/FlipReader_Prefix.pch new file mode 100644 index 0000000..b968b26 --- /dev/null +++ b/FlipReader-iPad/FlipReader_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'FlipReader' target in the 'FlipReader' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/FlipReader-iPad/MainWindow.xib b/FlipReader-iPad/MainWindow.xib new file mode 100644 index 0000000..dd51e61 --- /dev/null +++ b/FlipReader-iPad/MainWindow.xib @@ -0,0 +1,437 @@ + + + + 1056 + 10J567 + 823 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 132 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + + 292 + {768, 1024} + + + 1 + MSAxIDEAA + + NO + NO + IBIPadFramework + YES + + + IBIPadFramework + + + FlipReaderViewController + + 2 + + + 1 + + IBIPadFramework + NO + + + + + YES + + + viewController + + + + 8 + + + + delegate + + + + 9 + + + + window + + + + 10 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + 6 + + + FlipReader App Delegate + + + 7 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 6.CustomClassName + 6.IBPluginDependency + 7.CustomClassName + 7.IBEditorWindowLastContentRect + 7.IBPluginDependency + + + YES + UIApplication + UIResponder + {{200, 4}, {783, 852}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + FlipReaderAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + FlipReaderViewController + {{512, 351}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 10 + + + + YES + + FlipReaderAppDelegate + NSObject + + YES + + YES + viewController + window + + + YES + FlipReaderViewController + UIWindow + + + + YES + + YES + viewController + window + + + YES + + viewController + FlipReaderViewController + + + window + UIWindow + + + + + IBProjectSource + Classes/FlipReaderAppDelegate.h + + + + FlipReaderViewController + UIViewController + + IBProjectSource + Classes/FlipReaderViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIApplication + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIApplication.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIPrintFormatter.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + UIWindow + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIWindow.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + FlipReader.xcodeproj + 3 + 132 + + diff --git a/FlipReader-iPad/PDF/thinking-forth-color.pdf b/FlipReader-iPad/PDF/thinking-forth-color.pdf new file mode 100644 index 0000000..b7079f6 Binary files /dev/null and b/FlipReader-iPad/PDF/thinking-forth-color.pdf differ diff --git a/FlipReader-iPad/main.m b/FlipReader-iPad/main.m new file mode 100644 index 0000000..71a90dc --- /dev/null +++ b/FlipReader-iPad/main.m @@ -0,0 +1,17 @@ +// +// main.m +// FlipReader +// +// Created by Edward Patel on 2011-02-01. +// Copyright 2011 Memention AB. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +} diff --git a/README.md b/README.md index c60aa01..6b6e99f 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,6 @@ transition of a view. The effect is implemented in a delegate that will be called for drawing the animation. + +The FlipReader demo uses iPad in landscape to view a pdf with swipe gestures +for page turning. diff --git a/src/EPGLTransitionView.h b/src/EPGLTransitionView.h old mode 100644 new mode 100755 index c8df034..6cfe11f --- a/src/EPGLTransitionView.h +++ b/src/EPGLTransitionView.h @@ -1,6 +1,6 @@ /* =========================================================================== - Copyright (c) 2010 Edward Patel + Copyright (c) 2010-2011 Edward Patel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/EPGLTransitionView.m b/src/EPGLTransitionView.m old mode 100644 new mode 100755 index 1a6ddd5..92a44ae --- a/src/EPGLTransitionView.m +++ b/src/EPGLTransitionView.m @@ -1,6 +1,6 @@ /* =========================================================================== - Copyright (c) 2010 Edward Patel + Copyright (c) 2010-2011 Edward Patel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,7 @@ - (id)initWithView:(UIView*)view if ((self = [super initWithFrame:view.frame])) { maxTextureSize = 512; - size = view.frame.size; + size = view.bounds.size; if (size.height > 512 || size.width > 512) // Big screen? iPad! maxTextureSize = 1024; delegate = _delegate; @@ -117,7 +117,7 @@ - (id)initWithView:(UIView*)view GL_RENDERBUFFER_OES, depthRenderbuffer); - glViewport(0, 0, size.width, size.height); + glViewport(0, 0, view.frame.size.width, view.frame.size.height); glEnable(GL_DEPTH_TEST); @@ -297,7 +297,6 @@ - (BOOL) render - (BOOL) resizeFromLayer:(CAEAGLLayer *)layer { - glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer); [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:layer]; glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth); diff --git a/src/FlipTransitions.h b/src/FlipTransitions.h new file mode 100755 index 0000000..c4d0c3b --- /dev/null +++ b/src/FlipTransitions.h @@ -0,0 +1,35 @@ +/* =========================================================================== + + Copyright (c) 2010-2011 Edward Patel + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + =========================================================================== */ + +#import "EPGLTransitionView.h" + +@interface FlipForward : NSObject { + float f; +} +@end + +@interface FlipBackward : NSObject { + float f; +} +@end diff --git a/src/FlipTransitions.m b/src/FlipTransitions.m new file mode 100755 index 0000000..7927add --- /dev/null +++ b/src/FlipTransitions.m @@ -0,0 +1,183 @@ +/* =========================================================================== + + Copyright (c) 2010-2011 Edward Patel + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + =========================================================================== */ + +#import "FlipTransitions.h" + +@implementation FlipForward + +- (void)setupTransition +{ + // Setup matrices + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glRotatef(90, 0, 0, -1); + glFrustumf(-0.1, 0.1, -0.1333, 0.1333, 0.4, 100.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glEnable(GL_CULL_FACE); + f = 0; +} + +// GL context is active and screen texture bound to be used +- (BOOL)drawTransitionFrameWithTextureFrom:(GLuint)textureFromView + textureTo:(GLuint)textureToView +{ + GLfloat vertices[] = { + -1, -1.3333, + 0, -1.3333, + -1, 1.3333, + 0, 1.3333, + 0, -1.3333, + 1, -1.3333, + 0, 1.3333, + 1, 1.3333, + }; + + GLfloat texcoords[] = { + 0.0, 1, + 0.5, 1, + 0.0, 0, + 0.5, 0, + 0.5, 1, + 1.0, 1, + 0.5, 0, + 1.0, 0, + }; + + glVertexPointer(2, GL_FLOAT, 0, vertices); + glEnableClientState(GL_VERTEX_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, texcoords); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + float v = -(-cos(f)+1.0)/2.0; // For a little ease-in-ease-out + + glColor4f(1+v/2.0, 1+v/2.0, 1+v/2.0, 1.0); + glPushMatrix(); + glTranslatef(0, 0, -4); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glPushMatrix(); + glRotatef(v*180.0, 0, 1, 0); + glPolygonOffset(0, -1); + glEnable(GL_POLYGON_OFFSET_FILL); + glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); + glDisable(GL_POLYGON_OFFSET_FILL); + glRotatef(180.0, 0, 1, 0); + glColor4f(0.5-v/2.0, 0.5-v/2.0, 0.5-v/2.0, 1.0); + glBindTexture(GL_TEXTURE_2D, textureToView); + glPolygonOffset(0, -1); + glEnable(GL_POLYGON_OFFSET_FILL); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glDisable(GL_POLYGON_OFFSET_FILL); + glPopMatrix(); + glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); + glPopMatrix(); + + f += M_PI/20.0; + + return f < M_PI; +} + +- (void)transitionEnded +{ +} + +@end + +@implementation FlipBackward + +- (void)setupTransition +{ + // Setup matrices + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glRotatef(90, 0, 0, -1); + glFrustumf(-0.1, 0.1, -0.1333, 0.1333, 0.4, 100.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glEnable(GL_CULL_FACE); + f = 0; +} + +// GL context is active and screen texture bound to be used +- (BOOL)drawTransitionFrameWithTextureFrom:(GLuint)textureFromView + textureTo:(GLuint)textureToView +{ + GLfloat vertices[] = { + -1, -1.3333, + 0, -1.3333, + -1, 1.3333, + 0, 1.3333, + 0, -1.3333, + 1, -1.3333, + 0, 1.3333, + 1, 1.3333, + }; + + GLfloat texcoords[] = { + 0.0, 1, + 0.5, 1, + 0.0, 0, + 0.5, 0, + 0.5, 1, + 1.0, 1, + 0.5, 0, + 1.0, 0, + }; + + glVertexPointer(2, GL_FLOAT, 0, vertices); + glEnableClientState(GL_VERTEX_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, texcoords); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + float v = -(-cos(f)+1.0)/2.0; // For a little ease-in-ease-out + + glColor4f(0.5-v/2.0, 0.5-v/2.0, 0.5-v/2.0, 1.0); + glBindTexture(GL_TEXTURE_2D, textureToView); + glPushMatrix(); + glTranslatef(0, 0, -4); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glPushMatrix(); + glRotatef(180-v*180.0, 0, 1, 0); + glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); + glRotatef(180.0, 0, 1, 0); + glColor4f(1+v/2.0, 1+v/2.0, 1+v/2.0, 1.0); + glBindTexture(GL_TEXTURE_2D, textureFromView); + glPolygonOffset(0, -1); + glEnable(GL_POLYGON_OFFSET_FILL); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glDisable(GL_POLYGON_OFFSET_FILL); + glPopMatrix(); + glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); + glPopMatrix(); + + f += M_PI/20.0; + + return f < M_PI; +} + +- (void)transitionEnded +{ +} + +@end