summaryrefslogtreecommitdiff
path: root/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles
diff options
context:
space:
mode:
Diffstat (limited to 'ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles')
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.h14
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m71
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h28
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m167
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h14
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m56
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h16
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h18
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m17
9 files changed, 0 insertions, 401 deletions
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.h
deleted file mode 100644
index 1bfaa8d87df6..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOSubView.h"
-@class MLOAppRoleTileTester;
-@interface MLOTestingTile : MLOSubView
--(id)initWithTester:(MLOAppRoleTileTester *) tester;
--(void)resize;
-@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
deleted file mode 100644
index 784c0dd848ef..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTile.m
+++ /dev/null
@@ -1,71 +0,0 @@
-// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOTestingTile.h"
-#import "MLOTestingTileParametersViewController.h"
-#import "MLOTestingTileRendererViewController.h"
-#import "MLOAppRoleTileTester.h"
-#include <touch/touch.h>
-
-@interface MLOTestingTile ()
-@property MLOAppRoleTileTester * tester;
-@end
-
-@implementation MLOTestingTile
-
-
--(id)initWithTester:(MLOAppRoleTileTester *)tester{
-
- self = [self initWithFrame:[MLOTestingTile resized:tester]];
- if(self){
- self.tester =tester;
- self.backgroundColor =[UIColor greenColor];
- }
- return self;
-
-}
-
-+(CGRect)resized:(MLOAppRoleTileTester *)tester{
- return CGRectMake( 10,
- 10,
- tester.params.contextWidth,
- tester.params.contextHeight);
-}
-
--(void)resize{
- self.frame = [MLOTestingTile resized:self.tester];
-}
-
-- (void)drawRect:(CGRect)rect
-{
- NSTimeInterval startTime = CACurrentMediaTime();
- 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,
- contextWidth,
- contextHeight,
- tilePosition,
- tileSize);
-
- NSLog(@"tile rendering took %f seconds",CACurrentMediaTime() - startTime);
- MLODpxSize size = touch_lo_get_content_size();
- NSLog(@"touch_lo_get_content_size: width=%f, height=%f",size.width, size.height);
-}
-
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h
deleted file mode 100644
index 6c1aea2714ed..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOViewController.h"
-#import "MLOTestingTileSubviewControllerProtocol.h"
-
-// The size of the actual pixel tile
-static const CGFloat CONTEXT_WIDTH_DEFAULT = 450;
-static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450;
-
-// In our "decatwips"
-static const CGFloat TILE_POS_X_DEFAULT = 0;
-static const CGFloat TILE_POS_Y_DEFAULT = 0;
-
-// "Tile" size here means the decatwip size of the part of the document
-// rendered into the pixel tile
-static const CGFloat TILE_WIDTH_DEFAULT = 500;
-static const CGFloat TILE_HEIGHT_DEFAULT = 500;
-
-@interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol>
-@property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight;
--(void)renderTile;
-@end
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
deleted file mode 100644
index 681693d38319..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m
+++ /dev/null
@@ -1,167 +0,0 @@
-// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOTestingTileParametersViewController.h"
-#import "MLOTestingTileParameter.h"
-#import "MLOAppRoleTileTester.h"
-#import "MLOTestingTileRendererViewController.h"
-
-static const CGFloat RENDER_BUTTON_HEIGHT = 50.0f;
-
-@interface MLOTestingTileParametersViewController ()
-@property MLOAppRoleTileTester * tester;
-@property NSArray * params;
-@property UIButton * renderButton;
-@property UIButton * modeButton;
-@property MLOTestingTileParametersMode mode;
-@end
-@implementation MLOTestingTileParametersViewController
-
--(id)initWithTester:(MLOAppRoleTileTester *)tester{
- self = [self init];
- if(self){
- self.tester = tester;
- [self initParams];
- [self initModeButton];
- [self initRenderButton];
-
- self.mode = WIDTH_IS_NOT_HEIGHT;
- [self changeMode];
-
- }
-
- NSLog(@"%@ initWithTester",self);
- return self;
-}
-
--(NSString *)description{
- return @"MLOTestingTileParametersViewController";
-}
-
--(void)initParams{
- self.params = @[[self createParam:@"contextWidth"
- widthIsNotHeightExtractor:^(CGFloat value){self.contextWidth = value;}
- widthIsHeightExtractor:^(CGFloat value){self.contextWidth = self.contextHeight = value;}
- value:CONTEXT_WIDTH_DEFAULT],
-
- [self createParam:@"contextHeight"
- widthIsNotHeightExtractor:^(CGFloat value){self.contextHeight = value;}
- value:CONTEXT_HEIGHT_DEFAULT],
-
- [self createParam:@"tilePosX"
- anyExtractor:^(CGFloat value){self.tilePosX = value;}
- value:TILE_POS_X_DEFAULT],
-
- [self createParam:@"tilePosY"
- anyExtractor:^(CGFloat value){self.tilePosY = value;}
- value:TILE_POS_Y_DEFAULT],
-
- [self createParam:@"tileWidth"
- widthIsNotHeightExtractor:^(CGFloat value){self.tileWidth = value;}
- widthIsHeightExtractor:^(CGFloat value){self.tileWidth = self.tileHeight = value;}
- value:TILE_WIDTH_DEFAULT],
-
- [self createParam:@"tileHeight"
- widthIsNotHeightExtractor:^(CGFloat value){self.tileHeight = value;}
- value:TILE_HEIGHT_DEFAULT]
- ];
-}
-
--(void)initRenderButton{
- UIButton * button =[UIButton buttonWithType:UIButtonTypeRoundedRect];
- [button addTarget:self action:@selector(renderTile) forControlEvents:UIControlEventTouchDown];
- [button setTitle:@"Render Tile" forState:UIControlStateNormal];
- self.renderButton =button;
-}
-
--(void)initModeButton{
- UIButton * button =[UIButton buttonWithType:UIButtonTypeRoundedRect];
- [button addTarget:self action:@selector(changeMode) forControlEvents:UIControlEventTouchDown];
- [button setTitle:MLOTestingTileParametersModeString(self.mode) forState:UIControlStateNormal];
- self.modeButton =button;
-}
-
--(void)changeMode{
-
- switch (self.mode) {
- case WIDTH_IS_HEIGHT:
- self.mode = WIDTH_IS_NOT_HEIGHT;
- break;
- case WIDTH_IS_NOT_HEIGHT:
- self.mode = WIDTH_IS_HEIGHT;
- break;
- }
-
- [self.modeButton setTitle:MLOTestingTileParametersModeString(self.mode) forState:UIControlStateNormal];
- for(MLOTestingTileParameter * param in self.params){
- [param enterMode:self.mode];
- }
-}
-
-
-
--(MLOTestingTileParameter *) createParam:(NSString *)name anyExtractor:(MLOTestingTileParameterExtractor) anyExtractor value:(CGFloat)defaultValue{
- return [self createParam:name widthIsNotHeightExtractor:anyExtractor widthIsHeightExtractor:anyExtractor value:defaultValue];
-}
-
--(MLOTestingTileParameter *) createParam:(NSString *)name widthIsNotHeightExtractor:(MLOTestingTileParameterExtractor) widthIsNotHeightExtractor value:(CGFloat)defaultValue{
- return [self createParam:name widthIsNotHeightExtractor:widthIsNotHeightExtractor widthIsHeightExtractor:nil value:defaultValue];
-}
-
--(MLOTestingTileParameter *) createParam:(NSString *)name widthIsNotHeightExtractor:(MLOTestingTileParameterExtractor) extractor1 widthIsHeightExtractor:(MLOTestingTileParameterExtractor) extractor2 value:(CGFloat)defaultValue{
- return [[MLOTestingTileParameter alloc] initWithParams:self label:name widthIsNotHeightExtractor:extractor1 widthIsHeightExtractor:extractor2 defaultValue:defaultValue];
-}
-
-
--(void)resize{
- NSLog(@"%@ resize",self);
- CGFloat height = self.view.frame.size.height;
- CGFloat width = self.view.frame.size.width;
- if(width<height){
- height = height/2.0f;
- }
- CGFloat heightWithoutButton = height - RENDER_BUTTON_HEIGHT;
- CGFloat paramHeight = heightWithoutButton / [self.params count];
- CGFloat originY = 0;
- for (MLOTestingTileParameter * param in self.params) {
- [param setParamFrame:CGRectMake(0,
- originY,
- width,
- paramHeight)];
- originY+=paramHeight;
- }
- CGFloat halfWidth = width/2.0f;
- self.modeButton.frame = CGRectMake(0,
- originY,
- halfWidth,
- RENDER_BUTTON_HEIGHT);
- self.renderButton.frame = CGRectMake(halfWidth,
- originY,
- halfWidth,
- RENDER_BUTTON_HEIGHT);
-
-}
--(void)addToSuperview{
- NSLog(@"%@ addToSuperview",self);
- [self.tester.view addSubview:self.view];
- for (MLOTestingTileParameter * param in self.params) {
- [param addToSuperview];
- }
-
- [self.view addSubview:self.renderButton];
- [self.view addSubview:self.modeButton];
-
-
-}
--(void)renderTile{
- for (MLOTestingTileParameter * param in self.params) {
- [param extractMode:self.mode];
- }
- [self.tester.renderer render];
-}
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h
deleted file mode 100644
index 33fd647d7386..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOViewController.h"
-#import "MLOTestingTileSubviewControllerProtocol.h"
-
-@interface MLOTestingTileRendererViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol>
--(void)render;
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m
deleted file mode 100644
index 5dc9db16732a..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import "MLOTestingTileRendererViewController.h"
-#import "MLOAppRoleTileTester.h"
-#import "MLOTestingTile.h"
-
-@interface MLOTestingTileRendererViewController ()
-@property MLOAppRoleTileTester * tester;
-@property UIScrollView * scrollView;
-@property MLOTestingTile * tile;
-@end
-
-@implementation MLOTestingTileRendererViewController
-
--(id)initWithTester:(MLOAppRoleTileTester *)tester{
- self = [self init];
- if(self){
- self.tester = tester;
- [self initScrollView];
- }
- NSLog(@"%@ initWithTester",self);
- return self;
-}
-
--(void)initScrollView{
- self.scrollView = [UIScrollView new];
- self.scrollView.backgroundColor = [UIColor grayColor];
- self.view = self.scrollView;
-}
--(void)resize{
- NSLog(@"%@ resize",self);
- [self.tile resize];
-}
--(NSString *)description{
- return @"MLOAppRoleTileTester";
-}
--(void)addToSuperview{
- NSLog(@"%@ addToSuperview",self);
-
- [self.tester.view addSubview:self.view];
-}
--(void)render{
-
- [self.tile removeFromSuperview];
- self.tile = [[MLOTestingTile alloc] initWithTester:self.tester];
- [self.scrollView addSubview:self.tile];
- self.scrollView.contentSize = self.tile.frame.size;
-
-}
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h
deleted file mode 100644
index 9b9c977cdfab..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#import <Foundation/Foundation.h>
-
-@class MLOAppRoleTileTester;
-@protocol MLOTestingTileSubviewControllerProtocol <NSObject>
--(id)initWithTester:(MLOAppRoleTileTester *)tester;
--(void)addToSuperview;
--(void)resize;
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h
deleted file mode 100644
index e7448435c252..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
-// MLOTestingTileSubviewViewController.h
-// ios_sharedlo
-//
-
-#import "MLOViewController.h"
-
-@class MLOAppRoleTileTester;
-@interface MLOTestingTileSubviewViewController : MLOViewController
-@property MLOAppRoleTileTester * tester;
-
-@end
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m
deleted file mode 100644
index 2fbe82d93e18..000000000000
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// This file is part of the LibreOffice project.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
-// MLOTestingTileSubviewViewController.m
-// ios_sharedlo
-//
-
-#import "MLOTestingTileSubviewViewController.h"
-
-@implementation MLOTestingTileSubviewViewController
-
-
-@end