aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/iOSSampleApp/Shared
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 15:45:41 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 15:45:41 +0000
commit867cbd8bc29371a360194aed648c4d43307b0639 (patch)
treea8304af47996be63595ff3659546f82772230d6b /experimental/iOSSampleApp/Shared
parentdb545aec7267b10f1cb925204862f7e16753b724 (diff)
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
Diffstat (limited to 'experimental/iOSSampleApp/Shared')
-rw-r--r--experimental/iOSSampleApp/Shared/SkOptionsTableViewController.h4
-rw-r--r--experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm10
-rw-r--r--experimental/iOSSampleApp/Shared/SkUIView.h4
-rw-r--r--experimental/iOSSampleApp/Shared/SkUIView.mm2
4 files changed, 11 insertions, 9 deletions
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<SkOSMenu*>*)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<SkString> 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];
}