[Libreoffice-commits] core.git: Branch 'feature/tiledrendering' - ios/shared
Ptyl Dragon
ptyl at cloudon.com
Fri Nov 1 14:56:23 CET 2013
ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h | 1
ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m | 12 ++++++
ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m | 19 +++++++---
ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m | 7 +++
4 files changed, 34 insertions(+), 5 deletions(-)
New commits:
commit 9f1e17cf4f8130fb356de4c69634154d08ea87e7
Author: Ptyl Dragon <ptyl at cloudon.com>
Date: Fri Nov 1 15:55:44 2013 +0200
changed testing app UI to be more clear what it does
Change-Id: I5307478fc47f0810cae24c72ce509ac6a409bf1b
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h
index 8465b5d..041e198 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h
@@ -19,4 +19,5 @@ typedef void (^MLOTestingTileParameterExtractor)(CGFloat value);
-(void)extractMode:(MLOTestingTileParametersMode) mode;
-(void)setParamFrame:(CGRect) paramFrame;
-(void)addToSuperview;
+-(void)enterMode:(MLOTestingTileParametersMode)mode;
@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
index 9c0af4f..a661539 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
@@ -185,4 +185,16 @@ static const CGFloat DEFAULT_STEP_VALUE = 1;
extractor([self currentDataValue]);
}
}
+-(BOOL)isSupportingMode:(MLOTestingTileParametersMode) mode{
+ return [self getExtractor:mode]!=nil;
+}
+-(void)enterMode:(MLOTestingTileParametersMode)mode{
+ CGFloat alpha = [self isSupportingMode:mode] ? 1.0f: 0.0f;
+ self.label.alpha = alpha;
+ self.data.alpha = alpha;
+ self.dataStepper.alpha = alpha;
+ self.step.alpha =alpha;
+ self.stepStepper.alpha = alpha;
+}
+
@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
index 0c18b82..f8fcadb 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
@@ -45,11 +45,22 @@
{
CGContextRef context = UIGraphicsGetCurrentContext();
+ MLODpxPoint tilePosition =MLODpxPointByDpxes(self.tester.params.tilePosX,self.tester.params.tilePosY);
+ MLODpxSize tileSize = MLODpxSizeByDpxes(self.tester.params.tileWidth,self.tester.params.tileHeight);
+ NSInteger contextWidth = self.tester.params.contextWidth;
+ NSInteger contextHeight = self.tester.params.contextHeight;
+
+ NSLog(@"touch_lo_draw_tile(contextWidth=%d, contextHeight=%d, tilePosition=%@, tileSize=%@",
+ contextWidth,
+ contextHeight,
+ NSStringFromCGPoint(tilePosition),
+ NSStringFromCGSize(tileSize));
+
touch_lo_draw_tile(context,
- self.tester.params.contextWidth,
- self.tester.params.contextHeight,
- MLODpxPointByDpxes(self.tester.params.tilePosX,self.tester.params.tilePosY),
- MLODpxSizeByDpxes(self.tester.params.tileWidth,self.tester.params.tileHeight));
+ contextWidth,
+ contextHeight,
+ tilePosition,
+ tileSize);
MLODpxSize size = touch_lo_get_content_size();
NSLog(@"touch_lo_get_content_size: width=%f, height=%f",size.width, size.height);
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m
index 4a235e1..52d7b64 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m
@@ -26,11 +26,13 @@ static const CGFloat RENDER_BUTTON_HEIGHT = 50.0f;
self = [self init];
if(self){
self.tester = tester;
- self.mode = WIDTH_IS_HEIGHT;
[self initParams];
[self initModeButton];
[self initRenderButton];
+ self.mode = WIDTH_IS_NOT_HEIGHT;
+ [self changeMode];
+
}
NSLog(@"%@ initWithTester",self);
@@ -96,6 +98,9 @@ static const CGFloat RENDER_BUTTON_HEIGHT = 50.0f;
}
[self.modeButton setTitle:MLOTestingTileParametersModeString(self.mode) forState:UIControlStateNormal];
+ for(MLOTestingTileParameter * param in self.params){
+ [param enterMode:self.mode];
+ }
}
More information about the Libreoffice-commits
mailing list