From 97e23ead86a98545b699595f76f4526858501353 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 13 Aug 2011 14:17:09 +0300 Subject: [ios] Initial GUI refactoring --- iphone/Maps/Classes/EAGLView.h | 13 +- iphone/Maps/Classes/EAGLView.mm | 19 +- iphone/Maps/Classes/GuideView.xib | 343 ------------ iphone/Maps/Classes/GuideViewController.h | 24 - iphone/Maps/Classes/GuideViewController.mm | 148 ----- iphone/Maps/Classes/MapViewController.h | 6 +- iphone/Maps/Classes/MapViewController.mm | 112 ++-- iphone/Maps/Classes/MapsAppDelegate.h | 15 +- iphone/Maps/Classes/MapsAppDelegate.mm | 55 +- iphone/Maps/Classes/SearchVC.h | 22 + iphone/Maps/Classes/SearchVC.mm | 166 ++++++ iphone/Maps/GuideView-iPad.xib | 391 ------------- iphone/Maps/MainWindow.xib | 698 +++++++++++++----------- iphone/Maps/Maps.xcodeproj/project.pbxproj | 76 +-- iphone/Maps/MapsWithMe-Info.plist | 2 + iphone/Maps/Resources-iPad/MainWindow-iPad.xib | 687 +++++++++++------------ iphone/Maps/Settings/CountriesViewController.mm | 35 +- iphone/Maps/Settings/SettingsManager.h | 2 - iphone/Maps/Settings/SettingsManager.mm | 73 +-- iphone/Maps/search.png | Bin 0 -> 3243 bytes iphone/Maps/search@2x.png | Bin 0 -> 3374 bytes 21 files changed, 961 insertions(+), 1926 deletions(-) delete mode 100644 iphone/Maps/Classes/GuideView.xib delete mode 100644 iphone/Maps/Classes/GuideViewController.h delete mode 100644 iphone/Maps/Classes/GuideViewController.mm create mode 100644 iphone/Maps/Classes/SearchVC.h create mode 100644 iphone/Maps/Classes/SearchVC.mm delete mode 100644 iphone/Maps/GuideView-iPad.xib create mode 100644 iphone/Maps/search.png create mode 100644 iphone/Maps/search@2x.png diff --git a/iphone/Maps/Classes/EAGLView.h b/iphone/Maps/Classes/EAGLView.h index ff9b0e7938..222ca3dd05 100644 --- a/iphone/Maps/Classes/EAGLView.h +++ b/iphone/Maps/Classes/EAGLView.h @@ -1,11 +1,3 @@ -// -// EAGLView.h -// chuchu_iphone -// -// Created by Yury Melnichek on 08.03.09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - #import #import #import @@ -51,11 +43,8 @@ namespace yg MapViewController * controller; } -/// Called as a result of invalidate on iphone::WindowHandle -- (void)drawView; -- (void)drawViewThunk:(id)obj; +// Called as a result of invalidate on iphone::WindowHandle - (void)drawViewOnMainThread; -- (void)onSize:(int)width withHeight:(int)height; @property (nonatomic, assign) MapViewController * controller; @property (nonatomic, assign) shared_ptr windowHandle; diff --git a/iphone/Maps/Classes/EAGLView.mm b/iphone/Maps/Classes/EAGLView.mm index e5d01fc5a6..efa3975aa2 100644 --- a/iphone/Maps/Classes/EAGLView.mm +++ b/iphone/Maps/Classes/EAGLView.mm @@ -13,11 +13,6 @@ #include "RenderBuffer.hpp" #include "RenderContext.hpp" -// A class extension to declare private methods -@interface EAGLView () - -@end - @implementation EAGLView @synthesize controller; @@ -132,8 +127,6 @@ windowHandle->setRenderContext(renderContext); } - self.multipleTouchEnabled = YES; - return self; } @@ -153,7 +146,6 @@ drawer->screen()->beginFrame(); drawer->screen()->clear(); drawer->screen()->endFrame(); - } - (void)drawView @@ -174,13 +166,10 @@ - (void)layoutSubviews { - CGFloat scaleFactor = 1.0; - if ([self respondsToSelector:@selector(contentScaleFactor)]) - scaleFactor = self.contentScaleFactor; - - [[self controller] onResize:self.frame.size.width * scaleFactor withHeight:self.frame.size.height * scaleFactor]; - [self onSize:self.frame.size.width * scaleFactor withHeight:self.frame.size.height * scaleFactor]; - // This crashes on iPad: [self drawView]; + CGFloat const scale = self.contentScaleFactor; + CGSize const s = self.frame.size; + [self.controller onResize:s.width * scale withHeight:s.height * scale]; + [self onSize:s.width * scale withHeight:s.height * scale]; } - (void)dealloc diff --git a/iphone/Maps/Classes/GuideView.xib b/iphone/Maps/Classes/GuideView.xib deleted file mode 100644 index 1d745e44e4..0000000000 --- a/iphone/Maps/Classes/GuideView.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - 1056 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - YES - IBProxyObject - IBUIBarButtonItem - IBUIToolbar - IBUISearchBar - IBUISegmentedControl - IBUITableView - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 274 - {{0, 44}, {320, 372}} - - - 3 - MQA - - YES - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - 266 - - YES - - - 292 - {{90, 8}, {140, 30}} - - - NO - IBCocoaTouchFramework - 2 - 2 - 1 - - YES - Map - Guide - - - YES - - - - - YES - - - - - YES - {0, 0} - {0, 0} - - - YES - - - - - - {{0, 416}, {320, 44}} - - - NO - NO - IBCocoaTouchFramework - - YES - - IBCocoaTouchFramework - - 5 - - - IBCocoaTouchFramework - 1 - - - - - IBCocoaTouchFramework - - 5 - - - - - - 290 - {320, 44} - - - 3 - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - {{0, 20}, {320, 460}} - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - OnMapClicked: - - - 13 - - 21 - - - - searchBar - - - - 23 - - - - resultsView - - - - 25 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 1 - - - YES - - - - - - View - - - 11 - - - YES - - - - - - - - 12 - - - YES - - - - - - 13 - - - - - 15 - - - - - 17 - - - - - 22 - - - - - 24 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBAttributePlaceholdersKey - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 11.IBPluginDependency - 13.IBPluginDependency - 15.IBPluginDependency - 17.IBPluginDependency - 17.IUISegmentedControlInspectorSelectedSegmentMetadataKey - 22.IBPluginDependency - 24.IBPluginDependency - - - YES - GuideViewController - - YES - - - - UIResponder - {{556, 412}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 25 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 301 - - diff --git a/iphone/Maps/Classes/GuideViewController.h b/iphone/Maps/Classes/GuideViewController.h deleted file mode 100644 index 18e7b82f83..0000000000 --- a/iphone/Maps/Classes/GuideViewController.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// GuideViewController.h -// Maps -// -// Created by Yury Melnichek on 15.03.11. -// Copyright 2011 MapsWithMe. All rights reserved. -// - -#import -#import "../../Sloynik/Shared/SearchVC.h" - -@interface GuideViewController : SearchVC -{ - UIActivityIndicatorView * activityIndicator; - UILabel * loadingLabel; -} - -@property (nonatomic, retain) UIActivityIndicatorView * activityIndicator; -@property (nonatomic, retain) UILabel * loadingLabel; - -- (IBAction)OnMapClicked:(id)sender; -- (void)OnSloynikEngineInitialized; - -@end diff --git a/iphone/Maps/Classes/GuideViewController.mm b/iphone/Maps/Classes/GuideViewController.mm deleted file mode 100644 index 36ce9620b1..0000000000 --- a/iphone/Maps/Classes/GuideViewController.mm +++ /dev/null @@ -1,148 +0,0 @@ -// -// GuideViewController.mm -// Maps -// -// Created by Yury Melnichek on 15.03.11. -// Copyright 2011 MapsWithMe. All rights reserved. -// - -#import "GuideViewController.h" -#import "MapsAppDelegate.h" -#import "MapViewController.h" -#import "ArticleVC.h" -#include "global.hpp" - -@implementation GuideViewController - -@synthesize activityIndicator; -@synthesize loadingLabel; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) - { - // Custom initialization - } - return self; -} - -- (void)dealloc -{ - [super dealloc]; -} - -- (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. -} - -- (IBAction)OnMapClicked:(id)sender -{ - UISegmentedControl * pSegmentedControl = (UISegmentedControl *)sender; - int const selectedIndex = pSegmentedControl.selectedSegmentIndex; - - if (selectedIndex != 1) - { - LOG(LINFO, (selectedIndex)); - [UIView transitionFromView:self.view - toView:[MapsAppDelegate theApp].mapViewController.view - duration:0 - options:UIViewAnimationOptionTransitionNone - completion:nil]; - [pSegmentedControl setSelectedSegmentIndex:1]; - } -} - -- (void)onEmptySearch -{ - // Do nothing. Don't hide the results view. -} - -- (void)willShowArticleVC:(ArticleVC *) viewController -{ - [super willShowArticleVC:viewController]; - viewController.articleFormat = @ - "" - " " - " " - " " - " " - " " - " " - " %@" - " " - ""; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. - if (!GetSloynikEngine()) - { - CGRect frame = self.view.frame; - self.activityIndicator = [[[UIActivityIndicatorView alloc] - initWithFrame:CGRectMake(frame.origin.x + frame.size.width / 2 - 15, - 80, 30, 30)] autorelease]; - - [self.activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray]; - [self.view addSubview:self.activityIndicator]; - - self.loadingLabel = [[[UILabel alloc] - initWithFrame:CGRectMake(frame.origin.x + frame.size.width / 2 - 30, - 110, 60, 30)] autorelease]; - self.loadingLabel.text = @"Indexing..."; - self.loadingLabel.textAlignment = UITextAlignmentCenter; - self.loadingLabel.userInteractionEnabled = NO; - self.loadingLabel.numberOfLines = 1; - self.loadingLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - self.loadingLabel.adjustsFontSizeToFitWidth = YES; - [self.view addSubview:self.loadingLabel]; - - self.searchBar.hidden = YES; - self.resultsView.hidden = YES; - - [self.activityIndicator startAnimating]; - } -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - // Return YES for supported orientations - return YES; -} - -- (void)OnSloynikEngineInitialized -{ - if (self.activityIndicator) - { - [self.activityIndicator removeFromSuperview]; - [self.loadingLabel removeFromSuperview]; - self.activityIndicator = nil; - self.searchBar.hidden = NO; - self.resultsView.hidden = NO; - [self.resultsView reloadData]; - } -} - -@end diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index 094ac01919..03fea4f54a 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -24,7 +24,7 @@ m2::PointD m_Pt1, m_Pt2; - UIBarButtonItem * m_myPositionButton; + UIButton * m_myPositionButton; NSTimer * m_iconTimer; bool m_mapIsVisible; @@ -42,8 +42,8 @@ - (IBAction)OnMyPositionClicked:(id)sender; - (IBAction)OnSettingsClicked:(id)sender; -- (IBAction)OnGuideClicked:(id)sender; +- (IBAction)OnSearchClicked:(id)sender; -@property (nonatomic, retain) IBOutlet UIBarButtonItem * m_myPositionButton; +@property (nonatomic, retain) IBOutlet UIButton * m_myPositionButton; @end diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index a204df06ab..544910842f 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -1,5 +1,5 @@ #import "MapViewController.h" -#import "GuideViewController.h" +#import "SearchVC.h" #import "MapsAppDelegate.h" #import "EAGLView.h" #import "WindowHandle.h" @@ -30,55 +30,42 @@ storage::Storage m_storage; - (void)OnLocationUpdated { - m_myPositionButton.image = [UIImage imageNamed:@"location.png"]; + [m_myPositionButton setImage:[UIImage imageNamed:@"location.png"] forState:UIControlStateSelected]; } - (IBAction)OnMyPositionClicked:(id)sender -{ - if (((UIBarButtonItem *)sender).style == UIBarButtonItemStyleBordered) +{ + if (m_myPositionButton.isSelected == NO) { typedef void (*OnLocationUpdatedFunc)(id, SEL); SEL onLocUpdatedSel = @selector(OnLocationUpdated); OnLocationUpdatedFunc locUpdatedImpl = (OnLocationUpdatedFunc)[self methodForSelector:onLocUpdatedSel]; m_framework->StartLocationService(bind(locUpdatedImpl, self, onLocUpdatedSel)); - ((UIBarButtonItem *)sender).style = UIBarButtonItemStyleDone; - ((UIBarButtonItem *)sender).image = [UIImage imageNamed:@"location-search.png"]; + m_myPositionButton.selected = YES; + [m_myPositionButton setImage:[UIImage imageNamed:@"location-search.png"] forState:UIControlStateSelected]; [[MapsAppDelegate theApp] disableStandby]; } else { m_framework->StopLocationService(); - ((UIBarButtonItem *)sender).style = UIBarButtonItemStyleBordered; - m_myPositionButton.image = [UIImage imageNamed:@"location.png"]; + m_myPositionButton.selected = NO; + [m_myPositionButton setImage:[UIImage imageNamed:@"location.png"] forState:UIControlStateSelected]; [[MapsAppDelegate theApp] enableStandby]; } } - (IBAction)OnSettingsClicked:(id)sender { - m_framework->SetUpdatesEnabled(false); [[[MapsAppDelegate theApp] settingsManager] Show:self WithStorage:&m_storage]; } -- (IBAction)OnGuideClicked:(id)sender +- (IBAction)OnSearchClicked:(id)sender { - UISegmentedControl * pSegmentedControl = (UISegmentedControl *)sender; - int const selectedIndex = pSegmentedControl.selectedSegmentIndex; - - if (selectedIndex != 0) - { - LOG(LINFO, (selectedIndex)); - m_framework->SetUpdatesEnabled(false); - UIView * guideView = [MapsAppDelegate theApp].guideViewController.view; - [guideView setFrame:self.view.frame]; - [UIView transitionFromView:self.view - toView:guideView - duration:0 - options:UIViewAnimationOptionTransitionNone - completion:nil]; - [pSegmentedControl setSelectedSegmentIndex:0]; - } + SearchVC * searchVC = [[[SearchVC alloc] + initWithSearchFunc:bind(&framework_t::Search, m_framework, _1, _2) + andShowRectFunc:bind(&framework_t::ShowRect, m_framework, _1)] autorelease]; + [self.navigationController pushViewController:searchVC animated:YES]; } - (void) dealloc @@ -107,8 +94,6 @@ storage::Storage m_storage; // initialize with currently active screen orientation [self didRotateFromInterfaceOrientation: self.interfaceOrientation]; - // to perform a proper resize - [(EAGLView*)self.view layoutSubviews]; // restore previous screen position bool res = m_framework->LoadState(); @@ -118,9 +103,6 @@ storage::Storage m_storage; m_framework->InitializeGL([(EAGLView*)self.view renderContext], resourceManager); m_framework->Invalidate(); - - -// m_framework->UpdateNow(); } return self; @@ -128,10 +110,6 @@ storage::Storage m_storage; - (void)onResize:(GLint) width withHeight:(GLint) height { - UIInterfaceOrientation orientation = [self interfaceOrientation]; - if ((orientation == UIInterfaceOrientationLandscapeLeft) - ||(orientation == UIInterfaceOrientationLandscapeRight)) - std::swap(width, height); m_framework->OnSize(width, height); } @@ -143,22 +121,19 @@ NSInteger compareAddress(id l, id r, void * context) - (void)updatePointsFromEvent:(UIEvent*)event { NSSet * allTouches = [event allTouches]; - int touchCount = [allTouches count]; - CGFloat scaleFactor = 1.0; - if ([self.view respondsToSelector:@selector(contentScaleFactor)]) - scaleFactor = self.view.contentScaleFactor; + CGFloat const scaleFactor = self.view.contentScaleFactor; - if (touchCount == 1) + if ([allTouches count] == 1) { - CGPoint pt = [[[allTouches allObjects] objectAtIndex:0] locationInView:nil]; + CGPoint const pt = [[[allTouches allObjects] objectAtIndex:0] locationInView:nil]; m_Pt1 = m2::PointD(pt.x * scaleFactor, pt.y * scaleFactor); } else { NSArray * sortedTouches = [[allTouches allObjects] sortedArrayUsingFunction:compareAddress context:NULL]; - CGPoint pt1 = [[sortedTouches objectAtIndex:0] locationInView:nil]; - CGPoint pt2 = [[sortedTouches objectAtIndex:1] locationInView:nil]; + CGPoint const pt1 = [[sortedTouches objectAtIndex:0] locationInView:nil]; + CGPoint const pt2 = [[sortedTouches objectAtIndex:1] locationInView:nil]; m_Pt1 = m2::PointD(pt1.x * scaleFactor, pt1.y * scaleFactor); m_Pt2 = m2::PointD(pt2.x * scaleFactor, pt2.y * scaleFactor); @@ -184,9 +159,8 @@ NSInteger compareAddress(id l, id r, void * context) - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { [self updatePointsFromEvent:event]; - int touchCount = [[event allTouches] count]; - // NSLog(@"touchesBeg %i", touchCount); - if (touchCount == 1) + + if ([[event allTouches] count] == 1) { m_framework->StartDrag(DragEvent(m_Pt1.x, m_Pt1.y)); m_CurrentAction = DRAGGING; @@ -202,8 +176,8 @@ NSInteger compareAddress(id l, id r, void * context) - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { - m2::PointD TempPt1 = m_Pt1; - m2::PointD TempPt2 = m_Pt2; + m2::PointD const TempPt1 = m_Pt1; + m2::PointD const TempPt2 = m_Pt2; [self updatePointsFromEvent:event]; @@ -247,13 +221,13 @@ NSInteger compareAddress(id l, id r, void * context) [self updatePointsFromEvent:event]; [self stopCurrentAction]; - int tapCount = ((UITouch*)[touches anyObject]).tapCount; - int touchesCount = [[event allTouches] count]; + int const tapCount = ((UITouch*)[touches anyObject]).tapCount; + int const touchesCount = [[event allTouches] count]; if (tapCount == 2 && (touchesCount == 1) && m_isSticking) m_framework->ScaleToPoint(ScaleToPointEvent(m_Pt1.x, m_Pt1.y, 2.0)); - if ((touchesCount == 2) && (tapCount = 1) && m_isSticking) + if ((touchesCount == 2) && (tapCount == 1) && m_isSticking) m_framework->Scale(0.5); } @@ -262,13 +236,13 @@ NSInteger compareAddress(id l, id r, void * context) [self updatePointsFromEvent:event]; [self stopCurrentAction]; - int tapCount = ((UITouch*)[touches anyObject]).tapCount; - int touchesCount = [[event allTouches] count]; + int const tapCount = ((UITouch*)[touches anyObject]).tapCount; + int const touchesCount = [[event allTouches] count]; if (tapCount == 2 && (touchesCount == 1) && m_isSticking) m_framework->ScaleToPoint(ScaleToPointEvent(m_Pt1.x, m_Pt1.y, 2.0)); - if ((touchesCount == 2) && (tapCount = 1) && m_isSticking) + if ((touchesCount == 2) && (tapCount == 1) && m_isSticking) m_framework->Scale(0.5); } @@ -279,41 +253,15 @@ NSInteger compareAddress(id l, id r, void * context) m_framework->Paint(paintEvent); } - -/* -// 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]; -} - - -// Override to allow orientations other than the default portrait orientation. - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation { - return YES; + return YES; // We support all orientations } - (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; - m_framework->MemoryWarning(); -// m_framework->Repaint(); - - // 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) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation @@ -369,12 +317,14 @@ NSInteger compareAddress(id l, id r, void * context) m_mapIsVisible = true; if (m_framework) [self Invalidate]; + [self.navigationController setNavigationBarHidden:YES animated:YES]; } - (void)viewWillDisappear:(BOOL)animated { m_mapIsVisible = false; m_framework->SetUpdatesEnabled(false); + [self.navigationController setNavigationBarHidden:NO animated:YES]; } @end diff --git a/iphone/Maps/Classes/MapsAppDelegate.h b/iphone/Maps/Classes/MapsAppDelegate.h index bed8ea7fb2..8d6204d4a8 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.h +++ b/iphone/Maps/Classes/MapsAppDelegate.h @@ -1,27 +1,24 @@ #import @class MapViewController; -@class GuideViewController; @class SettingsManager; -@class UIWindow; @interface MapsAppDelegate : NSObject { - GuideViewController * m_guideViewController; + UINavigationController * m_navigationController; + UIWindow * m_window; + MapViewController * m_mapViewController; SettingsManager * m_settingsManager; NSInteger m_standbyCounter; } -@property (nonatomic, retain) IBOutlet UIWindow * window; -@property (nonatomic, retain) IBOutlet MapViewController * mapViewController; -@property (nonatomic, retain, readonly) GuideViewController * guideViewController; -@property (nonatomic, retain, readonly) SettingsManager * settingsManager; +@property (nonatomic, retain) IBOutlet UINavigationController * m_navigationController; +@property (nonatomic, retain) IBOutlet UIWindow * m_window; +@property (nonatomic, retain) IBOutlet MapViewController * m_mapViewController; + (MapsAppDelegate *) theApp; -- (GuideViewController *)guideViewController; - (SettingsManager *)settingsManager; -- (void)onSloynikEngineInitialized:(void *)pEngine; - (void)disableStandby; - (void)enableStandby; diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index c32d364adf..b40815f2e0 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -1,70 +1,37 @@ #import "MapsAppDelegate.h" #import "MapViewController.h" -#import "GuideViewController.h" #import "SettingsManager.h" -#import "../../Sloynik/Shared/global.hpp" @implementation MapsAppDelegate -@synthesize window; -@synthesize mapViewController; +@synthesize m_navigationController; +@synthesize m_window; +@synthesize m_mapViewController; + (MapsAppDelegate *) theApp { return [[UIApplication sharedApplication] delegate]; } -// here we're - (void) applicationWillTerminate: (UIApplication *) application { - [mapViewController OnTerminate]; + [m_mapViewController OnTerminate]; } - (void) applicationDidEnterBackground: (UIApplication *) application { - [mapViewController OnEnterBackground]; + [m_mapViewController OnEnterBackground]; } - (void) applicationWillEnterForeground: (UIApplication *) application { - [mapViewController OnEnterForeground]; -} - -- (void) onSloynikEngineInitialized: (void *) pEngine -{ - SetSloynikEngine(static_cast(pEngine)); - if (m_guideViewController) - [m_guideViewController OnSloynikEngineInitialized]; + [m_mapViewController OnEnterForeground]; } - (void) applicationDidFinishLaunching: (UIApplication *) application { - // Initialize Sloynik engine. - // It takes long for the first time, so we do it while startup image is visible. - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - sl::SloynikEngine * pEngine = CreateSloynikEngine(); - dispatch_async(dispatch_get_main_queue(), ^{ - [[MapsAppDelegate theApp] onSloynikEngineInitialized:pEngine]; - }); - }); - - - // Add the tab bar controller's current view as a subview of the window - [window addSubview:mapViewController.view]; - [window makeKeyAndVisible]; -} - -- (GuideViewController *)guideViewController -{ - if (!m_guideViewController) - { - m_guideViewController = [GuideViewController alloc]; - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) - m_guideViewController = [m_guideViewController initWithNibName:@"GuideView-iPad" bundle:nil]; - else - m_guideViewController = [m_guideViewController initWithNibName:@"GuideView" bundle:nil]; - } - return m_guideViewController; + [m_window addSubview:m_mapViewController.view]; + [m_window makeKeyAndVisible]; } - (SettingsManager *)settingsManager @@ -76,10 +43,9 @@ - (void) dealloc { - [m_guideViewController release]; [m_settingsManager release]; - mapViewController = nil; - window = nil; + m_mapViewController = nil; + m_window = nil; [super dealloc]; } @@ -97,4 +63,3 @@ } @end - diff --git a/iphone/Maps/Classes/SearchVC.h b/iphone/Maps/Classes/SearchVC.h new file mode 100644 index 0000000000..ccabe67566 --- /dev/null +++ b/iphone/Maps/Classes/SearchVC.h @@ -0,0 +1,22 @@ +#import + +#include "../../map/framework.hpp" + +#include "../../std/vector.hpp" +#include "../../std/function.hpp" +#include "../../std/string.hpp" + +namespace search { class Result; } + +typedef function SearchF; +typedef function ShowRectF; + +@interface SearchVC : UIViewController + +{ + vector m_results; +} + +- (id)initWithSearchFunc:(SearchF)s andShowRectFunc:(ShowRectF)r; + +@end diff --git a/iphone/Maps/Classes/SearchVC.mm b/iphone/Maps/Classes/SearchVC.mm new file mode 100644 index 0000000000..3ce4773e32 --- /dev/null +++ b/iphone/Maps/Classes/SearchVC.mm @@ -0,0 +1,166 @@ +#import "SearchVC.h" + +#include "../../map/framework.hpp" +#include "../../search/result.hpp" + +SearchVC * g_searchVC = nil; +SearchF g_searchF; +ShowRectF g_showRectF; +volatile int g_queryId = 0; + +@interface Wrapper : NSObject +{ // HACK: ownership is taken by the "get" method caller + search::Result * m_result; +} +- (id)initWithResult:(search::Result const &) res; +- (search::Result *)get; +@end + +@implementation Wrapper + +- (id)initWithResult:(search::Result const &) res +{ + if ((self = [super init])) + m_result = new search::Result(res); + return self; +} + +- (void)dealloc +{ + delete m_result; + [super dealloc]; +} + +- (search::Result const *)get +{ + return m_result; +} +@end + +static void OnSearchResultCallback(search::Result const & res, int queryId) +{ + if (g_searchVC && queryId == g_queryId) + { + Wrapper * w = [[Wrapper alloc] initWithResult:res]; + [g_searchVC performSelectorOnMainThread:@selector(addResult:) + withObject:w + waitUntilDone:NO]; + [w release]; + } +} + +@implementation SearchVC + +- (id)initWithSearchFunc:(SearchF)s andShowRectFunc:(ShowRectF)r +{ + if ((self = [super initWithNibName:nil bundle:nil])) + { + g_searchF = s; + g_showRectF = r; + } + return self; +} + +- (void)clearResults +{ + m_results.clear(); +} + +- (void)dealloc +{ + g_searchVC = nil; + [self clearResults]; + [super dealloc]; +} + +- (void)loadView +{ + UITableView * tableView = [[[UITableView alloc] init] autorelease]; + tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + tableView.delegate = self; + tableView.dataSource = self; + self.view = tableView; + self.title = @"Search"; + + UISearchBar * searchBar = [[[UISearchBar alloc] init] autorelease]; + searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.navigationItem.titleView = searchBar; + [searchBar sizeToFit]; + searchBar.delegate = self; +} + +- (void)viewDidLoad +{ + g_searchVC = self; +} + +- (void)viewDidUnload +{ + g_searchVC = nil; +} + +- (void)searchBar:(UISearchBar *)sender textDidChange:(NSString *)searchText +{ + [self clearResults]; + [(UITableView *)self.view reloadData]; + ++g_queryId; + + if ([searchText length] > 0) + { + g_searchF([[searchText precomposedStringWithCompatibilityMapping] UTF8String], + bind(&OnSearchResultCallback, _1, g_queryId)); + } +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return m_results.size(); +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"MyTableViewCell"]; + if (!cell) + cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyTableViewCell"] + autorelease]; + + if (indexPath.row < m_results.size()) + { + cell.textLabel.text = [NSString stringWithUTF8String:m_results[indexPath.row].GetString()]; + } + else + cell.textLabel.text = @""; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row < m_results.size()) + { + if (m_results[indexPath.row].GetResultType() == search::Result::RESULT_FEATURE) + { + g_showRectF(m_results[indexPath.row].GetFeatureRect()); + [self.navigationController popViewControllerAnimated:YES]; + } + } +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; // All orientations are supported. +} + +- (void)addResult:(id)result +{ + m_results.push_back(*[result get]); + [(UITableView *)self.view reloadData]; +} + +@end diff --git a/iphone/Maps/GuideView-iPad.xib b/iphone/Maps/GuideView-iPad.xib deleted file mode 100644 index b4a7f90ac6..0000000000 --- a/iphone/Maps/GuideView-iPad.xib +++ /dev/null @@ -1,391 +0,0 @@ - - - - 1056 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - YES - IBProxyObject - IBUIBarButtonItem - IBUIToolbar - IBUISearchBar - IBUISegmentedControl - IBUITableView - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 274 - - YES - - - 274 - {{0, 44}, {768, 916}} - - - - - 3 - MQA - - YES - IBIPadFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - 266 - - YES - - - 292 - {{7, 8}, {207, 30}} - - - NO - IBIPadFramework - 2 - 2 - 1 - - YES - Map - Guide - - - YES - - - - - YES - - - - - YES - {0, 0} - {0, 0} - - - YES - - - - - - {{0, 960}, {768, 44}} - - - - NO - NO - IBIPadFramework - - YES - - IBIPadFramework - - - - - IBIPadFramework - - 5 - - - - - - 290 - {768, 44} - - - - 3 - IBIPadFramework - - IBCocoaTouchFramework - - - - {{0, 20}, {768, 1004}} - - - - - 3 - MQA - - 2 - - - - 2 - - IBIPadFramework - - - - - YES - - - searchBar - - - - 10 - - - - resultsView - - - - 12 - - - - OnMapClicked: - - - 13 - - 13 - - - - view - - - - 14 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 3 - - - YES - - - - - - - 4 - - - - - 6 - - - YES - - - - - - 8 - - - - - 9 - - - - - 11 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 11.IBPluginDependency - 3.IBPluginDependency - 4.IBPluginDependency - 8.IBPluginDependency - 8.IUISegmentedControlInspectorSelectedSegmentMetadataKey - 9.IBPluginDependency - - - YES - GuideViewController - UIResponder - {{514, 109}, {768, 1024}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 14 - - - - YES - - GuideViewController - SearchVC - - OnMapClicked: - id - - - OnMapClicked: - - OnMapClicked: - id - - - - IBProjectSource - ./Classes/GuideViewController.h - - - - SearchVC - UIViewController - - YES - - YES - resultsView - searchBar - - - YES - UITableView - UISearchBar - - - - YES - - YES - resultsView - searchBar - - - YES - - resultsView - UITableView - - - searchBar - UISearchBar - - - - - IBProjectSource - ./Classes/SearchVC.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 301 - - diff --git a/iphone/Maps/MainWindow.xib b/iphone/Maps/MainWindow.xib index d9137fd477..0652d793aa 100644 --- a/iphone/Maps/MainWindow.xib +++ b/iphone/Maps/MainWindow.xib @@ -1,39 +1,31 @@ - + 1024 - 10J869 - 1306 - 1038.35 - 461.00 + 11A511 + 1617 + 1138 + 566.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 + 534 - - YES + IBProxyObject - IBUIBarButtonItem + IBUINavigationController IBUIViewController IBUICustomObject - IBUIToolbar + IBUIButton IBUIWindow - IBUISegmentedControl + IBUINavigationBar + IBUINavigationItem IBUIView - - - YES + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES + + + IBFilesOwner IBCocoaTouchFramework @@ -45,205 +37,258 @@ IBCocoaTouchFramework - - - 1316 - - {320, 480} - - - 1 - MSAxIDEAA + + NO + Map + + 1 + 1 - NO - NO - + YES IBCocoaTouchFramework - YES - YES - - - - - 274 - - YES - - - 266 - - YES - - - 292 - {{90, 8}, {140, 30}} - + NO + + + 256 + {{0, -74}, {0, 74}} + _NS:425 + + 3 + MQA + + NO + YES + NO + YES + IBCocoaTouchFramework + + + + NO + + + 274 + + + + 268 + {{10, 435}, {40, 40}} + + + + _NS:222 NO + NO IBCocoaTouchFramework - 2 - 2 - 0 - - YES - Map - Guide - - - YES - - + 0 + 0 + + Helvetica-Bold + 15 + 16 - - YES - - + 1 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - YES - {0, 0} - {0, 0} + + 3 + MC41AA - - YES - - + + NSImage + location-search.png - - - {{0, 416}, {320, 44}} - - - NO - NO - IBCocoaTouchFramework - - YES - - + NSImage location.png - IBCocoaTouchFramework - 44 - 1 - - - - IBCocoaTouchFramework - - 5 - + + + 268 + {{60, 435}, {40, 40}} + + + + _NS:222 + NO + NO IBCocoaTouchFramework - 1 - - + 0 + 0 + + 1 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + search.png + - + + + 268 + {{110, 435}, {40, 40}} + + + + _NS:222 + NO + NO IBCocoaTouchFramework - - 5 - - - + 0 + 0 + + 1 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + NSImage settings.png - IBCocoaTouchFramework - 44 - 1 - + + + {320, 480} + + + + + 3 + MQA + + 2 + NO + YES + IBCocoaTouchFramework - - {{0, 20}, {320, 460}} - - - - 3 - MQA - - 2 + + + Map + IBCocoaTouchFramework + + + + + 1 + 1 + IBCocoaTouchFramework + NO - NO - IBCocoaTouchFramework - - - - - 1 - 1 + + YES + + + + 1280 + + {320, 480} + + + + + 1 + MSAxIDEAA + NO IBCocoaTouchFramework - NO + YES + YES - + - - YES + - delegate - - + m_navigationController + + - 99 + 190 - window + m_window - 166 + 191 - mapViewController + m_mapViewController - 167 + 192 - - OnMyPositionClicked: - - + + rootViewController + + + + 195 + + + + delegate + + - 168 + 196 - OnSettingsClicked: - + OnMyPositionClicked: + + 1 - 170 + 205 - OnGuideClicked: - + OnSettingsClicked: + - 13 + 1 - 176 + 207 m_myPositionButton - + - 177 + 209 - + + + OnSearchClicked: + + + 1 + + 211 + + - - YES + 0 @@ -253,9 +298,7 @@ 2 - - YES - + @@ -274,187 +317,197 @@ + + 181 + + + + + + + + + 182 + + + 126 - - YES + + - - + + Map View Controller + + 185 + + + + 161 - - YES - - + + + + + - 162 - - - YES - - - - - - + 200 + - 165 - - - - - 163 - - - - - 175 - - - YES - - - - - - 174 - - - - - 164 - - + 201 + + - 172 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 126.CustomClassName - 126.IBEditorWindowLastContentRect - 161.CustomClassName - 161.IBPluginDependency - 162.IBPluginDependency - 163.IBPluginDependency - 164.IBPluginDependency - 165.IBPluginDependency - 172.IBPluginDependency - 174.IBPluginDependency - 174.IUISegmentedControlInspectorSelectedSegmentMetadataKey - 2.IBAttributePlaceholdersKey - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - UIResponder - MapViewController - {{13, 167}, {320, 480}} - EAGLView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - + 202 + + - {{352, 173}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MapsAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + + UIApplication + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + EAGLView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + MapsAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + - 177 + 212 - - YES + + + EAGLView + UIView + + IBProjectSource + ./Classes/EAGLView.h + + FirstResponder - - YES - - YES - OnGuideClicked: - OnMyPositionClicked: - OnSettingsClicked: + + id + id + id + + + + OnGuideClicked: + id - - YES - id - id - id + + OnMyPositionClicked: + id + + OnSettingsClicked: + id + + + + IBUserSource + - - YES - - YES - OnGuideClicked: - OnMyPositionClicked: - OnSettingsClicked: + + + MapViewController + UIViewController + + id + id + id + + + + OnMyPositionClicked: + id - - YES - - OnGuideClicked: - id - - - OnMyPositionClicked: - id - - - OnSettingsClicked: - id - + + OnSearchClicked: + id + + + OnSettingsClicked: + id + + + + m_myPositionButton + UIButton + + + m_myPositionButton + + m_myPositionButton + UIButton - IBUserSource - + IBProjectSource + ./Classes/MapViewController.h - + + MapsAppDelegate + NSObject + + MapViewController + UINavigationController + UIWindow + + + + m_mapViewController + MapViewController + + + m_navigationController + UINavigationController + + + m_window + UIWindow + + + + IBProjectSource + ./Classes/MapsAppDelegate.h + + + 0 IBCocoaTouchFramework @@ -466,25 +519,14 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - YES 3 - - YES - - YES - location.png - settings.png - - - YES - {16, 16} - {22, 22} - - - 301 + + {16, 16} + {16, 16} + {24, 24} + {24, 24} + + 534 diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index e5b42ccbe3..eeb2ce4bf5 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -17,17 +17,10 @@ 46F26CD810F623BA00ECCA39 /* EAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46F26CD710F623BA00ECCA39 /* EAGLView.mm */; }; 46F26D1F10F626CB00ECCA39 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46F26D1E10F626CB00ECCA39 /* QuartzCore.framework */; }; 4938BB1D1343652600E0815A /* dictionary.slf in Resources */ = {isa = PBXBuildFile; fileRef = 4938BB1C1343652600E0815A /* dictionary.slf */; }; - 4938BB3B1343716500E0815A /* ArticleVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4938BB361343716500E0815A /* ArticleVC.mm */; }; - 4938BB3C1343716500E0815A /* PerfCount.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4938BB381343716500E0815A /* PerfCount.mm */; }; - 4938BB3D1343716500E0815A /* SearchVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4938BB3A1343716500E0815A /* SearchVC.mm */; }; - 4938BB401343717A00E0815A /* global.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4938BB3F1343717A00E0815A /* global.mm */; }; 4945D21C1334187D0082387C /* settings.png in Resources */ = {isa = PBXBuildFile; fileRef = 4945D21A1334187D0082387C /* settings.png */; }; 4945D21D1334187D0082387C /* settings@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4945D21B1334187D0082387C /* settings@2x.png */; }; - 4983AE11134631F600C82DB7 /* GuideView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4983AE10134631F600C82DB7 /* GuideView-iPad.xib */; }; 49B3FB8D132FA43E00057053 /* location.png in Resources */ = {isa = PBXBuildFile; fileRef = 49B3FB8B132FA43E00057053 /* location.png */; }; 49B3FB8E132FA43E00057053 /* location@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 49B3FB8C132FA43E00057053 /* location@2x.png */; }; - 49DD2B51132FA8880031D82E /* GuideViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49DD2B4F132FA8880031D82E /* GuideViewController.mm */; }; - 49DD2B52132FA8880031D82E /* GuideView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49DD2B50132FA8880031D82E /* GuideView.xib */; }; 49DE1CA413437D7A00A93417 /* libbzip2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 49DE1CA213437D7A00A93417 /* libbzip2.a */; }; 49DE1CA513437D7A00A93417 /* libwords.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 49DE1CA313437D7A00A93417 /* libwords.a */; }; EE026F0611D6AC0D00645242 /* classificator.txt in Resources */ = {isa = PBXBuildFile; fileRef = EE026F0511D6AC0D00645242 /* classificator.txt */; }; @@ -67,6 +60,7 @@ FA0660001286167A00FEA989 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FA065FFE1286167A00FEA989 /* Default.png */; }; FA0660031286168700FEA989 /* Default-Portrait.png in Resources */ = {isa = PBXBuildFile; fileRef = FA0660011286168700FEA989 /* Default-Portrait.png */; }; FA0660041286168700FEA989 /* Default-Landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = FA0660021286168700FEA989 /* Default-Landscape.png */; }; + FA09E01113F71F6C007E69CA /* SearchVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA09E01013F71F6C007E69CA /* SearchVC.mm */; }; FA0E845E138554CF008CEABB /* languages.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA0E845D138554CF008CEABB /* languages.txt */; }; FA2EF9C713630C3B00E3E484 /* libplatform.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA2EF9C613630C3B00E3E484 /* libplatform.a */; }; FA34BECA1338D72F00FFB2A7 /* CustomAlertView.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA34BEC81338D72F00FFB2A7 /* CustomAlertView.mm */; }; @@ -85,6 +79,8 @@ FA8F8938132D5DB00048E3FE /* libtomcrypt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8F8937132D5DB00048E3FE /* libtomcrypt.a */; }; FAAFD697139D9BE2000AE70C /* categories.txt in Resources */ = {isa = PBXBuildFile; fileRef = FAAFD696139D9BE2000AE70C /* categories.txt */; }; FAAFD699139D9C6B000AE70C /* libsearch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAAFD698139D9C6B000AE70C /* libsearch.a */; }; + FAD4906C13EFF61F005E7D43 /* search.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD4906A13EFF61F005E7D43 /* search.png */; }; + FAD4906D13EFF61F005E7D43 /* search@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD4906B13EFF61F005E7D43 /* search@2x.png */; }; FAF37EFF126DCE6F005EA154 /* IPhoneDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAF37EFA126DCE6F005EA154 /* IPhoneDownload.mm */; }; FAF37F00126DCE6F005EA154 /* IPhoneDownloadManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAF37EFB126DCE6F005EA154 /* IPhoneDownloadManager.mm */; }; FAF37F01126DCE6F005EA154 /* IPhonePlatform.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAF37EFD126DCE6F005EA154 /* IPhonePlatform.mm */; }; @@ -109,22 +105,10 @@ 46F26D1E10F626CB00ECCA39 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 46F8A2EB10EB63040045521A /* MapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = MapViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 4938BB1C1343652600E0815A /* dictionary.slf */ = {isa = PBXFileReference; lastKnownFileType = file; name = dictionary.slf; path = ../../data/dictionary.slf; sourceTree = ""; }; - 4938BB351343716500E0815A /* ArticleVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArticleVC.h; path = ../Sloynik/Shared/ArticleVC.h; sourceTree = ""; }; - 4938BB361343716500E0815A /* ArticleVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ArticleVC.mm; path = ../Sloynik/Shared/ArticleVC.mm; sourceTree = ""; }; - 4938BB371343716500E0815A /* PerfCount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfCount.h; path = ../Sloynik/Shared/PerfCount.h; sourceTree = ""; }; - 4938BB381343716500E0815A /* PerfCount.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PerfCount.mm; path = ../Sloynik/Shared/PerfCount.mm; sourceTree = ""; }; - 4938BB391343716500E0815A /* SearchVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SearchVC.h; path = ../Sloynik/Shared/SearchVC.h; sourceTree = ""; }; - 4938BB3A1343716500E0815A /* SearchVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SearchVC.mm; path = ../Sloynik/Shared/SearchVC.mm; sourceTree = ""; }; - 4938BB3E1343717A00E0815A /* global.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = global.hpp; path = ../Sloynik/Shared/global.hpp; sourceTree = ""; }; - 4938BB3F1343717A00E0815A /* global.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = global.mm; path = ../Sloynik/Shared/global.mm; sourceTree = ""; }; 4945D21A1334187D0082387C /* settings.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = settings.png; sourceTree = ""; }; 4945D21B1334187D0082387C /* settings@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "settings@2x.png"; sourceTree = ""; }; - 4983AE10134631F600C82DB7 /* GuideView-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "GuideView-iPad.xib"; sourceTree = ""; }; 49B3FB8B132FA43E00057053 /* location.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = location.png; sourceTree = ""; }; 49B3FB8C132FA43E00057053 /* location@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "location@2x.png"; sourceTree = ""; }; - 49DD2B4E132FA8880031D82E /* GuideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuideViewController.h; sourceTree = ""; }; - 49DD2B4F132FA8880031D82E /* GuideViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GuideViewController.mm; sourceTree = ""; }; - 49DD2B50132FA8880031D82E /* GuideView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = GuideView.xib; path = Classes/GuideView.xib; sourceTree = ""; }; 49DE1CA213437D7A00A93417 /* libbzip2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libbzip2.a; sourceTree = SOURCE_ROOT; }; 49DE1CA313437D7A00A93417 /* libwords.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwords.a; sourceTree = SOURCE_ROOT; }; 8D1107310486CEB800E47090 /* MapsWithMe-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapsWithMe-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; @@ -168,6 +152,8 @@ FA065FFE1286167A00FEA989 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; }; FA0660011286168700FEA989 /* Default-Portrait.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait.png"; sourceTree = SOURCE_ROOT; }; FA0660021286168700FEA989 /* Default-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape.png"; sourceTree = SOURCE_ROOT; }; + FA09E00F13F71F6C007E69CA /* SearchVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchVC.h; sourceTree = ""; }; + FA09E01013F71F6C007E69CA /* SearchVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SearchVC.mm; sourceTree = ""; }; FA0E845D138554CF008CEABB /* languages.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = languages.txt; path = ../../data/languages.txt; sourceTree = SOURCE_ROOT; }; FA2EF9C613630C3B00E3E484 /* libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libplatform.a; sourceTree = SOURCE_ROOT; }; FA34BEC81338D72F00FFB2A7 /* CustomAlertView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CustomAlertView.mm; sourceTree = ""; }; @@ -191,6 +177,8 @@ FAAE8D5D1338FF8B003ECAD5 /* GetActiveConnectionType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetActiveConnectionType.h; sourceTree = ""; }; FAAFD696139D9BE2000AE70C /* categories.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = categories.txt; path = ../../data/categories.txt; sourceTree = SOURCE_ROOT; }; FAAFD698139D9C6B000AE70C /* libsearch.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsearch.a; sourceTree = SOURCE_ROOT; }; + FAD4906A13EFF61F005E7D43 /* search.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search.png; sourceTree = ""; }; + FAD4906B13EFF61F005E7D43 /* search@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search@2x.png"; sourceTree = ""; }; FAF37EFA126DCE6F005EA154 /* IPhoneDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = IPhoneDownload.mm; path = Platform/IPhoneDownload.mm; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; FAF37EFB126DCE6F005EA154 /* IPhoneDownloadManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = IPhoneDownloadManager.mm; path = Platform/IPhoneDownloadManager.mm; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; FAF37EFD126DCE6F005EA154 /* IPhonePlatform.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = IPhonePlatform.mm; path = Platform/IPhonePlatform.mm; sourceTree = SOURCE_ROOT; }; @@ -238,6 +226,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + FA09E00F13F71F6C007E69CA /* SearchVC.h */, + FA09E01013F71F6C007E69CA /* SearchVC.mm */, EE7F297C1219ECA300EB67A9 /* RenderBuffer.hpp */, EE7F297D1219ECA300EB67A9 /* RenderBuffer.mm */, EE16192B126E374500622BD0 /* RenderContext.hpp */, @@ -250,8 +240,6 @@ 1D3623250D0F684500981E51 /* MapsAppDelegate.mm */, 46F8A2EB10EB63040045521A /* MapViewController.h */, EED10A4411F78D120095FAD4 /* MapViewController.mm */, - 49DD2B4E132FA8880031D82E /* GuideViewController.h */, - 49DD2B4F132FA8880031D82E /* GuideViewController.mm */, ); path = Classes; sourceTree = ""; @@ -267,7 +255,6 @@ 29B97314FDCFA39411CA2CEA /* Maps */ = { isa = PBXGroup; children = ( - 4938BB2613436F6300E0815A /* Sloynik Sources */, FA34BEC71338D6DB00FFB2A7 /* Common */, FA6E1F1B124E6B2800F59149 /* Platform */, FA4135DF120A25B90062D5B4 /* Settings */, @@ -295,6 +282,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + FAD4906A13EFF61F005E7D43 /* search.png */, + FAD4906B13EFF61F005E7D43 /* search@2x.png */, EEAF65E3134BCBD500A81C82 /* location-search.png */, EEAF65E4134BCBD500A81C82 /* location-search@2x.png */, 4945D21A1334187D0082387C /* settings.png */, @@ -310,7 +299,6 @@ FA5005601287BFCE002961F0 /* Icon.png */, FA5005611287BFCE002961F0 /* Icon@2x.png */, 28AD73870D9D96C1002E5188 /* MainWindow.xib */, - 49DD2B50132FA8880031D82E /* GuideView.xib */, 8D1107310486CEB800E47090 /* MapsWithMe-Info.plist */, ); name = Resources; @@ -330,37 +318,6 @@ name = Frameworks; sourceTree = ""; }; - 4938BB2613436F6300E0815A /* Sloynik Sources */ = { - isa = PBXGroup; - children = ( - 4938BB581343731D00E0815A /* Resources */, - 4938BB341343715200E0815A /* Sloynik */, - ); - name = "Sloynik Sources"; - sourceTree = ""; - }; - 4938BB341343715200E0815A /* Sloynik */ = { - isa = PBXGroup; - children = ( - 4938BB3E1343717A00E0815A /* global.hpp */, - 4938BB3F1343717A00E0815A /* global.mm */, - 4938BB351343716500E0815A /* ArticleVC.h */, - 4938BB361343716500E0815A /* ArticleVC.mm */, - 4938BB371343716500E0815A /* PerfCount.h */, - 4938BB381343716500E0815A /* PerfCount.mm */, - 4938BB391343716500E0815A /* SearchVC.h */, - 4938BB3A1343716500E0815A /* SearchVC.mm */, - ); - name = Sloynik; - sourceTree = ""; - }; - 4938BB581343731D00E0815A /* Resources */ = { - isa = PBXGroup; - children = ( - ); - name = Resources; - sourceTree = ""; - }; FA065FC61286143F00FEA989 /* External Resources */ = { isa = PBXGroup; children = ( @@ -397,7 +354,6 @@ FA0660011286168700FEA989 /* Default-Portrait.png */, FA0660021286168700FEA989 /* Default-Landscape.png */, FA065FEC128614C400FEA989 /* MainWindow-iPad.xib */, - 4983AE10134631F600C82DB7 /* GuideView-iPad.xib */, ); name = "Resources-iPad"; sourceTree = ""; @@ -540,12 +496,10 @@ EEFE7C1512F8C9E1006AF8C3 /* fonts_whitelist.txt in Resources */, 49B3FB8D132FA43E00057053 /* location.png in Resources */, 49B3FB8E132FA43E00057053 /* location@2x.png in Resources */, - 49DD2B52132FA8880031D82E /* GuideView.xib in Resources */, 4945D21C1334187D0082387C /* settings.png in Resources */, 4945D21D1334187D0082387C /* settings@2x.png in Resources */, FAFCB63813367AD1001A5C59 /* about-travelguide-iphone.html in Resources */, 4938BB1D1343652600E0815A /* dictionary.slf in Resources */, - 4983AE11134631F600C82DB7 /* GuideView-iPad.xib in Resources */, FAFF422A1347F101009BBB14 /* World.mwm in Resources */, EEAF65E5134BCBD500A81C82 /* location-search.png in Resources */, EEAF65E6134BCBD500A81C82 /* location-search@2x.png in Resources */, @@ -557,6 +511,8 @@ EE164811135CEE4A003B8A3E /* 06_code2000.ttf in Resources */, FA0E845E138554CF008CEABB /* languages.txt in Resources */, FAAFD697139D9BE2000AE70C /* categories.txt in Resources */, + FAD4906C13EFF61F005E7D43 /* search.png in Resources */, + FAD4906D13EFF61F005E7D43 /* search@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -579,13 +535,9 @@ FAF37EFF126DCE6F005EA154 /* IPhoneDownload.mm in Sources */, FAF37F00126DCE6F005EA154 /* IPhoneDownloadManager.mm in Sources */, FAF37F01126DCE6F005EA154 /* IPhonePlatform.mm in Sources */, - 49DD2B51132FA8880031D82E /* GuideViewController.mm in Sources */, FAFCB63613366E78001A5C59 /* WebViewController.mm in Sources */, FA34BECA1338D72F00FFB2A7 /* CustomAlertView.mm in Sources */, - 4938BB3B1343716500E0815A /* ArticleVC.mm in Sources */, - 4938BB3C1343716500E0815A /* PerfCount.mm in Sources */, - 4938BB3D1343716500E0815A /* SearchVC.mm in Sources */, - 4938BB401343717A00E0815A /* global.mm in Sources */, + FA09E01113F71F6C007E69CA /* SearchVC.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iphone/Maps/MapsWithMe-Info.plist b/iphone/Maps/MapsWithMe-Info.plist index 1957bfa0ab..ec32acf5e6 100644 --- a/iphone/Maps/MapsWithMe-Info.plist +++ b/iphone/Maps/MapsWithMe-Info.plist @@ -56,5 +56,7 @@ UTImportedTypeDeclarations + UIStatusBarHidden + diff --git a/iphone/Maps/Resources-iPad/MainWindow-iPad.xib b/iphone/Maps/Resources-iPad/MainWindow-iPad.xib index 6058ea8545..bc32677df3 100644 --- a/iphone/Maps/Resources-iPad/MainWindow-iPad.xib +++ b/iphone/Maps/Resources-iPad/MainWindow-iPad.xib @@ -1,39 +1,31 @@ - + 1024 - 10J869 - 1306 - 1038.35 - 461.00 + 11A511 + 1617 + 1138 + 566.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 + 534 - - YES + IBProxyObject - IBUIBarButtonItem + IBUINavigationController IBUIViewController IBUICustomObject - IBUIToolbar + IBUIButton IBUIWindow - IBUISegmentedControl + IBUINavigationBar + IBUINavigationItem IBUIView - - - YES + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES + + + IBFilesOwner IBIPadFramework @@ -47,16 +39,15 @@ - 1316 + 1280 {768, 1024} - + 1 MSAxIDEAA - NO NO 2 @@ -65,184 +56,233 @@ YES YES - - - - 274 - - YES - - - 266 - - YES - - - 292 - {{7, 8}, {207, 30}} - + + + 2 + + + 1 + 1 + + IBIPadFramework + NO + + + 256 + {0, 0} + _NS:428 + YES + YES + IBIPadFramework + + + + + + 274 + + + + 268 + {{20, 899}, {44, 44}} + + + _NS:237 NO IBIPadFramework - 2 - 2 - 0 - - YES - Map - Guide + 0 + 0 + + Helvetica-Bold + 15 + 16 + + 1 + + 3 + MQA - - YES - - + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - YES - - + + 3 + MC41AA - - YES - {0, 0} - {0, 0} + + NSImage + location-search.png - - YES - - + + NSImage + location.png - - {{0, 980}, {768, 44}} - - - - NO - NO - IBIPadFramework - - YES - - IBIPadFramework - - - - + + + 268 + {{85, 899}, {44, 44}} + + + + _NS:237 + NO IBIPadFramework - - 5 - - - + 0 + 0 + + 1 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + NSImage - location.png + search.png - IBIPadFramework - 56 - 1 - - - + + + 268 + {{150, 899}, {44, 44}} + + + + _NS:237 + NO + IBIPadFramework + 0 + 0 + + 1 + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + NSImage settings.png - IBIPadFramework - 56 - 1 - + + + {{0, 64}, {768, 960}} + + + + + 3 + MQA + + 2 + NO + YES + IBIPadFramework - - {768, 1024} - - - - - 3 - MQA - - 2 + + + + Map + IBIPadFramework + + + 1 + 1 + + IBIPadFramework + NO - NO - IBIPadFramework - - - - 1 - 1 - - IBIPadFramework - NO + - + - - YES + - delegate - - + rootViewController + + - 99 + 184 - window + m_mapViewController - + - 166 + 186 - mapViewController + m_navigationController - + + + 187 + + + + m_window + + - 167 + 188 + + + + delegate + + + + 189 - OnMyPositionClicked: - + OnSettingsClicked: + + 1 - 168 + 193 - OnSettingsClicked: - + OnSearchClicked: + + 1 - 170 + 194 - OnGuideClicked: - + OnMyPositionClicked: + - 13 + 1 - 177 + 195 m_myPositionButton - + - 178 + 196 - + - - YES + 0 @@ -252,9 +292,7 @@ 2 - - YES - + @@ -273,134 +311,97 @@ + + 179 + + + + + + + + + 180 + + + 126 - - YES + - - + + + + Map View Controller 161 - - YES - - + + + + + - 162 - - - YES - - - - - - - - - 165 - - - - - 163 - - + 183 + + - 175 - - - YES - - - + 190 + + - 174 - - + 191 + + - 176 - - + 192 + + - + - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 126.CustomClassName - 126.IBEditorWindowLastContentRect - 161.CustomClassName - 161.IBPluginDependency - 162.IBPluginDependency - 163.IBPluginDependency - 165.IBPluginDependency - 174.IBPluginDependency - 176.IBPluginDependency - 2.IBAttributePlaceholdersKey - 2.IBEditorWindowLastContentRect - 2.IBLastUsedUIStatusBarStylesToTargetRuntimesMap - 2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - UIResponder - MapViewController - {{13, 70}, {783, 686}} - EAGLView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - - {{204, 101}, {320, 480}} - - IBCocoaTouchFramework - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MapsAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + UIApplication + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + EAGLView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + IBCocoaTouchFramework + - - - YES - - - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MapsAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + - 178 + 196 - - YES + EAGLView UIView @@ -411,45 +412,25 @@ FirstResponder - - YES - - YES - OnMyPositionClicked: - OnSettingsClicked: - OnShowAllClicked: - - - YES - id - id - id + + id + id + id + + + + OnMyPositionClicked: + id - - - YES - - YES - OnMyPositionClicked: - OnSettingsClicked: - OnShowAllClicked: + + OnSettingsClicked: + id - - YES - - OnMyPositionClicked: - id - - - OnSettingsClicked: - id - - - OnShowAllClicked: - id - + + OnShowAllClicked: + id - + IBUserSource @@ -458,54 +439,34 @@ MapViewController UIViewController - - YES - - YES - OnGuideClicked: - OnMyPositionClicked: - OnSettingsClicked: + + id + id + id + + + + OnMyPositionClicked: + id - - YES - id - id - id + + OnSearchClicked: + id - - - YES - - YES - OnGuideClicked: - OnMyPositionClicked: - OnSettingsClicked: + + OnSettingsClicked: + id - - YES - - OnGuideClicked: - id - - - OnMyPositionClicked: - id - - - OnSettingsClicked: - id - - - + m_myPositionButton - UIBarButtonItem + UIButton m_myPositionButton m_myPositionButton - UIBarButtonItem + UIButton @@ -516,44 +477,31 @@ MapsAppDelegate NSObject - - YES - - YES - mapViewController - window + + MapViewController + UINavigationController + UIWindow + + + + m_mapViewController + MapViewController - - YES - MapViewController - UIWindow + + m_navigationController + UINavigationController - - - YES - - YES - mapViewController - window + + m_window + UIWindow - - YES - - mapViewController - MapViewController - - - window - UIWindow - - - + IBProjectSource ./Classes/MapsAppDelegate.h - + 0 IBIPadFramework @@ -565,25 +513,14 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - YES 3 - - YES - - YES - location.png - settings.png - - - YES - {16, 16} - {22, 22} - - - 301 + + {16, 16} + {16, 16} + {24, 24} + {24, 24} + + 534 diff --git a/iphone/Maps/Settings/CountriesViewController.mm b/iphone/Maps/Settings/CountriesViewController.mm index d0d896085a..6ae0450c51 100644 --- a/iphone/Maps/Settings/CountriesViewController.mm +++ b/iphone/Maps/Settings/CountriesViewController.mm @@ -52,15 +52,9 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours) @implementation CountriesViewController -- (void) OnCloseButton:(id)sender -{ - [[[MapsAppDelegate theApp] settingsManager] Hide]; -} - - (void) OnAboutButton:(id)sender { // display WebView with About text - NSString * text; { ReaderPtr r = GetPlatform().GetReader("about-travelguide-iphone.html"); @@ -81,22 +75,11 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours) m_index = index; if ((self = [super initWithNibName:nil bundle:nil])) { - // Close button is displayed only on first view in hierarchy - if (index.m_group == TIndex::INVALID) - { - UIBarButtonItem * closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style: UIBarButtonItemStyleDone - target:self action:@selector(OnCloseButton:)]; - self.navigationItem.leftBarButtonItem = closeButton; - [closeButton release]; - } - self.navigationItem.title = header; - UIBarButtonItem * aboutButton = [[UIBarButtonItem alloc] initWithTitle:@"About" style: UIBarButtonItemStylePlain - target:self action:@selector(OnAboutButton:)]; + UIBarButtonItem * aboutButton = [[[UIBarButtonItem alloc] initWithTitle:@"About" style: UIBarButtonItemStylePlain + target:self action:@selector(OnAboutButton:)] autorelease]; self.navigationItem.rightBarButtonItem = aboutButton; - [aboutButton release]; - } return self; } @@ -118,24 +101,14 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours) return YES; } -//- (NSInteger) numberOfSectionsInTableView: (UITableView *)tableView -//{ -// return 0; -//} -// -//- (NSString *) tableView: (UITableView *)tableView titleForHeaderInSection: (NSInteger)section -//{ -// return nil; -//} - - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { TIndex index = CalculateIndex(m_index, indexPath); if (m_storage->CountryStatus(index) == EOnDisk) { m2::RectD bounds = m_storage->CountryBounds(index); - [[MapsAppDelegate theApp].settingsManager Hide]; - [[MapsAppDelegate theApp].mapViewController ZoomToRect:bounds]; + [[[MapsAppDelegate theApp] settingsManager] Hide]; + [[MapsAppDelegate theApp].m_mapViewController ZoomToRect:bounds]; } } diff --git a/iphone/Maps/Settings/SettingsManager.h b/iphone/Maps/Settings/SettingsManager.h index e2668fa9e2..65bbeeac88 100644 --- a/iphone/Maps/Settings/SettingsManager.h +++ b/iphone/Maps/Settings/SettingsManager.h @@ -6,8 +6,6 @@ namespace storage { class Storage; } /// Responsible for all settings dialogs @interface SettingsManager : NSObject { - UINavigationController * m_navController; - UIViewController * m_prevController; storage::Storage * m_storage; } diff --git a/iphone/Maps/Settings/SettingsManager.mm b/iphone/Maps/Settings/SettingsManager.mm index 34d8f09477..b280de4846 100644 --- a/iphone/Maps/Settings/SettingsManager.mm +++ b/iphone/Maps/Settings/SettingsManager.mm @@ -1,6 +1,7 @@ #import "SettingsManager.h" #import "CountriesViewController.h" #import "MapViewController.h" +#import "MapsAppDelegate.h" #include "../../../storage/storage.hpp" @@ -11,47 +12,36 @@ using namespace storage; // Settings are always present globally @implementation SettingsManager -// Destructor - (void) dealloc { - [m_prevController release]; - m_prevController = nil; - [m_navController release]; - m_navController = nil; [super dealloc]; } /// Get right controller from the stack - (UIViewController *) ControllerByIndex:(TIndex const &)index { - NSArray * controllers = [m_navController viewControllers]; - if (index.m_region != TIndex::INVALID && [controllers count] >= 3) + NSArray * controllers = [[MapsAppDelegate theApp].m_navigationController viewControllers]; + if (index.m_region != TIndex::INVALID && [controllers count] >= 4) + return [controllers objectAtIndex:3]; + else if (index.m_country != TIndex::INVALID && [controllers count] >= 3) return [controllers objectAtIndex:2]; - else if (index.m_country != TIndex::INVALID && [controllers count] >= 2) + else if (index.m_group != TIndex::INVALID && [controllers count] >= 2) return [controllers objectAtIndex:1]; - else if (index.m_group != TIndex::INVALID && [controllers count] >= 1) - return [controllers objectAtIndex:0]; return nil; } - (void) OnCountryChange: (TIndex const &)index { - if (m_navController) - { - UIViewController * controller = [self ControllerByIndex:index]; - if (controller && [controller respondsToSelector:@selector(OnCountryChange:)]) - [(CountriesViewController *)controller OnCountryChange: index]; - } + UIViewController * controller = [self ControllerByIndex:index]; + if (controller && [controller respondsToSelector:@selector(OnCountryChange:)]) + [(CountriesViewController *)controller OnCountryChange: index]; } - (void) OnCountryDownload: (TIndex const &) index withProgress: (HttpProgressT const &) progress { - if (m_navController) - { - UIViewController * controller = [self ControllerByIndex:index]; - if (controller && [controller respondsToSelector:@selector(OnDownload:withProgress:)]) - [(CountriesViewController *)controller OnDownload: index withProgress: progress]; - } + UIViewController * controller = [self ControllerByIndex:index]; + if (controller && [controller respondsToSelector:@selector(OnDownload:withProgress:)]) + [(CountriesViewController *)controller OnDownload: index withProgress: progress]; } - (void) OnUpdateCheck: (TUpdateResult) result withText: (string const &) text @@ -62,16 +52,9 @@ using namespace storage; - (void) Show:(UIViewController *)prevController WithStorage:(Storage *)storage { m_storage = storage; - m_prevController = [prevController retain]; - - if (!m_navController) - { - CountriesViewController * countriesController = [[CountriesViewController alloc] - initWithStorage:*m_storage andIndex:TIndex() andHeader:@"Download"]; - m_navController = [[UINavigationController alloc] - initWithRootViewController:countriesController]; - [countriesController release]; - } + CountriesViewController * countriesController = [[[CountriesViewController alloc] + initWithStorage:*m_storage andIndex:TIndex() andHeader:@"Download"] autorelease]; + [[MapsAppDelegate theApp].m_navigationController pushViewController:countriesController animated:YES]; // Subscribe to storage callbacks. { @@ -92,40 +75,16 @@ using namespace storage; boost::bind(progressImpl, self, progressSel, _1, _2), boost::bind(updateImpl, self, updateSel, _1, _2)); } - - // Transition views. - [m_prevController presentModalViewController:m_navController animated:YES]; - // This has bugs when device orientation is changed. - // [UIView transitionFromView:m_prevController.view - // toView:m_navController.view - // duration:1 - // options:UIViewAnimationOptionTransitionCurlUp - // completion:nil]; } // Hides all opened settings windows - (void) Hide { - if (!m_prevController) - return; - m_storage->Unsubscribe(); - // Transition views. - [m_prevController dismissModalViewControllerAnimated:YES]; - // This has bugs when device orientation is changed. - // [UIView transitionFromView:m_navController.view - // toView:m_prevController.view - // duration:1 - // options:UIViewAnimationOptionTransitionCurlDown - // completion:nil]; + [[MapsAppDelegate theApp].m_navigationController popViewControllerAnimated:YES]; m_storage = nil; - [m_prevController release]; - m_prevController = nil; - [m_navController release]; - m_navController = nil; - } @end diff --git a/iphone/Maps/search.png b/iphone/Maps/search.png new file mode 100644 index 0000000000..9bcc44cc9a Binary files /dev/null and b/iphone/Maps/search.png differ diff --git a/iphone/Maps/search@2x.png b/iphone/Maps/search@2x.png new file mode 100644 index 0000000000..a783f3bc37 Binary files /dev/null and b/iphone/Maps/search@2x.png differ -- cgit v1.2.3