forked from mixare/mixare-iphone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jakob
committed
Oct 21, 2010
1 parent
66cb996
commit bc3c73c
Showing
26 changed files
with
1,331 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// FirstViewController.h | ||
// Mixare | ||
// | ||
// Created by jakob on 05.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
||
@interface CameraViewController : UIViewController { | ||
UIImagePickerController *imgPicker; | ||
UIView * cameraView; | ||
} | ||
@property (nonatomic,retain) UIImagePickerController *imgPicker; | ||
@property (nonatomic,retain) IBOutlet UIView * cameraView; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// | ||
// FirstViewController.m | ||
// Mixare | ||
// | ||
// Created by jakob on 05.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "CameraViewController.h" | ||
|
||
|
||
@implementation CameraViewController | ||
@synthesize imgPicker; | ||
@synthesize cameraView; | ||
|
||
/* | ||
// The designated initializer. Override to perform setup that is required before the view is loaded. | ||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { | ||
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
*/ | ||
|
||
/* | ||
// Implement loadView to create a view hierarchy programmatically, without using a nib. | ||
- (void)loadView { | ||
} | ||
*/ | ||
|
||
-(void)viewWillAppear{ | ||
NSLog(@"in view"); | ||
/* generate the controller */ | ||
imgPicker = [[[UIImagePickerController alloc] init] | ||
autorelease]; | ||
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera; | ||
imgPicker.showsCameraControls = NO; | ||
|
||
/* move the controller, to make the | ||
statusbar visible */ | ||
CGRect frame = imgPicker.view.frame; | ||
frame.origin.y += 30; | ||
frame.size.height -= 30; | ||
imgPicker.view.frame = frame; | ||
|
||
/* add the view to the window */ | ||
[cameraView addSubview:[imgPicker view]]; | ||
|
||
/* make sure to change the alpha value | ||
of the view */ | ||
//[navigationController.view setAlpha:0.7] | ||
|
||
/* add the original view controller */ | ||
// [window addSubview:[navigationController view]]; | ||
//[cameraView makeKeyAndVisible]; | ||
|
||
} | ||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. | ||
- (void)viewDidLoad { | ||
|
||
} | ||
|
||
|
||
/* | ||
// Override to allow orientations other than the default portrait orientation. | ||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | ||
// Return YES for supported orientations | ||
return (interfaceOrientation == UIInterfaceOrientationPortrait); | ||
} | ||
*/ | ||
|
||
- (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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// DataHandler.h | ||
// Mixare | ||
// | ||
// Created by jakob on 21.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
|
||
|
||
@interface DataHandler : NSObject { | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// DataHandler.m | ||
// Mixare | ||
// | ||
// Created by jakob on 21.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "DataHandler.h" | ||
|
||
|
||
@implementation DataHandler | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// JsonHandler.h | ||
// Mixare | ||
// | ||
// Created by jakob on 21.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
//#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface JsonHandler : NSObject { | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// JsonHandler.m | ||
// Mixare | ||
// | ||
// Created by jakob on 21.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "JsonHandler.h" | ||
|
||
|
||
@implementation JsonHandler | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// MixareAppDelegate.h | ||
// Mixare | ||
// | ||
// Created by jakob on 05.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "CameraViewController.h" | ||
|
||
@interface MixareAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { | ||
UIWindow *window; | ||
UITabBarController *tabBarController; | ||
UIImagePickerController* imgPicker; | ||
UIButton *closeButton; | ||
} | ||
|
||
@property (nonatomic, retain) IBOutlet UIWindow *window; | ||
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; | ||
-(void)initCameraView; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// | ||
// MixareAppDelegate.m | ||
// Mixare | ||
// | ||
// Created by jakob on 05.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "MixareAppDelegate.h" | ||
|
||
|
||
@implementation MixareAppDelegate | ||
|
||
@synthesize window; | ||
@synthesize tabBarController; | ||
|
||
|
||
#pragma mark - | ||
#pragma mark Application lifecycle | ||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
//[window addSubview:tabBarController.view]; | ||
[self initCameraView]; | ||
[window addSubview:imgPicker.view]; | ||
//[window addSubview:tabBarController.view]; | ||
[window makeKeyAndVisible]; | ||
return YES; | ||
} | ||
|
||
-(void)initCameraView{ | ||
imgPicker = [[[UIImagePickerController alloc] init] | ||
autorelease]; | ||
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera; | ||
imgPicker.showsCameraControls = NO; | ||
/* move the controller, to make the | ||
statusbar visible */ | ||
CGRect frame = imgPicker.view.frame; | ||
//frame.origin.y += 30; | ||
frame.size.height= 480.0; | ||
//imgPicker.view.frame = frame; | ||
|
||
//adding close butten to View | ||
closeButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | ||
closeButton.frame = CGRectMake(270, 0, 50, 25); | ||
closeButton.backgroundColor = [UIColor clearColor]; | ||
[closeButton setTitle:@"Menu" forState:UIControlStateNormal]; | ||
[closeButton setAlpha:0.7]; | ||
[closeButton addTarget:self action:@selector(buttonClick:)forControlEvents:UIControlEventTouchUpInside]; | ||
//closeButton.center = self.center; | ||
[imgPicker.view addSubview:closeButton]; | ||
} | ||
|
||
-(void)buttonClick:(id)sender{ | ||
NSLog(@"Close button pressed"); | ||
[imgPicker dismissModalViewControllerAnimated:YES]; | ||
imgPicker.view.hidden = YES; | ||
|
||
//[imgPicker.view removeFromSuperview]; | ||
[window addSubview:tabBarController.view]; | ||
} | ||
- (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)applicationDidEnterBackground:(UIApplication *)application { | ||
/* | ||
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | ||
If your application supports background execution, called instead of applicationWillTerminate: when the user quits. | ||
*/ | ||
} | ||
|
||
|
||
- (void)applicationWillEnterForeground:(UIApplication *)application { | ||
/* | ||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. | ||
*/ | ||
} | ||
|
||
|
||
- (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 UITabBarControllerDelegate methods | ||
|
||
/* | ||
// Optional UITabBarControllerDelegate method. | ||
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { | ||
} | ||
*/ | ||
|
||
/* | ||
// Optional UITabBarControllerDelegate method. | ||
- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed { | ||
} | ||
*/ | ||
|
||
|
||
#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 { | ||
[tabBarController release]; | ||
[window release]; | ||
[imgPicker release]; | ||
[closeButton release]; | ||
[super dealloc]; | ||
} | ||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// PhysicalPlace.h | ||
// Mixare | ||
// | ||
// Created by jakob on 21.10.10. | ||
// Copyright 2010 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
//#import <Cocoa/Cocoa.h> | ||
#import <Foundation/Foundation.h> | ||
#import <MapKit/MapKit.h> | ||
|
||
@interface PhysicalPlace : NSObject <MKAnnotation> { | ||
NSString * lat; | ||
NSString * lon; | ||
NSString * altitude; | ||
NSString * title; | ||
NSString * subTitle; | ||
} | ||
@property (nonatomic,retain) NSString * lat; | ||
@property (nonatomic,retain) NSString * lon; | ||
@property (nonatomic,retain) NSString * altitude; | ||
@property (nonatomic,retain) NSString * title; | ||
@property (nonatomic,retain) NSString * subTitle; | ||
|
||
+(void)calcDestinationWithLat1: (float) lat1Deg lon1: (float) lon1Deg bear: (float) bear destination: (float) d place: (PhysicalPlace*) pl; | ||
+ (float)degreesToRadians:(float)degrees; | ||
|
||
|
||
@end |
Oops, something went wrong.