From 867cbd8bc29371a360194aed648c4d43307b0639 Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Thu, 20 Sep 2012 15:45:41 +0000 Subject: first cut at making iOS work Replace __arm__ with SK_CPU_ARM add support for iOS simulator and device fix const warning in iOSSampleApp update gyp files https://code.google.com/p/skia/issues/detail?id=900 tracks fixing missing arm assembly Review URL: https://codereview.appspot.com/6552045 git-svn-id: http://skia.googlecode.com/svn/trunk@5606 2bbb7eff-a529-9590-31e7-b0007b416f81 --- .../iOSSampleApp/Shared/SkOptionsTableViewController.h | 4 ++-- .../iOSSampleApp/Shared/SkOptionsTableViewController.mm | 10 ++++++---- experimental/iOSSampleApp/Shared/SkUIView.h | 4 ++-- experimental/iOSSampleApp/Shared/SkUIView.mm | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'experimental/iOSSampleApp/Shared') diff --git a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h index 2c9f391803..13d6c1b8a4 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h +++ b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h @@ -29,8 +29,8 @@ @property (nonatomic, retain) SkOptionListItem* fCurrentList; - (void)registerMenus:(const SkTDArray*)menus; -- (void)updateMenu:(const SkOSMenu*)menu; -- (void)loadMenu:(const SkOSMenu*)menu; +- (void)updateMenu:(SkOSMenu*)menu; +- (void)loadMenu:(SkOSMenu*)menu; - (UITableViewCell*)createAction:(NSString*)title; - (UITableViewCell*)createSlider:(NSString*)title min:(float)min max:(float)max default:(float)value; diff --git a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm index acf70b81cb..43839760f4 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm +++ b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm @@ -1,5 +1,6 @@ #import "SkOptionsTableViewController.h" #include "SkEvent.h" +#include "SkTArray.h" @implementation SkOptionItem @synthesize fCell, fItem; @@ -31,7 +32,7 @@ //SkUIViewOptionsDelegate - (void) view:(SkUIView*)view didAddMenu:(const SkOSMenu*)menu {} -- (void) view:(SkUIView*)view didUpdateMenu:(const SkOSMenu*)menu { +- (void) view:(SkUIView*)view didUpdateMenu:(SkOSMenu*)menu { [self updateMenu:menu]; } @@ -65,7 +66,7 @@ [self.tableView reloadData]; } -- (void)loadMenu:(const SkOSMenu*)menu { +- (void)loadMenu:(SkOSMenu*)menu { const SkOSMenu::Item* menuitems[menu->getCount()]; menu->getItems(menuitems); for (int i = 0; i < menu->getCount(); ++i) { @@ -81,8 +82,9 @@ int count = 0; SkOSMenu::FindListItemCount(*item->getEvent(), &count); - SkString options[count]; - SkOSMenu::FindListItems(*item->getEvent(), options); + SkTArray options; + options.resize_back(count); + SkOSMenu::FindListItems(*item->getEvent(), &options.front()); for (int i = 0; i < count; ++i) [List.fOptions addOption:[NSString stringWithUTF8String:options[i].c_str()]]; SkOSMenu::FindListIndex(*item->getEvent(), item->getSlotName(), &value); diff --git a/experimental/iOSSampleApp/Shared/SkUIView.h b/experimental/iOSSampleApp/Shared/SkUIView.h index c88b2fe938..a0640d4dce 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.h +++ b/experimental/iOSSampleApp/Shared/SkUIView.h @@ -20,7 +20,7 @@ class SkEvent; @optional // Called when the view needs to handle adding an SkOSMenu - (void) view:(SkUIView*)view didAddMenu:(const SkOSMenu*)menu; -- (void) view:(SkUIView*)view didUpdateMenu:(const SkOSMenu*)menu; +- (void) view:(SkUIView*)view didUpdateMenu:(SkOSMenu*)menu; @end @interface SkUIView : UIView { @@ -40,7 +40,7 @@ class SkEvent; - (void)setSkTitle:(const char*)title; - (void)onAddMenu:(const SkOSMenu*)menu; -- (void)onUpdateMenu:(const SkOSMenu*)menu; +- (void)onUpdateMenu:(SkOSMenu*)menu; - (void)postInvalWithRect:(const SkIRect*)rectOrNil; - (BOOL)onHandleEvent:(const SkEvent&)event; @end diff --git a/experimental/iOSSampleApp/Shared/SkUIView.mm b/experimental/iOSSampleApp/Shared/SkUIView.mm index 50d19541cb..835e970666 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.mm +++ b/experimental/iOSSampleApp/Shared/SkUIView.mm @@ -97,7 +97,7 @@ - (void)onAddMenu:(const SkOSMenu*)menu { [self.fOptionsDelegate view:self didAddMenu:menu]; } -- (void)onUpdateMenu:(const SkOSMenu*)menu { +- (void)onUpdateMenu:(SkOSMenu*)menu { [self.fOptionsDelegate view:self didUpdateMenu:menu]; } -- cgit v1.2.3