Permalink
Browse files

Initial port to Xcode 4.

  • Loading branch information...
0 parents commit 071e6c93117e7a3092a5848278de801440f7bff1 @bmeurer committed Aug 4, 2011
@@ -0,0 +1 @@
+*.pbxproj -crlf -diff -merge
@@ -0,0 +1,7 @@
+*xcodeproj/*mode*
+*xcodeproj/*pbxuser
+*xcodeproj/*per*
+*xcodeproj/project.xcworkspace
+*xcodeproj/xcuserdata
+.DS_Store
+*.pbxuser

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2011, Benedikt Meurer <benedikt.meurer@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#import <UIKit/UIKit.h>
+
+
+@class FLRootViewController;
+
+
+@interface FLAppDelegate : NSObject <UIApplicationDelegate> {
+@private
+ FLRootViewController *_rootViewController;
+ UIWindow *_window;
+}
+
+@property (nonatomic, retain) FLRootViewController *rootViewController;
+@property (nonatomic, retain) UIWindow *window;
+
+@end
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 2011, Benedikt Meurer <benedikt.meurer@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#import "FLAppDelegate.h"
+#import "FLRootViewController.h"
+
+
+@implementation FLAppDelegate
+
+@synthesize rootViewController = _rootViewController;
+@synthesize window = _window;
+
+
+- (void)dealloc
+{
+ [_rootViewController release], _rootViewController = nil;
+ [_window release], _window = nil;
+ [super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark UIApplicationDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ [self.window setRootViewController:self.rootViewController];
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+
+@end
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2011, Benedikt Meurer <benedikt.meurer@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#import <UIKit/UIKit.h>
+
+
+@protocol FLInfoViewControllerDelegate;
+
+
+@interface FLInfoViewController : UIViewController {
+@private
+ id<FLInfoViewControllerDelegate> _delegate;
+ UILabel *_titleLabel;
+ UILabel *_versionLabel;
+}
+
+@property (nonatomic, assign) id<FLInfoViewControllerDelegate> delegate;
+@property (nonatomic, retain) IBOutlet UILabel *titleLabel;
+@property (nonatomic, retain) IBOutlet UILabel *versionLabel;
+
+- (IBAction)doneBarButtonItemClicked:(id)sender;
+
+@end
+
+
+@protocol FLInfoViewControllerDelegate <NSObject>
+
+- (void)infoViewControllerDidFinish:(FLInfoViewController *)infoViewController;
+
+@end
@@ -0,0 +1,89 @@
+/*-
+ * Copyright (c) 2011, Benedikt Meurer <benedikt.meurer@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#import "FLInfoViewController.h"
+
+
+@implementation FLInfoViewController
+
+@synthesize delegate = _delegate;
+@synthesize titleLabel = _titleLabel;
+@synthesize versionLabel = _versionLabel;
+
+
+- (void)dealloc
+{
+ [_titleLabel release], _titleLabel = nil;
+ [_versionLabel release], _versionLabel = nil;
+ [super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark Actions
+
+
+- (IBAction)doneBarButtonItemClicked:(id)sender
+{
+ [self.delegate infoViewControllerDidFinish:self];
+}
+
+
+#pragma mark -
+#pragma mark UIViewController
+
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"InfoBackground"]]];
+
+ // Generate the titleLabel and versionLabel from the Info.plist strings
+ NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
+ self.titleLabel.text = [infoDictionary objectForKey:@"CFBundleDisplayName"];
+ self.versionLabel.text = [NSString stringWithFormat:@"%@ (%@)",
+ [infoDictionary objectForKey:@"CFBundleShortVersionString"],
+ [infoDictionary objectForKey:@"CFBundleVersion"]];
+
+}
+
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ self.titleLabel = nil;
+ self.versionLabel = nil;
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+
+@end
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2011, Benedikt Meurer <benedikt.meurer@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <AudioToolbox/AudioToolbox.h>
+
+#import "FLInfoViewController.h"
+#import "FLTouchView.h"
+#import "FLTorch.h"
+
+
+@interface FLRootViewController : UIViewController <FLInfoViewControllerDelegate, FLTouchViewDelegate, FLTorchDelegate> {
+@private
+ UIImageView *_ledImageView;
+ UIView *_switchView;
+ BOOL _touchActive;
+ FLTouchView *_touchView;
+ FLTorch *_torch;
+ SystemSoundID _tickSoundID;
+ BOOL _tickSoundRegistered;
+}
+
+@property (nonatomic, retain) IBOutlet UIImageView *ledImageView;
+@property (nonatomic, retain) IBOutlet UIView *switchView;
+@property (nonatomic, retain) IBOutlet FLTouchView *touchView;
+
+@property (nonatomic, retain, readonly) FLTorch *torch;
+
+- (IBAction)infoButtonClicked:(id)sender;
+
+@end
Oops, something went wrong.

0 comments on commit 071e6c9

Please sign in to comment.