diff options
Diffstat (limited to 'ios/shared')
101 files changed, 0 insertions, 7813 deletions
diff --git a/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj b/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj deleted file mode 100644 index ce0e346042e6..000000000000 --- a/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,728 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 681D78C7180C298700D52D5E /* MLOInvoker.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 689EBB441806D22C002F1CD7 /* MLOInvoker.h */; }; - 681D78C8180C298700D52D5E /* MLOManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 689EBB451806D22C002F1CD7 /* MLOManager.h */; }; - 681D78CD180C30B300D52D5E /* MLOObject.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 689EBB591806D22C002F1CD7 /* MLOObject.h */; }; - 689EBB381806D221002F1CD7 /* mlo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB321806D221002F1CD7 /* mlo.mm */; }; - 689EBB391806D221002F1CD7 /* mlo_uno.mm in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB341806D221002F1CD7 /* mlo_uno.mm */; }; - 689EBB3A1806D221002F1CD7 /* mlo_utils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB361806D221002F1CD7 /* mlo_utils.mm */; }; - 689EBB861806D22D002F1CD7 /* MLOGestureEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB3E1806D22C002F1CD7 /* MLOGestureEngine.m */; }; - 689EBB871806D22D002F1CD7 /* MLOGestureFlick.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB411806D22C002F1CD7 /* MLOGestureFlick.m */; }; - 689EBB881806D22D002F1CD7 /* MLOGestureLimiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB431806D22C002F1CD7 /* MLOGestureLimiter.m */; }; - 689EBB891806D22D002F1CD7 /* MLOManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB461806D22C002F1CD7 /* MLOManager.m */; }; - 689EBB8A1806D22D002F1CD7 /* MLOPostRenderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB491806D22C002F1CD7 /* MLOPostRenderManager.m */; }; - 689EBB8B1806D22D002F1CD7 /* MLORenderBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB4B1806D22C002F1CD7 /* MLORenderBuffer.m */; }; - 689EBB8C1806D22D002F1CD7 /* MLORenderingUIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB4D1806D22C002F1CD7 /* MLORenderingUIView.m */; }; - 689EBB8D1806D22D002F1CD7 /* MLORenderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB4F1806D22C002F1CD7 /* MLORenderManager.m */; }; - 689EBB8E1806D22D002F1CD7 /* MLOScalingBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB521806D22C002F1CD7 /* MLOScalingBuffer.m */; }; - 689EBB8F1806D22D002F1CD7 /* MLOAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB551806D22C002F1CD7 /* MLOAnimation.m */; }; - 689EBB901806D22D002F1CD7 /* MLOButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB571806D22C002F1CD7 /* MLOButton.m */; }; - 689EBB911806D22D002F1CD7 /* MLOObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB5A1806D22C002F1CD7 /* MLOObject.m */; }; - 689EBB921806D22D002F1CD7 /* MLOResourceImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB5C1806D22C002F1CD7 /* MLOResourceImage.m */; }; - 689EBB931806D22D002F1CD7 /* MLOSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB5E1806D22C002F1CD7 /* MLOSubView.m */; }; - 689EBB941806D22D002F1CD7 /* MLOViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB601806D22C002F1CD7 /* MLOViewController.m */; }; - 689EBB951806D22D002F1CD7 /* NSObject+MLOUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB621806D22C002F1CD7 /* NSObject+MLOUtils.m */; }; - 689EBB961806D22D002F1CD7 /* MLOMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB651806D22C002F1CD7 /* MLOMainViewController.m */; }; - 689EBB971806D22D002F1CD7 /* MLOTopbarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB691806D22C002F1CD7 /* MLOTopbarViewController.m */; }; - 689EBB981806D22D002F1CD7 /* MLOScrollerData.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB6C1806D22C002F1CD7 /* MLOScrollerData.m */; }; - 689EBB991806D22D002F1CD7 /* MLOScrollerGridViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB6E1806D22C002F1CD7 /* MLOScrollerGridViewController.m */; }; - 689EBB9A1806D22D002F1CD7 /* MLOScrollerTooltip.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB701806D22C002F1CD7 /* MLOScrollerTooltip.m */; }; - 689EBB9B1806D22D002F1CD7 /* MLOScrollerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB721806D22C002F1CD7 /* MLOScrollerViewController.m */; }; - 689EBB9C1806D22D002F1CD7 /* MLOContextualMenuFocus.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB751806D22C002F1CD7 /* MLOContextualMenuFocus.m */; }; - 689EBB9D1806D22D002F1CD7 /* MLOMagnifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB771806D22C002F1CD7 /* MLOMagnifier.m */; }; - 689EBB9E1806D22D002F1CD7 /* MLOSelectionHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB791806D22C002F1CD7 /* MLOSelectionHandle.m */; }; - 689EBB9F1806D22D002F1CD7 /* MLOSelectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB7B1806D22C002F1CD7 /* MLOSelectionViewController.m */; }; - 689EBBA01806D22D002F1CD7 /* MLOThesaurusViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB7E1806D22C002F1CD7 /* MLOThesaurusViewController.m */; }; - 689EBBA11806D22D002F1CD7 /* MLOFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB811806D22C002F1CD7 /* MLOFinder.m */; }; - 689EBBA21806D22D002F1CD7 /* MLOToolbarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB831806D22C002F1CD7 /* MLOToolbarButton.m */; }; - 689EBBA31806D22D002F1CD7 /* MLOToolbarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 689EBB851806D22D002F1CD7 /* MLOToolbarViewController.m */; }; - 68FDBE2E18053A140064DD74 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68FDBE2D18053A140064DD74 /* Foundation.framework */; }; - 68FDBE3518053A140064DD74 /* ios_sharedlo.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FDBE3418053A140064DD74 /* ios_sharedlo.m */; }; - 889B7929180FF928005A3149 /* MLOAppRoleLoApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 889B7928180FF928005A3149 /* MLOAppRoleLoApp.m */; }; - 889B792C180FF967005A3149 /* MLOAppRoleTileTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 889B792B180FF967005A3149 /* MLOAppRoleTileTester.m */; }; - 889B7930180FFBA5005A3149 /* MLOAppRoleBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 889B792F180FFBA5005A3149 /* MLOAppRoleBase.m */; }; - 88A083BA18115E8D009C75BE /* MLOTestingTile.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A083B918115E8D009C75BE /* MLOTestingTile.m */; }; - 88A132FC181020320091F25E /* MLOTestingTileRendererViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A132FB181020320091F25E /* MLOTestingTileRendererViewController.m */; }; - 88A132FF1810204E0091F25E /* MLOTestingTileParametersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A132FE1810204E0091F25E /* MLOTestingTileParametersViewController.m */; }; - 88A1330B1810213F0091F25E /* MLOAppRoleFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A1330A1810213E0091F25E /* MLOAppRoleFactory.m */; }; - 88A13318181040BC0091F25E /* MLOTestingTileParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A13317181040BC0091F25E /* MLOTestingTileParameter.m */; }; - 88A2ED23180D4D7C009F39C0 /* MLOKeyboardManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 88A2ED22180D4D7C009F39C0 /* MLOKeyboardManager.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 68FDBE2818053A140064DD74 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - 681D78CD180C30B300D52D5E /* MLOObject.h in CopyFiles */, - 681D78C7180C298700D52D5E /* MLOInvoker.h in CopyFiles */, - 681D78C8180C298700D52D5E /* MLOManager.h in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 689EBADD1806975D002F1CD7 /* lo.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = lo.xcconfig; path = ../lo.xcconfig; sourceTree = "<group>"; }; - 689EBB311806D221002F1CD7 /* mlo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mlo.h; sourceTree = "<group>"; }; - 689EBB321806D221002F1CD7 /* mlo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mlo.mm; sourceTree = "<group>"; }; - 689EBB331806D221002F1CD7 /* mlo_uno.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mlo_uno.h; sourceTree = "<group>"; }; - 689EBB341806D221002F1CD7 /* mlo_uno.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mlo_uno.mm; sourceTree = "<group>"; }; - 689EBB351806D221002F1CD7 /* mlo_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mlo_utils.h; sourceTree = "<group>"; }; - 689EBB361806D221002F1CD7 /* mlo_utils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mlo_utils.mm; sourceTree = "<group>"; }; - 689EBB371806D221002F1CD7 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = "<group>"; }; - 689EBB3D1806D22C002F1CD7 /* MLOGestureEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOGestureEngine.h; sourceTree = "<group>"; }; - 689EBB3E1806D22C002F1CD7 /* MLOGestureEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOGestureEngine.m; sourceTree = "<group>"; }; - 689EBB3F1806D22C002F1CD7 /* MLOGestureEngine_Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOGestureEngine_Impl.h; sourceTree = "<group>"; }; - 689EBB401806D22C002F1CD7 /* MLOGestureFlick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOGestureFlick.h; sourceTree = "<group>"; }; - 689EBB411806D22C002F1CD7 /* MLOGestureFlick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOGestureFlick.m; sourceTree = "<group>"; }; - 689EBB421806D22C002F1CD7 /* MLOGestureLimiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOGestureLimiter.h; sourceTree = "<group>"; }; - 689EBB431806D22C002F1CD7 /* MLOGestureLimiter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOGestureLimiter.m; sourceTree = "<group>"; }; - 689EBB441806D22C002F1CD7 /* MLOInvoker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOInvoker.h; sourceTree = "<group>"; }; - 689EBB451806D22C002F1CD7 /* MLOManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOManager.h; sourceTree = "<group>"; }; - 689EBB461806D22C002F1CD7 /* MLOManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOManager.m; sourceTree = "<group>"; }; - 689EBB481806D22C002F1CD7 /* MLOPostRenderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOPostRenderManager.h; sourceTree = "<group>"; }; - 689EBB491806D22C002F1CD7 /* MLOPostRenderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOPostRenderManager.m; sourceTree = "<group>"; }; - 689EBB4A1806D22C002F1CD7 /* MLORenderBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLORenderBuffer.h; sourceTree = "<group>"; }; - 689EBB4B1806D22C002F1CD7 /* MLORenderBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLORenderBuffer.m; sourceTree = "<group>"; }; - 689EBB4C1806D22C002F1CD7 /* MLORenderingUIView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLORenderingUIView.h; sourceTree = "<group>"; }; - 689EBB4D1806D22C002F1CD7 /* MLORenderingUIView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLORenderingUIView.m; sourceTree = "<group>"; }; - 689EBB4E1806D22C002F1CD7 /* MLORenderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLORenderManager.h; sourceTree = "<group>"; }; - 689EBB4F1806D22C002F1CD7 /* MLORenderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLORenderManager.m; sourceTree = "<group>"; }; - 689EBB501806D22C002F1CD7 /* MLORenderManager_Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLORenderManager_Impl.h; sourceTree = "<group>"; }; - 689EBB511806D22C002F1CD7 /* MLOScalingBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOScalingBuffer.h; sourceTree = "<group>"; }; - 689EBB521806D22C002F1CD7 /* MLOScalingBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOScalingBuffer.m; sourceTree = "<group>"; }; - 689EBB541806D22C002F1CD7 /* MLOAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOAnimation.h; sourceTree = "<group>"; }; - 689EBB551806D22C002F1CD7 /* MLOAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOAnimation.m; sourceTree = "<group>"; }; - 689EBB561806D22C002F1CD7 /* MLOButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOButton.h; sourceTree = "<group>"; }; - 689EBB571806D22C002F1CD7 /* MLOButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOButton.m; sourceTree = "<group>"; }; - 689EBB581806D22C002F1CD7 /* MLOCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOCommon.h; sourceTree = "<group>"; }; - 689EBB591806D22C002F1CD7 /* MLOObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOObject.h; sourceTree = "<group>"; }; - 689EBB5A1806D22C002F1CD7 /* MLOObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOObject.m; sourceTree = "<group>"; }; - 689EBB5B1806D22C002F1CD7 /* MLOResourceImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOResourceImage.h; sourceTree = "<group>"; }; - 689EBB5C1806D22C002F1CD7 /* MLOResourceImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOResourceImage.m; sourceTree = "<group>"; }; - 689EBB5D1806D22C002F1CD7 /* MLOSubView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOSubView.h; sourceTree = "<group>"; }; - 689EBB5E1806D22C002F1CD7 /* MLOSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOSubView.m; sourceTree = "<group>"; }; - 689EBB5F1806D22C002F1CD7 /* MLOViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOViewController.h; sourceTree = "<group>"; }; - 689EBB601806D22C002F1CD7 /* MLOViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOViewController.m; sourceTree = "<group>"; }; - 689EBB611806D22C002F1CD7 /* NSObject+MLOUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+MLOUtils.h"; sourceTree = "<group>"; }; - 689EBB621806D22C002F1CD7 /* NSObject+MLOUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MLOUtils.m"; sourceTree = "<group>"; }; - 689EBB641806D22C002F1CD7 /* MLOMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOMainViewController.h; sourceTree = "<group>"; }; - 689EBB651806D22C002F1CD7 /* MLOMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOMainViewController.m; sourceTree = "<group>"; }; - 689EBB661806D22C002F1CD7 /* MLOMainViewController_Friend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOMainViewController_Friend.h; sourceTree = "<group>"; }; - 689EBB681806D22C002F1CD7 /* MLOTopbarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOTopbarViewController.h; sourceTree = "<group>"; }; - 689EBB691806D22C002F1CD7 /* MLOTopbarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOTopbarViewController.m; sourceTree = "<group>"; }; - 689EBB6B1806D22C002F1CD7 /* MLOScrollerData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOScrollerData.h; sourceTree = "<group>"; }; - 689EBB6C1806D22C002F1CD7 /* MLOScrollerData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOScrollerData.m; sourceTree = "<group>"; }; - 689EBB6D1806D22C002F1CD7 /* MLOScrollerGridViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOScrollerGridViewController.h; sourceTree = "<group>"; }; - 689EBB6E1806D22C002F1CD7 /* MLOScrollerGridViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOScrollerGridViewController.m; sourceTree = "<group>"; }; - 689EBB6F1806D22C002F1CD7 /* MLOScrollerTooltip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOScrollerTooltip.h; sourceTree = "<group>"; }; - 689EBB701806D22C002F1CD7 /* MLOScrollerTooltip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOScrollerTooltip.m; sourceTree = "<group>"; }; - 689EBB711806D22C002F1CD7 /* MLOScrollerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOScrollerViewController.h; sourceTree = "<group>"; }; - 689EBB721806D22C002F1CD7 /* MLOScrollerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOScrollerViewController.m; sourceTree = "<group>"; }; - 689EBB741806D22C002F1CD7 /* MLOContextualMenuFocus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOContextualMenuFocus.h; sourceTree = "<group>"; }; - 689EBB751806D22C002F1CD7 /* MLOContextualMenuFocus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOContextualMenuFocus.m; sourceTree = "<group>"; }; - 689EBB761806D22C002F1CD7 /* MLOMagnifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOMagnifier.h; sourceTree = "<group>"; }; - 689EBB771806D22C002F1CD7 /* MLOMagnifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOMagnifier.m; sourceTree = "<group>"; }; - 689EBB781806D22C002F1CD7 /* MLOSelectionHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOSelectionHandle.h; sourceTree = "<group>"; }; - 689EBB791806D22C002F1CD7 /* MLOSelectionHandle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOSelectionHandle.m; sourceTree = "<group>"; }; - 689EBB7A1806D22C002F1CD7 /* MLOSelectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOSelectionViewController.h; sourceTree = "<group>"; }; - 689EBB7B1806D22C002F1CD7 /* MLOSelectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOSelectionViewController.m; sourceTree = "<group>"; }; - 689EBB7C1806D22C002F1CD7 /* MLOSelectionViewController_Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOSelectionViewController_Impl.h; sourceTree = "<group>"; }; - 689EBB7D1806D22C002F1CD7 /* MLOThesaurusViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOThesaurusViewController.h; sourceTree = "<group>"; }; - 689EBB7E1806D22C002F1CD7 /* MLOThesaurusViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOThesaurusViewController.m; sourceTree = "<group>"; }; - 689EBB801806D22C002F1CD7 /* MLOFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOFinder.h; sourceTree = "<group>"; }; - 689EBB811806D22C002F1CD7 /* MLOFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOFinder.m; sourceTree = "<group>"; }; - 689EBB821806D22C002F1CD7 /* MLOToolbarButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOToolbarButton.h; sourceTree = "<group>"; }; - 689EBB831806D22C002F1CD7 /* MLOToolbarButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOToolbarButton.m; sourceTree = "<group>"; }; - 689EBB841806D22D002F1CD7 /* MLOToolbarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOToolbarViewController.h; sourceTree = "<group>"; }; - 689EBB851806D22D002F1CD7 /* MLOToolbarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOToolbarViewController.m; sourceTree = "<group>"; }; - 68FDBE2A18053A140064DD74 /* libios_sharedlo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libios_sharedlo.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 68FDBE2D18053A140064DD74 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 68FDBE3118053A140064DD74 /* ios_sharedlo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ios_sharedlo-Prefix.pch"; sourceTree = "<group>"; }; - 68FDBE3218053A140064DD74 /* ios_sharedlo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ios_sharedlo.h; path = ../ios_sharedlo.h; sourceTree = "<group>"; }; - 68FDBE3418053A140064DD74 /* ios_sharedlo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ios_sharedlo.m; path = ../ios_sharedlo.m; sourceTree = "<group>"; }; - 889B7927180FF928005A3149 /* MLOAppRoleLoApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOAppRoleLoApp.h; path = role/MLOAppRoleLoApp.h; sourceTree = "<group>"; }; - 889B7928180FF928005A3149 /* MLOAppRoleLoApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOAppRoleLoApp.m; path = role/MLOAppRoleLoApp.m; sourceTree = "<group>"; }; - 889B792A180FF967005A3149 /* MLOAppRoleTileTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOAppRoleTileTester.h; path = role/MLOAppRoleTileTester.h; sourceTree = "<group>"; }; - 889B792B180FF967005A3149 /* MLOAppRoleTileTester.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOAppRoleTileTester.m; path = role/MLOAppRoleTileTester.m; sourceTree = "<group>"; }; - 889B792D180FF9E2005A3149 /* MLOMainViewController_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MLOMainViewController_Private.h; sourceTree = "<group>"; }; - 889B792E180FFBA5005A3149 /* MLOAppRoleBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOAppRoleBase.h; path = role/MLOAppRoleBase.h; sourceTree = "<group>"; }; - 889B792F180FFBA5005A3149 /* MLOAppRoleBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOAppRoleBase.m; path = role/MLOAppRoleBase.m; sourceTree = "<group>"; }; - 889B793618101709005A3149 /* MLOAppRoleProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MLOAppRoleProtocol.h; path = role/MLOAppRoleProtocol.h; sourceTree = "<group>"; }; - 88A083B818115E8D009C75BE /* MLOTestingTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOTestingTile.h; path = testing_tiles/MLOTestingTile.h; sourceTree = "<group>"; }; - 88A083B918115E8D009C75BE /* MLOTestingTile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOTestingTile.m; path = testing_tiles/MLOTestingTile.m; sourceTree = "<group>"; }; - 88A132FA181020320091F25E /* MLOTestingTileRendererViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOTestingTileRendererViewController.h; path = testing_tiles/MLOTestingTileRendererViewController.h; sourceTree = "<group>"; }; - 88A132FB181020320091F25E /* MLOTestingTileRendererViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOTestingTileRendererViewController.m; path = testing_tiles/MLOTestingTileRendererViewController.m; sourceTree = "<group>"; }; - 88A132FD1810204E0091F25E /* MLOTestingTileParametersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOTestingTileParametersViewController.h; path = testing_tiles/MLOTestingTileParametersViewController.h; sourceTree = "<group>"; }; - 88A132FE1810204E0091F25E /* MLOTestingTileParametersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOTestingTileParametersViewController.m; path = testing_tiles/MLOTestingTileParametersViewController.m; sourceTree = "<group>"; }; - 88A13300181020E40091F25E /* MLOTestingTileSubviewControllerProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MLOTestingTileSubviewControllerProtocol.h; path = testing_tiles/MLOTestingTileSubviewControllerProtocol.h; sourceTree = "<group>"; }; - 88A133091810213E0091F25E /* MLOAppRoleFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLOAppRoleFactory.h; path = role/MLOAppRoleFactory.h; sourceTree = "<group>"; }; - 88A1330A1810213E0091F25E /* MLOAppRoleFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLOAppRoleFactory.m; path = role/MLOAppRoleFactory.m; sourceTree = "<group>"; }; - 88A13316181040BC0091F25E /* MLOTestingTileParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOTestingTileParameter.h; sourceTree = "<group>"; }; - 88A13317181040BC0091F25E /* MLOTestingTileParameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOTestingTileParameter.m; sourceTree = "<group>"; }; - 88A2ED21180D4D7C009F39C0 /* MLOKeyboardManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLOKeyboardManager.h; sourceTree = "<group>"; }; - 88A2ED22180D4D7C009F39C0 /* MLOKeyboardManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLOKeyboardManager.m; sourceTree = "<group>"; }; - 88E94760180D4E9800771808 /* MLOToolbarViewController_Impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MLOToolbarViewController_Impl.h; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 68FDBE2718053A140064DD74 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 68FDBE2E18053A140064DD74 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 688EAAF8180D6773003741B3 /* Config */ = { - isa = PBXGroup; - children = ( - 68FDBE3018053A140064DD74 /* Supporting Files */, - 689EBADD1806975D002F1CD7 /* lo.xcconfig */, - ); - name = Config; - sourceTree = "<group>"; - }; - 689EBB301806D221002F1CD7 /* cxx */ = { - isa = PBXGroup; - children = ( - 689EBB311806D221002F1CD7 /* mlo.h */, - 689EBB321806D221002F1CD7 /* mlo.mm */, - 689EBB331806D221002F1CD7 /* mlo_uno.h */, - 689EBB341806D221002F1CD7 /* mlo_uno.mm */, - 689EBB351806D221002F1CD7 /* mlo_utils.h */, - 689EBB361806D221002F1CD7 /* mlo_utils.mm */, - 689EBB371806D221002F1CD7 /* time.h */, - ); - path = cxx; - sourceTree = "<group>"; - }; - 689EBB3B1806D22C002F1CD7 /* objective_c */ = { - isa = PBXGroup; - children = ( - 689EBB3C1806D22C002F1CD7 /* gestures */, - 689EBB471806D22C002F1CD7 /* render */, - 689EBB531806D22C002F1CD7 /* utils */, - 689EBB631806D22C002F1CD7 /* view_controllers */, - 689EBB441806D22C002F1CD7 /* MLOInvoker.h */, - 689EBB451806D22C002F1CD7 /* MLOManager.h */, - 689EBB461806D22C002F1CD7 /* MLOManager.m */, - 68FDBE3218053A140064DD74 /* ios_sharedlo.h */, - 68FDBE3418053A140064DD74 /* ios_sharedlo.m */, - ); - path = objective_c; - sourceTree = "<group>"; - }; - 689EBB3C1806D22C002F1CD7 /* gestures */ = { - isa = PBXGroup; - children = ( - 689EBB3D1806D22C002F1CD7 /* MLOGestureEngine.h */, - 689EBB3E1806D22C002F1CD7 /* MLOGestureEngine.m */, - 689EBB3F1806D22C002F1CD7 /* MLOGestureEngine_Impl.h */, - 689EBB401806D22C002F1CD7 /* MLOGestureFlick.h */, - 689EBB411806D22C002F1CD7 /* MLOGestureFlick.m */, - 689EBB421806D22C002F1CD7 /* MLOGestureLimiter.h */, - 689EBB431806D22C002F1CD7 /* MLOGestureLimiter.m */, - 88A2ED21180D4D7C009F39C0 /* MLOKeyboardManager.h */, - 88A2ED22180D4D7C009F39C0 /* MLOKeyboardManager.m */, - ); - path = gestures; - sourceTree = "<group>"; - }; - 689EBB471806D22C002F1CD7 /* render */ = { - isa = PBXGroup; - children = ( - 689EBB481806D22C002F1CD7 /* MLOPostRenderManager.h */, - 689EBB491806D22C002F1CD7 /* MLOPostRenderManager.m */, - 689EBB4A1806D22C002F1CD7 /* MLORenderBuffer.h */, - 689EBB4B1806D22C002F1CD7 /* MLORenderBuffer.m */, - 689EBB4C1806D22C002F1CD7 /* MLORenderingUIView.h */, - 689EBB4D1806D22C002F1CD7 /* MLORenderingUIView.m */, - 689EBB4E1806D22C002F1CD7 /* MLORenderManager.h */, - 689EBB4F1806D22C002F1CD7 /* MLORenderManager.m */, - 689EBB501806D22C002F1CD7 /* MLORenderManager_Impl.h */, - 689EBB511806D22C002F1CD7 /* MLOScalingBuffer.h */, - 689EBB521806D22C002F1CD7 /* MLOScalingBuffer.m */, - ); - path = render; - sourceTree = "<group>"; - }; - 689EBB531806D22C002F1CD7 /* utils */ = { - isa = PBXGroup; - children = ( - 689EBB541806D22C002F1CD7 /* MLOAnimation.h */, - 689EBB551806D22C002F1CD7 /* MLOAnimation.m */, - 689EBB561806D22C002F1CD7 /* MLOButton.h */, - 689EBB571806D22C002F1CD7 /* MLOButton.m */, - 689EBB581806D22C002F1CD7 /* MLOCommon.h */, - 689EBB591806D22C002F1CD7 /* MLOObject.h */, - 689EBB5A1806D22C002F1CD7 /* MLOObject.m */, - 689EBB5B1806D22C002F1CD7 /* MLOResourceImage.h */, - 689EBB5C1806D22C002F1CD7 /* MLOResourceImage.m */, - 689EBB5D1806D22C002F1CD7 /* MLOSubView.h */, - 689EBB5E1806D22C002F1CD7 /* MLOSubView.m */, - 689EBB5F1806D22C002F1CD7 /* MLOViewController.h */, - 689EBB601806D22C002F1CD7 /* MLOViewController.m */, - 689EBB611806D22C002F1CD7 /* NSObject+MLOUtils.h */, - 689EBB621806D22C002F1CD7 /* NSObject+MLOUtils.m */, - ); - path = utils; - sourceTree = "<group>"; - }; - 689EBB631806D22C002F1CD7 /* view_controllers */ = { - isa = PBXGroup; - children = ( - 889B7926180FF8DF005A3149 /* role */, - 889EBEC0180F04A300A34A68 /* testing_tiles */, - 689EBB641806D22C002F1CD7 /* MLOMainViewController.h */, - 689EBB661806D22C002F1CD7 /* MLOMainViewController_Friend.h */, - 889B792D180FF9E2005A3149 /* MLOMainViewController_Private.h */, - 689EBB651806D22C002F1CD7 /* MLOMainViewController.m */, - 689EBB681806D22C002F1CD7 /* MLOTopbarViewController.h */, - 689EBB691806D22C002F1CD7 /* MLOTopbarViewController.m */, - 689EBB6A1806D22C002F1CD7 /* scroller */, - 689EBB731806D22C002F1CD7 /* selection */, - 689EBB7F1806D22C002F1CD7 /* toolbar */, - ); - path = view_controllers; - sourceTree = "<group>"; - }; - 689EBB6A1806D22C002F1CD7 /* scroller */ = { - isa = PBXGroup; - children = ( - 689EBB6B1806D22C002F1CD7 /* MLOScrollerData.h */, - 689EBB6C1806D22C002F1CD7 /* MLOScrollerData.m */, - 689EBB6D1806D22C002F1CD7 /* MLOScrollerGridViewController.h */, - 689EBB6E1806D22C002F1CD7 /* MLOScrollerGridViewController.m */, - 689EBB6F1806D22C002F1CD7 /* MLOScrollerTooltip.h */, - 689EBB701806D22C002F1CD7 /* MLOScrollerTooltip.m */, - 689EBB711806D22C002F1CD7 /* MLOScrollerViewController.h */, - 689EBB721806D22C002F1CD7 /* MLOScrollerViewController.m */, - ); - path = scroller; - sourceTree = "<group>"; - }; - 689EBB731806D22C002F1CD7 /* selection */ = { - isa = PBXGroup; - children = ( - 689EBB741806D22C002F1CD7 /* MLOContextualMenuFocus.h */, - 689EBB751806D22C002F1CD7 /* MLOContextualMenuFocus.m */, - 689EBB761806D22C002F1CD7 /* MLOMagnifier.h */, - 689EBB771806D22C002F1CD7 /* MLOMagnifier.m */, - 689EBB781806D22C002F1CD7 /* MLOSelectionHandle.h */, - 689EBB791806D22C002F1CD7 /* MLOSelectionHandle.m */, - 689EBB7A1806D22C002F1CD7 /* MLOSelectionViewController.h */, - 689EBB7B1806D22C002F1CD7 /* MLOSelectionViewController.m */, - 689EBB7C1806D22C002F1CD7 /* MLOSelectionViewController_Impl.h */, - 689EBB7D1806D22C002F1CD7 /* MLOThesaurusViewController.h */, - 689EBB7E1806D22C002F1CD7 /* MLOThesaurusViewController.m */, - ); - path = selection; - sourceTree = "<group>"; - }; - 689EBB7F1806D22C002F1CD7 /* toolbar */ = { - isa = PBXGroup; - children = ( - 689EBB801806D22C002F1CD7 /* MLOFinder.h */, - 689EBB811806D22C002F1CD7 /* MLOFinder.m */, - 689EBB821806D22C002F1CD7 /* MLOToolbarButton.h */, - 689EBB831806D22C002F1CD7 /* MLOToolbarButton.m */, - 689EBB841806D22D002F1CD7 /* MLOToolbarViewController.h */, - 88E94760180D4E9800771808 /* MLOToolbarViewController_Impl.h */, - 689EBB851806D22D002F1CD7 /* MLOToolbarViewController.m */, - ); - path = toolbar; - sourceTree = "<group>"; - }; - 68FDBE2118053A140064DD74 = { - isa = PBXGroup; - children = ( - 68FDBE2F18053A140064DD74 /* ios_sharedlo */, - 688EAAF8180D6773003741B3 /* Config */, - 68FDBE2C18053A140064DD74 /* Frameworks */, - 68FDBE2B18053A140064DD74 /* Products */, - ); - sourceTree = "<group>"; - }; - 68FDBE2B18053A140064DD74 /* Products */ = { - isa = PBXGroup; - children = ( - 68FDBE2A18053A140064DD74 /* libios_sharedlo.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 68FDBE2C18053A140064DD74 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 68FDBE2D18053A140064DD74 /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 68FDBE2F18053A140064DD74 /* ios_sharedlo */ = { - isa = PBXGroup; - children = ( - 689EBB301806D221002F1CD7 /* cxx */, - 689EBB3B1806D22C002F1CD7 /* objective_c */, - ); - path = ios_sharedlo; - sourceTree = "<group>"; - }; - 68FDBE3018053A140064DD74 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 68FDBE3118053A140064DD74 /* ios_sharedlo-Prefix.pch */, - ); - name = "Supporting Files"; - path = ios_sharedlo; - sourceTree = "<group>"; - }; - 889B7926180FF8DF005A3149 /* role */ = { - isa = PBXGroup; - children = ( - 889B7927180FF928005A3149 /* MLOAppRoleLoApp.h */, - 889B7928180FF928005A3149 /* MLOAppRoleLoApp.m */, - 889B792A180FF967005A3149 /* MLOAppRoleTileTester.h */, - 889B792B180FF967005A3149 /* MLOAppRoleTileTester.m */, - 889B792E180FFBA5005A3149 /* MLOAppRoleBase.h */, - 889B792F180FFBA5005A3149 /* MLOAppRoleBase.m */, - 88A133091810213E0091F25E /* MLOAppRoleFactory.h */, - 88A1330A1810213E0091F25E /* MLOAppRoleFactory.m */, - 889B793618101709005A3149 /* MLOAppRoleProtocol.h */, - ); - name = role; - sourceTree = "<group>"; - }; - 889EBEC0180F04A300A34A68 /* testing_tiles */ = { - isa = PBXGroup; - children = ( - 88A132FA181020320091F25E /* MLOTestingTileRendererViewController.h */, - 88A132FB181020320091F25E /* MLOTestingTileRendererViewController.m */, - 88A083B818115E8D009C75BE /* MLOTestingTile.h */, - 88A083B918115E8D009C75BE /* MLOTestingTile.m */, - 88A132FD1810204E0091F25E /* MLOTestingTileParametersViewController.h */, - 88A132FE1810204E0091F25E /* MLOTestingTileParametersViewController.m */, - 88A13316181040BC0091F25E /* MLOTestingTileParameter.h */, - 88A13317181040BC0091F25E /* MLOTestingTileParameter.m */, - 88A13300181020E40091F25E /* MLOTestingTileSubviewControllerProtocol.h */, - ); - name = testing_tiles; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 68FDBE2918053A140064DD74 /* ios_sharedlo */ = { - isa = PBXNativeTarget; - buildConfigurationList = 68FDBE3818053A140064DD74 /* Build configuration list for PBXNativeTarget "ios_sharedlo" */; - buildPhases = ( - 68FDBE2618053A140064DD74 /* Sources */, - 68FDBE2718053A140064DD74 /* Frameworks */, - 68FDBE2818053A140064DD74 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ios_sharedlo; - productName = ios_sharedlo; - productReference = 68FDBE2A18053A140064DD74 /* libios_sharedlo.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 68FDBE2218053A140064DD74 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0500; - ORGANIZATIONNAME = LibreOffice.org; - }; - buildConfigurationList = 68FDBE2518053A140064DD74 /* Build configuration list for PBXProject "ios_sharedlo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 68FDBE2118053A140064DD74; - productRefGroup = 68FDBE2B18053A140064DD74 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 68FDBE2918053A140064DD74 /* ios_sharedlo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 68FDBE2618053A140064DD74 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 68FDBE3518053A140064DD74 /* ios_sharedlo.m in Sources */, - 689EBB381806D221002F1CD7 /* mlo.mm in Sources */, - 689EBB391806D221002F1CD7 /* mlo_uno.mm in Sources */, - 689EBB3A1806D221002F1CD7 /* mlo_utils.mm in Sources */, - 689EBB861806D22D002F1CD7 /* MLOGestureEngine.m in Sources */, - 689EBB871806D22D002F1CD7 /* MLOGestureFlick.m in Sources */, - 689EBB881806D22D002F1CD7 /* MLOGestureLimiter.m in Sources */, - 689EBB891806D22D002F1CD7 /* MLOManager.m in Sources */, - 689EBB8A1806D22D002F1CD7 /* MLOPostRenderManager.m in Sources */, - 689EBB8B1806D22D002F1CD7 /* MLORenderBuffer.m in Sources */, - 689EBB8C1806D22D002F1CD7 /* MLORenderingUIView.m in Sources */, - 689EBB8D1806D22D002F1CD7 /* MLORenderManager.m in Sources */, - 689EBB8E1806D22D002F1CD7 /* MLOScalingBuffer.m in Sources */, - 689EBB8F1806D22D002F1CD7 /* MLOAnimation.m in Sources */, - 689EBB901806D22D002F1CD7 /* MLOButton.m in Sources */, - 689EBB911806D22D002F1CD7 /* MLOObject.m in Sources */, - 689EBB921806D22D002F1CD7 /* MLOResourceImage.m in Sources */, - 689EBB931806D22D002F1CD7 /* MLOSubView.m in Sources */, - 689EBB941806D22D002F1CD7 /* MLOViewController.m in Sources */, - 689EBB951806D22D002F1CD7 /* NSObject+MLOUtils.m in Sources */, - 689EBB961806D22D002F1CD7 /* MLOMainViewController.m in Sources */, - 689EBB971806D22D002F1CD7 /* MLOTopbarViewController.m in Sources */, - 689EBB981806D22D002F1CD7 /* MLOScrollerData.m in Sources */, - 689EBB991806D22D002F1CD7 /* MLOScrollerGridViewController.m in Sources */, - 689EBB9A1806D22D002F1CD7 /* MLOScrollerTooltip.m in Sources */, - 689EBB9B1806D22D002F1CD7 /* MLOScrollerViewController.m in Sources */, - 689EBB9C1806D22D002F1CD7 /* MLOContextualMenuFocus.m in Sources */, - 689EBB9D1806D22D002F1CD7 /* MLOMagnifier.m in Sources */, - 689EBB9E1806D22D002F1CD7 /* MLOSelectionHandle.m in Sources */, - 689EBB9F1806D22D002F1CD7 /* MLOSelectionViewController.m in Sources */, - 689EBBA01806D22D002F1CD7 /* MLOThesaurusViewController.m in Sources */, - 689EBBA11806D22D002F1CD7 /* MLOFinder.m in Sources */, - 689EBBA21806D22D002F1CD7 /* MLOToolbarButton.m in Sources */, - 689EBBA31806D22D002F1CD7 /* MLOToolbarViewController.m in Sources */, - 88A2ED23180D4D7C009F39C0 /* MLOKeyboardManager.m in Sources */, - 889B7929180FF928005A3149 /* MLOAppRoleLoApp.m in Sources */, - 889B792C180FF967005A3149 /* MLOAppRoleTileTester.m in Sources */, - 889B7930180FFBA5005A3149 /* MLOAppRoleBase.m in Sources */, - 88A132FC181020320091F25E /* MLOTestingTileRendererViewController.m in Sources */, - 88A132FF1810204E0091F25E /* MLOTestingTileParametersViewController.m in Sources */, - 88A1330B1810213F0091F25E /* MLOAppRoleFactory.m in Sources */, - 88A13318181040BC0091F25E /* MLOTestingTileParameter.m in Sources */, - 88A083BA18115E8D009C75BE /* MLOTestingTile.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 68FDBE3618053A140064DD74 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 689EBADD1806975D002F1CD7 /* lo.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = armv7; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "MLO_APP_ROLE=LO_APP", - "DEBUG=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(LO_BUILDDIR)/config_host", - "$(LO_SRCDIR)/include", - "$(LO_WORKDIR)/UnoApiHeadersTarget/udkapi/comprehensive", - "$(LO_WORKDIR)/UnoApiHeadersTarget/offapi/comprehensive", - ); - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - STRIP_INSTALLED_PRODUCT = NO; - }; - name = Debug; - }; - 68FDBE3718053A140064DD74 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 689EBADD1806975D002F1CD7 /* lo.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = armv7; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PREPROCESSOR_DEFINITIONS = "MLO_APP_ROLE=LO_APP"; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(LO_BUILDDIR)/config_host", - "$(LO_SRCDIR)/include", - "$(LO_WORKDIR)/UnoApiHeadersTarget/udkapi/comprehensive", - "$(LO_WORKDIR)/UnoApiHeadersTarget/offapi/comprehensive", - ); - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - ONLY_ACTIVE_ARCH = NO; - SDKROOT = iphoneos; - STRIP_INSTALLED_PRODUCT = NO; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 68FDBE3918053A140064DD74 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/ios_sharedlo.dst; - GCC_DYNAMIC_NO_PIC = NO; - GCC_LINK_WITH_DYNAMIC_LIBRARIES = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ios_sharedlo/ios_sharedlo-Prefix.pch"; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VALID_ARCHS = "armv7 arm64"; - }; - name = Debug; - }; - 68FDBE3A18053A140064DD74 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/ios_sharedlo.dst; - GCC_DYNAMIC_NO_PIC = NO; - GCC_LINK_WITH_DYNAMIC_LIBRARIES = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ios_sharedlo/ios_sharedlo-Prefix.pch"; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VALID_ARCHS = "armv7 arm64"; - }; - name = Release; - }; - 88A1331218102A8F0091F25E /* Debug_tile_tester */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 689EBADD1806975D002F1CD7 /* lo.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = armv7; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "MLO_APP_ROLE=TILE_TESTER", - "DEBUG=1", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(LO_BUILDDIR)/config_host", - "$(LO_SRCDIR)/include", - "$(LO_WORKDIR)/UnoApiHeadersTarget/udkapi/comprehensive", - "$(LO_WORKDIR)/UnoApiHeadersTarget/offapi/comprehensive", - ); - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - ONLY_ACTIVE_ARCH = NO; - SDKROOT = iphoneos; - STRIP_INSTALLED_PRODUCT = NO; - }; - name = Debug_tile_tester; - }; - 88A1331318102A8F0091F25E /* Debug_tile_tester */ = { - isa = XCBuildConfiguration; - buildSettings = { - DSTROOT = /tmp/ios_sharedlo.dst; - GCC_DYNAMIC_NO_PIC = NO; - GCC_LINK_WITH_DYNAMIC_LIBRARIES = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ios_sharedlo/ios_sharedlo-Prefix.pch"; - LD_NO_PIE = NO; - LINK_WITH_STANDARD_LIBRARIES = NO; - LLVM_LTO = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VALID_ARCHS = "armv7 arm64"; - }; - name = Debug_tile_tester; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 68FDBE2518053A140064DD74 /* Build configuration list for PBXProject "ios_sharedlo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 68FDBE3618053A140064DD74 /* Debug */, - 88A1331218102A8F0091F25E /* Debug_tile_tester */, - 68FDBE3718053A140064DD74 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 68FDBE3818053A140064DD74 /* Build configuration list for PBXNativeTarget "ios_sharedlo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 68FDBE3918053A140064DD74 /* Debug */, - 88A1331318102A8F0091F25E /* Debug_tile_tester */, - 68FDBE3A18053A140064DD74 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 68FDBE2218053A140064DD74 /* Project object */; -} diff --git a/ios/shared/ios_sharedlo/cxx/mlo.h b/ios/shared/ios_sharedlo/cxx/mlo.h deleted file mode 100644 index 5055c3a633d6..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo.h +++ /dev/null @@ -1,19 +0,0 @@ -// -*- Mode: 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/. - -#ifdef __cplusplus -extern "C" { -#endif - - void mlo_initialize(void); - #ifdef __cplusplus -} -#endif - -// vim:set shiftwidth=4 softtabstop=4 expandtab: - diff --git a/ios/shared/ios_sharedlo/cxx/mlo.mm b/ios/shared/ios_sharedlo/cxx/mlo.mm deleted file mode 100644 index 4279d0d8a5d9..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo.mm +++ /dev/null @@ -1,75 +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 "MLOCommon.h" -//#include <stdlib.h> - -#include <premac.h> -#import <UIKit/UIKit.h> -#include <postmac.h> - -#include <touch/touch.h> -#undef TimeValue -#include <osl/process.h> - -// generated by solenv/bin/native-code.py: -#include "native-code.mm" - -NSString * createPaths(NSString * base,NSString * appRootEscaped,NSArray * fileNames){ - NSString * prefix = @"file://"; - BOOL first = YES; - - for (NSString * fileName in fileNames) { - - base = [base stringByAppendingString: prefix]; - - base = [base stringByAppendingString: [appRootEscaped stringByAppendingPathComponent: fileName]]; - - if(first){ - prefix = [@" " stringByAppendingString:prefix]; - first = NO; - } - } - - return base; -} - - -extern "C" -void -mlo_initialize(void) -{ - NSString * bundlePath = [[NSBundle mainBundle] bundlePath]; - - NSString * app_root_escaped = [bundlePath stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; - - NSString * uno_types = createPaths(@"-env:UNO_TYPES=", app_root_escaped, @[@"offapi.rdb", @"oovbaapi.rdb", @"types.rdb"]); - - NSString * uno_services = createPaths(@"-env:UNO_SERVICES=", app_root_escaped, @[@"ure/services.rdb", @"services.rdb"]); - - - const char *argv[] = { - [[[NSBundle mainBundle] executablePath] UTF8String], - "-env:URE_INTERNAL_LIB_DIR=file:///", - [uno_types UTF8String], - [uno_services UTF8String],"--writer"}; - - const int argc = sizeof(argv)/sizeof(*argv); - - osl_setCommandArgs(argc, (char **) argv); -} - -// Dummy implementation for now, probably this should be handled in a -// different way in each app that uses this "shared" library? Like -// most in touch.h, the dialog API is not set in stone yet. - -MLODialogResult touch_ui_dialog_modal(MLODialogKind kind, const char *message) -{ - NSLog(@"===> %s", message); - return MLODialogOK; -} diff --git a/ios/shared/ios_sharedlo/cxx/mlo_uno.h b/ios/shared/ios_sharedlo/cxx/mlo_uno.h deleted file mode 100644 index c1e499c53fc9..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo_uno.h +++ /dev/null @@ -1,33 +0,0 @@ -// -*- Mode: 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/. - -#ifndef __LibreOffice_mlo_uno__ -#define __LibreOffice_mlo_uno__ - -#ifdef __cplusplus -extern "C" { -#endif - - typedef enum {MARK_ALL,MARK_FIRST,MARK_NEXT,MARK_PREVIOUS} MLOFindSelectionType; - typedef enum {LAST_PAGE,CURRENT_PAGE} MLOGetPageType; - - BOOL mlo_is_document_open(void); - BOOL mlo_open_file(NSString * file); - void mlo_close(void); - long mlo_get_page_count(void); - long mlo_get_current_page(void); - int mlo_find(NSString * toSearch,MLOFindSelectionType type); - void mlo_get_selection(NSMutableString * mutableString); - void mlo_fetch_view_data(NSMutableString * mutableString); - void mlo_select_all(void); - void mlo_save(void); - -#ifdef __cplusplus -} -#endif -#endif /* defined(__LibreOffice_mlo_uno__) */ diff --git a/ios/shared/ios_sharedlo/cxx/mlo_uno.mm b/ios/shared/ios_sharedlo/cxx/mlo_uno.mm deleted file mode 100644 index 210732457dfc..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo_uno.mm +++ /dev/null @@ -1,513 +0,0 @@ -// -*- Mode: 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/. - -#include "mlo_uno.h" -#import "MLOCommon.h" -//#include <stdlib.h> - -#include <premac.h> -#import <UIKit/UIKit.h> -#include <postmac.h> - -#undef TimeValue -#include <osl/process.h> - -#include "cppuhelper/bootstrap.hxx" -#include "com/sun/star/lang/XMultiServiceFactory.hpp" -#include "com/sun/star/lang/XComponent.hpp" -#include "com/sun/star/frame/Desktop.hpp" -#include "com/sun/star/frame/XFrame.hpp" -#include "com/sun/star/frame/XDispatchProvider.hpp" -#include "com/sun/star/frame/XDispatchHelper.hpp" -#include <com/sun/star/frame/DispatchHelper.hpp> -#include "com/sun/star/frame/XComponentLoader.hpp" -#include "com/sun/star/frame/XStorable.hpp" -#include "com/sun/star/awt/XScrollBar.hpp" -#include <com/sun/star/container/XContentEnumerationAccess.hpp> -#include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> -#include <com/sun/star/text/XPageCursor.hpp> -#include <com/sun/star/text/XTextDocument.hpp> -#include <com/sun/star/text/XTextRange.hpp> -#include <com/sun/star/text/XTextTable.hpp> -#include <com/sun/star/text/XText.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/text/XTextViewCursorSupplier.hpp> -#include <com/sun/star/table/XCell.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> -#include <com/sun/star/document/XViewDataSupplier.hpp> -#include <com/sun/star/util/XSearchable.hpp> -#include <com/sun/star/util/XSearchDescriptor.hpp> -#include <com/sun/star/view/XSelectionSupplier.hpp> -#include <com/sun/star/uno/XInterface.hpp> - -using namespace com::sun::star::uno; -using namespace com::sun::star::awt; -using namespace com::sun::star::view; -using namespace com::sun::star::util; -using namespace com::sun::star::container; -using namespace com::sun::star::document; -using namespace com::sun::star::text; -using namespace com::sun::star::lang; -using namespace com::sun::star::frame; -using namespace com::sun::star::beans; -using namespace cppu; - - -#define OU(C_STRING) OUString::createFromAscii(C_STRING) - -#define LOG_EVAL(REF,NS_STRING) REF.get() ? NSLog(@"%@ created",NS_STRING) : NSLog(@"%@ is null",NS_STRING) - -// singletons - -Reference<XComponentContext> openedComponentContext; -Reference<XMultiComponentFactory> openedXComponentFactory; -Reference<XInterface> openedXDesktop; -Reference < XComponentLoader > openedXComponentLoader; - -// document singletons - -Reference<XComponent> openedXComponent; -Reference<XModel> openedXModel; -Reference<XTextViewCursorSupplier> openedXTextViewCursorSupplier; -Reference<XController> openedXController; -Reference<XPageCursor> openedXPageCursor; -Reference<XViewDataSupplier> openedXViewDataSupplier; -Reference<XSearchable> openedXSearchable; -Reference<XSelectionSupplier> openedXSelectionSupplier; -Reference<XFrame> openedXFrame; -Reference<XDispatchProvider> openedXDispatchProvider; -Reference<XStorable> openedXStorable; - -Reference<XIndexAccess> currentFindAll; -rtl::OUString lastSearch; -::sal_Int32 lastSearchIndex =-1; - -/// functions - -Reference< XComponentContext > getXComponentContext() -{ - if(!openedComponentContext.get()) - { - openedComponentContext.set(cppu::defaultBootstrap_InitialComponentContext()); - LOG_EVAL(openedComponentContext,@"XComponentContext"); - } - return openedComponentContext; -} - -Reference<XMultiComponentFactory> getXComponentFactory() -{ - if(!openedXComponentFactory.get()) - { - openedXComponentFactory.set(getXComponentContext()->getServiceManager()); - LOG_EVAL(openedXComponentFactory,@"XMultiComponentContext"); - } - return openedXComponentFactory; -} - -Reference<XInterface> getXDesktop() -{ - if(!openedXDesktop.get()) - { - openedXDesktop.set(getXComponentFactory()->createInstanceWithContext ( OU("com.sun.star.frame.Desktop"), getXComponentContext())); - LOG_EVAL(openedXDesktop, @"XDesktop"); - } - return openedXDesktop; -} - -Reference <XComponentLoader> getXComponentLoader() -{ - if(!openedXComponentLoader.get()) - { - openedXComponentLoader.set(Reference < XComponentLoader >( Desktop::create(getXComponentContext()))); - LOG_EVAL(openedXComponentLoader, @"XComponentLoader"); - } - return openedXComponentLoader; -} - -Reference<XModel> getXModel() -{ - if(!openedXModel.get()) - { - Reference<XModel> model(openedXComponent.get(), UNO_QUERY); - openedXModel.set(model); - LOG_EVAL(openedXModel, @"XModel"); - } - return openedXModel; -} - -Reference<XController> getXController() -{ - if(!openedXController.get()) - { - openedXController.set(getXModel()->getCurrentController()); - LOG_EVAL(openedXController, @"XController"); - } - return openedXController; -} - -Reference<XTextViewCursorSupplier> getXTextViewCursorSupplier() -{ - if(!openedXTextViewCursorSupplier.get()) - { - Reference<XTextViewCursorSupplier> supplier(getXController(), UNO_QUERY); - openedXTextViewCursorSupplier.set(supplier); - LOG_EVAL(openedXTextViewCursorSupplier, @"XTextViewCursorSupplier"); - } - return openedXTextViewCursorSupplier; -} - -Reference<XPageCursor> getXPageCursor() -{ - if(!openedXPageCursor.get()) - { - Reference<XPageCursor> cursor(getXTextViewCursorSupplier()->getViewCursor(), UNO_QUERY); - openedXPageCursor.set(cursor); - LOG_EVAL(openedXPageCursor, @"XPageCursor"); - } - return openedXPageCursor; -} - -Reference<XViewDataSupplier> getXViewDataSupplier() -{ - //if(!openedXViewDataSupplier.get()) - //{ - Reference<XViewDataSupplier> supplier(getXController(),UNO_QUERY); - openedXViewDataSupplier.set(supplier); - LOG_EVAL(openedXViewDataSupplier,@"XViewDataSupplier"); - //} - return openedXViewDataSupplier; -} - -Reference<XSearchable> getXSearchable() -{ - if(!openedXSearchable.get()) - { - Reference<XSearchable> xSearchable(getXModel(),UNO_QUERY); - openedXSearchable.set(xSearchable); - LOG_EVAL(openedXSearchable,@"XSearchable"); - } - return openedXSearchable; -} - -Reference<XSelectionSupplier> getXSelectionSupplier() -{ - if(!openedXSelectionSupplier.get()) - { - Reference<XSelectionSupplier> supplier(getXController(),UNO_QUERY); - openedXSelectionSupplier.set(supplier); - LOG_EVAL(openedXSelectionSupplier, @"XSelectionSupplier"); - } - return openedXSelectionSupplier; -} - -Reference<XFrame> getXFrame() -{ - if(!openedXFrame.get()) - { - openedXFrame.set(getXController()->getFrame()); - LOG_EVAL(openedXFrame, @"XFrame"); - } - return openedXFrame; -} - -Reference<XDispatchProvider> getXDispatchProvider() -{ - if(!openedXDispatchProvider.get()) - { - Reference<XDispatchProvider> provider(getXFrame(),UNO_QUERY); - openedXDispatchProvider.set(provider); - LOG_EVAL(openedXDispatchProvider, @"XDispatchProvider"); - } - return openedXDispatchProvider; -} - -Reference<XDispatchHelper> getXDispatchHelper() -{ - Reference<XDispatchHelper> helper = DispatchHelper::create(getXComponentContext()); - LOG_EVAL(helper, @"XDispatchHelper"); - return helper; -} - -Reference<XStorable> getXStorable() -{ - if(!openedXStorable.get()) - { - Reference<XStorable> stroable(getXModel(),UNO_QUERY); - openedXStorable.set(stroable); - LOG_EVAL(openedXStorable, @"XDispatchProvider"); - } - return openedXStorable; -} - -NSString * createFileUri(NSString * file) -{ - if(file==nil) - { - NSString * app_root_escaped = [[[NSBundle mainBundle] bundlePath] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; - file = [app_root_escaped stringByAppendingPathComponent:@"test1.odt"]; - } - else - { - file = [file stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - } - static NSString * prefix = @"file://"; - if(![file hasPrefix:prefix]) - { - return [prefix stringByAppendingString:file]; - } - return file; -} - -void postOpenUnoInitialization() -{ - getXController(); - getXSearchable(); -} - - -extern "C" -BOOL mlo_open_file(NSString* filepath) -{ - static const OUString TARGET = OU("_default"); - static const Sequence<PropertyValue> PROPS (0); - filepath = createFileUri(filepath); - NSLog(@"LO : Opening the file : %@",filepath ); - NSDate * loadStart = [NSDate date]; - getXDesktop(); - openedXComponent.set(getXComponentLoader()->loadComponentFromURL(OU([filepath UTF8String]),TARGET,0,PROPS)); - if(openedXComponent.get()) - { - NSLog(@"LO : XComponent opened succesffully. Duration: %f",[[NSDate date] timeIntervalSinceDate:loadStart]); - postOpenUnoInitialization(); - NSLog(@"LO : created document singletons"); - return YES; - } - return NO; -} - -void setLastSearch(OUString string) -{ - lastSearch = string; - lastSearchIndex = -1; - currentFindAll.clear(); -} - -void resetLastSearch() -{ - setLastSearch(OUString()); -} - -void convert(const OUString & source,NSMutableString * target) -{ - OString asOString = OUStringToOString( source, RTL_TEXTENCODING_ASCII_US ); - [target setString:[NSString stringWithUTF8String:asOString.getStr()]]; -} - -BOOL isResetSearch(NSString * toSearch) -{ - if(!toSearch || ([toSearch length] ==0)) - { - resetLastSearch(); - return YES; - } - return NO; -} - -void markFind(int searchIndex) -{ - Any currentFind= currentFindAll.get()->getByIndex(searchIndex); - getXSelectionSupplier()->select(currentFind); -} - -void markDeltaFind(int findCount,int delta) -{ - lastSearchIndex += delta; - if(lastSearchIndex == findCount) - { - lastSearchIndex=0; - } - else if(lastSearchIndex < 0) - { - lastSearchIndex = findCount-1; - } - markFind(lastSearchIndex); -} - -void markAllFinds(int findCount) -{ - for (int i = 0; i<findCount; i++) - { - markFind(i); - } -} - -void setCurrentFindAll(NSString * toSearch) -{ - const OUString current = OU([toSearch UTF8String]); - if(!lastSearch.equals(current)) - { - setLastSearch(current); - Reference<XSearchDescriptor> descriptor = getXSearchable()->createSearchDescriptor(); - descriptor->setSearchString(current); - currentFindAll.set(getXSearchable()->findAll(descriptor)); - } -} - -extern "C" -void mlo_close(void) -{ - if(openedXComponent.get()) - { - NSLog(@"Disposing of the XComponent for the opened document"); - openedXComponent->dispose(); - openedXComponent.clear(); - openedXModel.clear(); - openedXTextViewCursorSupplier.clear(); - openedXController.clear(); - openedXPageCursor.clear(); - openedXViewDataSupplier.clear(); - openedXSearchable.clear(); - openedXSelectionSupplier.clear(); - openedXFrame.clear(); - openedXDispatchProvider.clear(); - openedXStorable.clear(); - resetLastSearch(); - NSLog(@"XComponent disposed successfully"); - } -} - -long getLong(Reference<XPropertySet> & set,const OUString & name) -{ - if(set.get()) - { - return set->getPropertyValue(name).get<long>(); - } - return -666; -} - -int getInt(Reference<XPropertySet> & set,const OUString & name) -{ - return getLong(set, name); -} - -extern "C" -void mlo_fetch_view_data(NSMutableString * mutableString) -{ - Any any = getXController()->getViewData(); - OUString ou = any.get<OUString>(); - convert(ou, mutableString); -} - -extern "C" -long mlo_get_page_count() -{ - static const OUString PAGE_COUNT = OU("PageCount"); - Reference< XPropertySet > set( getXController(), UNO_QUERY ); - return getLong(set,PAGE_COUNT); -} - -extern "C" -long mlo_get_current_page() -{ - return getXPageCursor()->getPage(); -} - - -extern "C" -int mlo_find(NSString * toSearch,MLOFindSelectionType type) -{ - if(!isResetSearch(toSearch)) - { - setCurrentFindAll(toSearch); - if(currentFindAll.get()) - { - sal_Int32 count =currentFindAll.get()->getCount(); - if(count>0) - { - switch (type) - { - case MARK_ALL: - // mark all returns total count; - markAllFinds(count); - return count; - case MARK_FIRST: - // mark first returns total count - // index will be zero - markDeltaFind(count,1); - return count; - case MARK_NEXT: - // mark next returns the index - markDeltaFind(count, 1); - return lastSearchIndex; - case MARK_PREVIOUS: - // mark previous returns the last index - markDeltaFind(count, -1); - return lastSearchIndex; - } - } - } - } - return -1; -} - -extern "C" -void mlo_get_selection(NSMutableString * mutableString) -{ - OUString asOuString; - Reference<XInterface> currentSelection = getXModel()->getCurrentSelection(); - if(currentSelection.get()) - { - Reference< XIndexAccess > xIndexAccess( currentSelection, UNO_QUERY ); - if(xIndexAccess.get() && (xIndexAccess->getCount()>0)) - { - Reference< XTextRange > xTextRange(xIndexAccess->getByIndex(0),UNO_QUERY); - if(xTextRange.get()) - { - asOuString=xTextRange->getString(); - } - } - } - convert(asOuString, mutableString); -} - -extern "C" -BOOL mlo_is_document_open(void) -{ - return openedXComponent.is() ? YES : NO; -} - -extern "C" -void mlo_select_all(void) -{ - getXDispatchHelper()->executeDispatch(getXDispatchProvider(), - OUString(".uno:SelectAll"), - OUString("_self"), - 0, - Sequence<PropertyValue >()); -} - -extern "C" -void mlo_save(void) -{ - if(mlo_is_document_open()) - { - Reference<XStorable> storable =getXStorable(); - if(storable->isReadonly()) - { - NSLog(@"Cannot save changes. File is read only"); - } - else - { - storable->store(); - NSLog(@"saved changes"); - } - } -}
\ No newline at end of file diff --git a/ios/shared/ios_sharedlo/cxx/mlo_utils.h b/ios/shared/ios_sharedlo/cxx/mlo_utils.h deleted file mode 100644 index a2cd5f744478..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo_utils.h +++ /dev/null @@ -1,22 +0,0 @@ -// -*- Mode: 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/. - -#ifndef __LibreOffice_mlo_utils__ -#define __LibreOffice_mlo_utils__ - -#ifdef __cplusplus -extern "C" { -#endif - - CGFloat max(CGFloat a,CGFloat b); - CGFloat min(CGFloat a,CGFloat b); - -#ifdef __cplusplus -} -#endif -#endif /* defined(__Mobile_LibreOffice_lo_utils__) */ diff --git a/ios/shared/ios_sharedlo/cxx/mlo_utils.mm b/ios/shared/ios_sharedlo/cxx/mlo_utils.mm deleted file mode 100644 index 07c87fe41de2..000000000000 --- a/ios/shared/ios_sharedlo/cxx/mlo_utils.mm +++ /dev/null @@ -1,16 +0,0 @@ -// -*- Mode: 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/. - -#include "mlo_utils.h" - -CGFloat max(CGFloat a,CGFloat b){ - return a>b? a:b; -} -CGFloat min(CGFloat a,CGFloat b){ - return a<b? a:b; -} diff --git a/ios/shared/ios_sharedlo/cxx/time.h b/ios/shared/ios_sharedlo/cxx/time.h deleted file mode 100644 index c6f727bc7f50..000000000000 --- a/ios/shared/ios_sharedlo/cxx/time.h +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _OSL_TIME_H_ -#define _OSL_TIME_H_ - -#include "sal/config.h" - -#include "sal/saldllapi.h" -#include "sal/types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************/ -/* TimeValue */ -/****************************************************************************/ - -#ifdef SAL_W32 -# pragma pack(push, 8) -#endif - -/* Time since Jan-01-1970 */ - -typedef struct { - sal_uInt32 Seconds; - sal_uInt32 Nanosec; -} TimeValueX; - -#if defined(SAL_W32) -# pragma pack(pop) -#endif - - -/****************************************************************************/ -/* oslDateTime */ -/****************************************************************************/ - -typedef struct _oslDateTime -{ - /*----------------------------------------------------------------------*/ - /** contains the nanoseconds . - */ - sal_uInt32 NanoSeconds; - - /** contains the seconds (0-59). - */ - sal_uInt16 Seconds; - - /*----------------------------------------------------------------------*/ - /** contains the minutes (0-59). - */ - sal_uInt16 Minutes; - - /*----------------------------------------------------------------------*/ - /** contains the hour (0-23). - */ - sal_uInt16 Hours; - - /*----------------------------------------------------------------------*/ - /** is the day of month (1-31). - */ - sal_uInt16 Day; - - /*----------------------------------------------------------------------*/ - /** is the day of week (0-6 , 0 : Sunday). - */ - sal_uInt16 DayOfWeek; - - /*----------------------------------------------------------------------*/ - /** is the month of year (1-12). - */ - sal_uInt16 Month; - - /*----------------------------------------------------------------------*/ - /** is the year. - */ - sal_uInt16 Year; - -} oslDateTime; - - -/** Get the current system time as TimeValue. - @return false if any error occurs. -*/ -SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getSystemTime( - TimeValue* pTimeVal ); - - -/** Get the GMT from a TimeValue and fill a struct oslDateTime - @param[in] pTimeVal TimeValue - @param[out] pDateTime On success it receives a struct oslDateTime - - @return sal_False if any error occurs else sal_True. -*/ -SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getDateTimeFromTimeValue( - TimeValue* pTimeVal, oslDateTime* pDateTime ); - - -/** Get the GMT from a oslDateTime and fill a TimeValue - @param[in] pDateTime oslDateTime - @param[out] pTimeVal On success it receives a TimeValue - - @return sal_False if any error occurs else sal_True. -*/ -SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getTimeValueFromDateTime( - oslDateTime* pDateTime, TimeValue* pTimeVal ); - - -/** Convert GMT to local time - @param[in] pSystemTimeVal system time to convert - @param[out] pLocalTimeVal On success it receives the local time - - @return sal_False if any error occurs else sal_True. -*/ -SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getLocalTimeFromSystemTime( - TimeValue* pSystemTimeVal, TimeValue* pLocalTimeVal ); - - -/** Convert local time to GMT - @param[in] pLocalTimeVal local time to convert - @param[out] pSystemTimeVal On success it receives the system time - - @return sal_False if any error occurs else sal_True. -*/ -SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getSystemTimeFromLocalTime( - TimeValue* pLocalTimeVal, TimeValue* pSystemTimeVal ); - - -/** Get the value of the global timer - @return current timer value in milli seconds - */ - -SAL_DLLPUBLIC sal_uInt32 SAL_CALL osl_getGlobalTimer(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _OSL_TIME_H_ */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ios/shared/ios_sharedlo/ios_sharedlo-Prefix.pch b/ios/shared/ios_sharedlo/ios_sharedlo-Prefix.pch deleted file mode 100644 index bf8cad8036ba..000000000000 --- a/ios/shared/ios_sharedlo/ios_sharedlo-Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'ios_sharedlo' target in the 'ios_sharedlo' project -// - -#ifdef __OBJC__ - #import <UIKit/UIKit.h> - #import <Foundation/Foundation.h> -#endif diff --git a/ios/shared/ios_sharedlo/ios_sharedlo.h b/ios/shared/ios_sharedlo/ios_sharedlo.h deleted file mode 100644 index 103a83f481f0..000000000000 --- a/ios/shared/ios_sharedlo/ios_sharedlo.h +++ /dev/null @@ -1,13 +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> - -@interface ios_sharedlo : NSObject - -@end diff --git a/ios/shared/ios_sharedlo/ios_sharedlo.m b/ios/shared/ios_sharedlo/ios_sharedlo.m deleted file mode 100644 index 560180cef051..000000000000 --- a/ios/shared/ios_sharedlo/ios_sharedlo.m +++ /dev/null @@ -1,13 +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 "ios_sharedlo.h" - -@implementation ios_sharedlo - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/MLOInvoker.h b/ios/shared/ios_sharedlo/objective_c/MLOInvoker.h deleted file mode 100644 index 6216b55bf599..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/MLOInvoker.h +++ /dev/null @@ -1,24 +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/. -// -// MLOInvoker.h -// CloudOn_LO_PoC -// - -#import <Foundation/Foundation.h> - -@protocol MLOInvoker <NSObject> - --(void)willShowLibreOffice; --(void)didShowLibreOffice; - --(void)willHideLibreOffice; --(void)didHideLibreOffice; - --(CGRect) bounds; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/MLOManager.h b/ios/shared/ios_sharedlo/objective_c/MLOManager.h deleted file mode 100644 index 534613a4069e..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/MLOManager.h +++ /dev/null @@ -1,25 +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 "MLOObject.h" -#import "MLOInvoker.h" - -@class MLOMainViewController; -@interface MLOManager : UIResponder <UIApplicationDelegate> -@property MLOMainViewController * mainViewController; - -+(MLOManager *) getInstance; - --(void)openInLibreOfficeFilePath:(NSString *) filePath fileNameWithExtension:(NSString *) fileName superView:(UIView *) superview window:(UIWindow *) window invoker:(NSObject<MLOInvoker> *) invoker; --(void)openInLibreOfficeFilePath:(NSString *) filePath superView:(UIView *) superview window:(UIWindow *) window invoker:(NSObject<MLOInvoker> *) invoker; --(void) hideLibreOffice; --(NSString *)filenameWithExtension; --(NSString *)extension; --(CGRect)bounds; --(void)start; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/MLOManager.m b/ios/shared/ios_sharedlo/objective_c/MLOManager.m deleted file mode 100644 index 466f9f34f0d5..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/MLOManager.m +++ /dev/null @@ -1,198 +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 "MLOManager.h" -#import "MLOMainViewController.h" -#import "MLOInvoker.h" -#include "touch/touch.h" - -#import "mlo.h" -#import "mlo_uno.h" - -#define APP_STUB_DEF (UIApplication *) X { (void) X;} - -static MLOManager * instance = nil; - -static const NSTimeInterval FADE_IN_DURATION = 0.3; - -@interface MLOManager () - -@property NSObject<MLOInvoker> * invoker; -@property NSString * openedFileNameWithExtension; -@property NSString * openedFilePath; - -@end - -@implementation MLOManager - --(id) init{ - self = [super init]; - - if (self) { - self.mainViewController = nil; - self.invoker = nil; - [self resetOpenedFile]; - } - return self; -} - --(BOOL)isInit{ - return self.mainViewController != nil; -} - -- (void)applicationDidEnterBackground: APP_STUB_DEF -- (void)applicationWillEnterForeground: APP_STUB_DEF -- (void)applicationDidBecomeActive: APP_STUB_DEF -- (void)applicationWillTerminate: APP_STUB_DEF - - -- (void)applicationWillResignActive:(UIApplication *) application{ - if (_mainViewController) { - [_mainViewController hideLibreOffice]; - } -} - --(BOOL)application:(UIApplication *) application didFinishLaunchingWithOptions:(NSDictionary *) launchOptions{ - - return YES; -} - -- (void)application:(UIApplication *)application didChangeStatusBarFrame:(CGRect)oldStatusBarFrame -{ - IGNORE_ARG(application); - - IGNORE_ARG(oldStatusBarFrame); - - [self.mainViewController rotate]; -} - --(void)start{ - - NSLog(@"L O : START LIBREOFFICE"); - - if (![self isInit]) { - - NSLog(@"L O : BEGINNING INITIALIZATION"); - - [self initLo]; - - NSLog(@"L O : INITIALIZATION COMPLETED!!!"); - }else{ - NSLog(@"L O : SKIPPED. ALREADY INITIALIZED."); - } -} - -+(MLOManager *) getInstance{ - if(instance ==nil){ - instance = [self new]; - } - return instance; -} - --(void) initLo{ - - self.mainViewController = [MLOMainViewController new]; - - [[[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:nil] start]; - -} - --(void)addLibreOfficeAsSubview:(UIView * ) superview{ - - self.mainViewController.view.alpha = 0; - - [superview addSubview: self.mainViewController.view]; - - [UIView animateWithDuration:FADE_IN_DURATION animations:^(){ - self.mainViewController.view.alpha = 1; - }]; -} - --(void)showLibreOfficeAfterAddingToSuperView:(UIWindow *) window{ - window.backgroundColor = [UIColor whiteColor]; - - [_mainViewController showLibreOffice:window]; -} - -- (void)threadMainMethod:(id)argument -{ - IGNORE_ARG(argument); - - @autoreleasepool { - NSLog(@"CALLING mlo_initialize"); - - mlo_initialize(); - - NSLog(@"touch_lo_runMain RETURNED\r\n\r\nCALLING lo_runMain"); - - touch_lo_runMain(); - - NSLog(@"lo_runMain RETURNED"); - } -} - --(void) hideLibreOffice{ - - [self.invoker willHideLibreOffice]; - - mlo_close(); - - [self resetOpenedFile]; - - [self.mainViewController.view removeFromSuperview]; - - [self.invoker didHideLibreOffice]; - -} - --(CGRect) bounds{ - return [self.invoker bounds]; -} - --(void)resetOpenedFile{ - self.openedFileNameWithExtension = nil; - self.openedFilePath = nil; -} - --(void)openInLibreOfficeFilePath:(NSString *) filePath fileNameWithExtension:(NSString *) fileNameWithExtension superView:(UIView *) superview window:(UIWindow *) window invoker: -(NSObject<MLOInvoker> *) invoker{ - self.invoker = invoker; - self.openedFileNameWithExtension = fileNameWithExtension; - self.openedFilePath = filePath; - if(mlo_open_file(filePath)){ - [invoker willShowLibreOffice]; - [self addLibreOfficeAsSubview:superview]; - [self showLibreOfficeAfterAddingToSuperView:window]; - [invoker didShowLibreOffice]; - }else{ - [self hideLibreOffice]; - - } -} - --(void)openInLibreOfficeFilePath:(NSString *) filePath superView:(UIView *) superview window:(UIWindow *) window invoker:(NSObject<MLOInvoker> *) invoker{ - [self openInLibreOfficeFilePath:filePath - fileNameWithExtension:[filePath lastPathComponent] - superView:superview - window:window - invoker:invoker]; -} - - --(NSString *)extension{ - - NSString * extension= [self.openedFilePath pathExtension]; - NSLog(@"File extension is %@",extension); - return extension; -} --(NSString *)filenameWithExtension{ - NSLog(@"Filename with extension is %@",self.openedFileNameWithExtension); - return self.openedFileNameWithExtension; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.h b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.h deleted file mode 100644 index 4466dbe6968c..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.h +++ /dev/null @@ -1,19 +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 "MLOObject.h" - -@class MLOMainViewController; - -@interface MLOGestureEngine : MLOObject --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void)showLibreOffice:(UIWindow *) window; --(void)hideLibreOffice; --(void)reset; --(void)onRotate; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.m b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.m deleted file mode 100644 index f2a6f8ec6814..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine.m +++ /dev/null @@ -1,476 +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 "MLOAnimation.h" -#import "MLOMainViewController_Friend.h" -#import "MLORenderManager_Impl.h" -#import "MLOSelectionViewController.h" -#import "MLOScrollerViewController.h" -#import "MLOGestureFlick.h" -#import "MLOScrollerData.h" -#import "MLOGestureLimiter.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOKeyboardManager.h" -#import "mlo.h" -#import "mlo_utils.h" -#include <touch/touch.h> - -static const CGFloat - DOUBLE_TAP_ZOOM_IN=300.0f, - DOUBLE_TAP_ZOOM_OUT=100.0f, - DOUBLE_TAP_ZOOM_DURATION=0.7f, - DOUBLE_TAP_FPS_RATIO=0.5f, - DOUBLE_TAP_FPS=50.0f; - -static const BOOL ENABLE_LO_EVENTS_DURING_PINCH = NO; - -@interface MLOGestureEngine () -@property BOOL listening; -@property BOOL doubleTapped; -@property NSInteger handledGesturesCount; -@property CGPoint pinchCenter; -@property CGPoint panPrevious; -@property CGPoint dragStart; -@property NSArray * gestureRecognizers; -@property UIWindow * window; -@end - -@implementation MLOGestureEngine - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [self init]; - if(self){ - self.mainViewController = mainViewController; - self.renderer = [MLORenderManager getInstance]; - self.selection = mainViewController.selection; - self.scroller = mainViewController.scroller; - self.flick = [[MLOGestureFlick alloc] initWithEngine:self]; - self.dragStart= self.panPrevious = self.pinchCenter = CGPointMake(0,0); - self.limiter = [[MLOGestureLimiter alloc] initWithGestureEngine:self]; - self.window = nil; - self.focused =NO; - self.listening = NO; - [self reset]; - } - - return self; -} - --(void) createListeners:(UIWindow *) window{ - - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; - UITapGestureRecognizer * doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)]; - doubleTap.numberOfTapsRequired =2; - doubleTap.numberOfTouchesRequired=1; - [tap requireGestureRecognizerToFail:doubleTap]; - - self.gestureRecognizers = @[tap, - doubleTap, - [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)], - [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(drag:)], - [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)]]; - - -} - --(void)gestureRecognizersEnable:(BOOL) enable{ - for(UIGestureRecognizer * recognizer in self.gestureRecognizers){ - if(enable){ - [self.window addGestureRecognizer:recognizer]; - }else{ - [self.window removeGestureRecognizer:recognizer]; - } - } -} - --(void)showLibreOffice:(UIWindow *)window{ - - self.window = window; - - if(!_listening) { - - [self createListeners:window]; - _listening = YES; - } - - [self gestureRecognizersEnable:YES]; - - [_renderer showLibreOffice:self]; - _focused = YES; - [self reset]; - [self.limiter showLibreOffice]; -} - --(void)hideLibreOffice{ - - [self onGestureInterrupt]; - - [_renderer hideLibreOffice]; - - [_selection reset]; - - [self gestureRecognizersEnable:NO]; - - self.window = nil; - - _focused = NO; -} - - - --(void)drag:(UILongPressGestureRecognizer *) gesture{ - - if(_focused){ - - CGPoint point = [gesture locationInView:_renderer.view]; - - if([_mainViewController.canvas pointInside:point withEvent:nil]){ - - [_selection hide]; - - UIGestureRecognizerState state = gesture.state; - - NSLog(@"MLO gesture engine long press state %d in point: (%f,%f)",state ,point.x,point.y); - - if(state == UIGestureRecognizerStateBegan) { - - self.dragStart = point; - - touch_lo_mouse_drag(point.x, point.y, DOWN); - - } else if(state == UIGestureRecognizerStateChanged) { - - touch_lo_mouse_drag(point.x, point.y, MOVE); - - [_selection showBetweenFinger:point andPreviousPoint:self.dragStart showMenu:NO]; - - } else if(state == UIGestureRecognizerStateEnded) { - - touch_lo_mouse_drag(point.x, point.y, UP); - - [_selection showBetweenFinger:point andPreviousPoint:self.dragStart showMenu:YES]; - } - [self evalGestureCount: state]; - } - } -} - -- (void)tap:(UITapGestureRecognizer *)gesture -{ - [self tapGeneric:gesture name:@"tap" requiresTappable:YES action:^(CGPoint location){ - - touch_lo_tap(location.x, location.y); - - [self.mainViewController.keyboard show]; - - }]; - -} - --(void) doubleTap:(UITapGestureRecognizer *)gesture{ - [self tapGeneric:gesture name:@"double tap" requiresTappable:NO action:^(CGPoint location){ - - __block CGFloat initialZoom = [_limiter zoom]; - - CGFloat targetZoom = _doubleTapped ? DOUBLE_TAP_ZOOM_OUT : DOUBLE_TAP_ZOOM_IN; - CGFloat deltaZoom = targetZoom - initialZoom; - - if(LOG_DOUBLE_TAP){ - NSLog(@"DoubleTap currentZoom=%f targetZoom=%f",initialZoom,targetZoom); - } - - [self pinch:location scale:1.0f state:UIGestureRecognizerStateBegan]; - - MLOAnimation * animation= - [[MLOAnimation alloc] - initWithBehavior: MANDATORY - fractionType: FULL_FRACTION - animation: ^(CGFloat fraction){ - [self pinch: location - scale: (initialZoom + deltaZoom *fraction)/ initialZoom - state: UIGestureRecognizerStateChanged]; - }]; - - animation.fps = DOUBLE_TAP_FPS; - animation.duration = DOUBLE_TAP_ZOOM_DURATION; - [animation linearCurve]; - animation.endBlock = ^(void){ - - [self pinch:location - scale:targetZoom / initialZoom - state:UIGestureRecognizerStateEnded]; - - }; - [_currentAnimation cancel]; - self.currentAnimation = animation; - - [animation animate]; - - _doubleTapped^=YES; - - }]; -} - - --(void)tapGeneric:(UITapGestureRecognizer *) gesture - name:(NSString *) name - requiresTappable:(BOOL) isRequiresTappable - action:(void (^)(CGPoint location)) doTap { - - if(_focused){ - - UIGestureRecognizerState state = gesture.state; - - if (state == UIGestureRecognizerStateEnded) { - - [self onGestureInterrupt]; - - CGPoint point = [gesture locationInView: _renderer.view]; - - if([_mainViewController.canvas pointInside:point withEvent:nil]){ - - if(!isRequiresTappable || [_mainViewController isTappable]){ - - NSLog(@"%@: at: (%d,%d)",name, (int)point.x, (int)point.y); - doTap(point); - - }else{ - NSLog(@"%@ gesture aborted - main view controller is not tappable",name); - } - } - } else{ - NSLog(@"%@ Gesture: %@", name, gesture); - } - - [self evalGestureCount:state]; - } -} - - --(void)onScroll:(UIGestureRecognizerState) state deltaY:(CGFloat) deltaY{ - if((state ==UIGestureRecognizerStateEnded)|| - (state == UIGestureRecognizerStateBegan)){ - [_scroller updateByLogic]; - }else{ - [_scroller updateByPixelDeltaY:deltaY]; - } - [self evalGestureCount: state]; - -} - - -- (void)pan:(UIPanGestureRecognizer *)gesture{ - if(_focused){ - - CGPoint location = [gesture locationInView:_renderer.view]; - - UIGestureRecognizerState state = gesture.state; - - if(![_selection handleMoveAtPoint:location gestureState:state] && - [_mainViewController.canvas pointInside:location withEvent:nil]){ - - if(state != UIGestureRecognizerStateBegan){ - - NSInteger deltaX = location.x - self.panPrevious.x; - NSInteger deltaY = location.y - self.panPrevious.y; - - [self loPanDeltaX:deltaX deltaY:deltaY state:state]; - } - - [self evalGestureCount:state]; - - self.panPrevious = location; - - if(![_flick eval:gesture] && - (state == UIGestureRecognizerStateEnded)){ - - [self endPan]; - } - - } - } -} - --(void)endFlick{ - [self endPan]; - [self onScroll:UIGestureRecognizerStateEnded deltaY:0.0f]; -} - --(void) endPan{ - NSLog(@"PAN ENDED"); - [_renderer endGestures]; -} - --(BOOL) loPanDeltaX:(NSInteger) rawDeltaX deltaY:(NSInteger) rawDeltaY state:(UIGestureRecognizerState) state{ - - CGFloat limitedDeltaX = [_limiter limitDelta:rawDeltaX direction:DELTA_X]; - CGFloat limitedDeltaY = [_limiter limitDelta:rawDeltaY direction:DELTA_Y]; - - if((limitedDeltaX!=0.0f) - || (limitedDeltaY!=0.0f)){ - - if(LOG_PAN){ - [_limiter logPanRawDeltaX:rawDeltaX - rawDeltaY:rawDeltaY - limitedDeltaX:limitedDeltaX - limitedDeltaY:limitedDeltaY]; - } - - [_mainViewController.renderManager panDeltaX:(CGFloat)limitedDeltaX - deltaY:(CGFloat)limitedDeltaY]; - - - [self onScroll:state deltaY: limitedDeltaY]; - - touch_lo_pan(limitedDeltaX, limitedDeltaY); - - return YES; - } - return NO; -} - -- (void)pinch:(UIPinchGestureRecognizer *)gesture -{ - if(_focused){ - - if(gesture.numberOfTouches>1){ - self.pinchCenter = [gesture locationInView:_renderer.view]; - } - - [self pinch:self.pinchCenter scale:[gesture scale] state:gesture.state]; - - } -} - --(void)pinch:(CGPoint) location scale:(CGFloat) scale state:(UIGestureRecognizerState) state{ - - [_selection hide]; - - if(state ==UIGestureRecognizerStateBegan){ - self.panPrevious = location; - [_limiter beginPinch]; - }else{ - - CGFloat scaleRatioToLastScale = [_limiter inPinchGetRatioToLastScale:scale]; - CGFloat deltaX = (location.x - self.panPrevious.x)*scaleRatioToLastScale; - CGFloat deltaY = (location.y - self.panPrevious.y)*scaleRatioToLastScale; - - deltaX = [_limiter limitDelta:deltaX direction:DELTA_X]; - deltaY = [_limiter limitDelta:deltaY direction:DELTA_Y]; - - self.panPrevious = location; - - if(ENABLE_PINCH_RENDERING_VIA_IOS){ - - [_renderer pinchDeltaX:deltaX - deltaY:deltaY - scale:[_limiter currentPinchScale]]; - - if(ENABLE_LO_EVENTS_DURING_PINCH){ - [_limiter fireLoZoomEventsDuringPinch]; - } - - if(state==UIGestureRecognizerStateEnded){ - - CGPoint shift = [_renderer getShiftFromCanvasCenter]; - - [_renderer endGestures]; - - [self loZoomDeltaX:shift.x - deltaY:shift.y - scale:[_limiter endPinchAndGetScaleForLo:scale]]; - - } - - }else{ - [self loZoomDeltaX:deltaX deltaY:deltaY scale:scaleRatioToLastScale]; - } - } - - [self onScroll:state deltaY:0]; -} --(void)loZoomDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY scale:(CGFloat) scale{ - NSInteger xInt = deltaX; - NSInteger yInt = deltaY; - - if(LOG_PINCH){ - NSLog(@"touch_lo_zoom: (%d,%d) scale=%f",xInt,yInt, scale); - } - - touch_lo_zoom(xInt, yInt, (float)scale); -} - - - --(void)onGestureInterrupt{ - [_selection hide]; - [_currentAnimation cancel]; - -} - --(void)evalGestureCount:(UIGestureRecognizerState) state{ - if(state == UIGestureRecognizerStateBegan){ - - _handledGesturesCount++; - - }else if(state == UIGestureRecognizerStateCancelled || - state == UIGestureRecognizerStateEnded || - state == UIGestureRecognizerStateFailed){ - - _handledGesturesCount--; - - if(_handledGesturesCount==0){ - [_scroller fadeOut]; - } else if(_handledGesturesCount < 0){ - self.handledGesturesCount = 0; - } - } -} - -- (void)onKeyboardShow{ - if(_focused){ - - [_selection hide]; - } -} - -- (void)onKeyboardHide{ - -} - --(void)reset{ - self.doubleTapped = NO; - self.handledGesturesCount = 0; -} - --(void)onRotate{ - self.handledGesturesCount=0; - [_limiter onRotate]; -} - -@end - -void touch_ui_selection_start(MLOSelectionKind kind, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount, - void *preview){ - // Note that this is called on the LO thread - NSLog(@"==> touch_ui_selection_start"); - for(size_t i = 0; i < rectangleCount; ++i){ - NSLog(@" %fx%f@(%f,%f)", - rectangles[i].size.width, - rectangles[i].size.height, - rectangles[i].origin.x, - rectangles[i].origin.y); - } -} - -void touch_ui_selection_none(){ - // STUB -} diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine_Impl.h b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine_Impl.h deleted file mode 100644 index bcf163a47939..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureEngine_Impl.h +++ /dev/null @@ -1,35 +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 "MLOGestureEngine.h" - -@class MLOGestureFlick, - MLOMainViewController, - MLOSelectionViewController, - MLOScrollerViewController, - MLOAnimation, - MLORenderManager, - MLOGestureLimiter; - -@interface MLOGestureEngine () - -@property MLOMainViewController * mainViewController; -@property MLOSelectionViewController * selection; -@property MLOScrollerViewController * scroller; -@property MLOAnimation * currentAnimation; -@property MLOGestureFlick * flick; -@property MLORenderManager * renderer; -@property MLOGestureLimiter * limiter; -@property BOOL focused; --(NSInteger) handledGesturesCount; --(BOOL) loPanDeltaX:(NSInteger) rawDeltaX deltaY:(NSInteger) rawDeltaY state:(UIGestureRecognizerState) state; --(void)loZoomDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY scale:(CGFloat) scale; --(void) onKeyboardShow; --(void) onKeyboardHide; --(void) endFlick; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.h b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.h deleted file mode 100644 index 744928e1fbc6..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.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 "MLOObject.h" - -@class MLOGestureEngine,UIPanGestureRecognizer; -@interface MLOGestureFlick : MLOObject - --(id)initWithEngine:(MLOGestureEngine *) engine; --(BOOL)eval:(UIPanGestureRecognizer *) pan; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.m b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.m deleted file mode 100644 index bc109f225120..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureFlick.m +++ /dev/null @@ -1,224 +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 "MLOGestureFlick.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOMainViewController.h" -#import "MLOScrollerViewController.h" -#import "MLORenderManager.h" -#import "MLOAnimation.h" -#import "mlo_utils.h" - -@interface MLOGestureFlick () -@property MLOGestureEngine * engine; -@property CFTimeInterval startTime; -@property CGPoint startPoint; -@property CGFloat xFlickSpeed,yFlickSpeed; -@property BOOL isEvaluatingFlic; -@end - -static const CGFloat - MAX_SPEED = MLO_IPAD_HEIGHT_IN_PIXELS/0.5f, // max speed is the height per half a second - MAX_DURATION = 5.0f, // 5 seconds flic top - DECCELERATION = 800.0f, - SPEED_IGNORE_LIMIT=2.0f, - FLICK_FPS=50.0f; - -static const NSTimeInterval - MAX_INTERVAL_BETWEEN_EVENTS_THRESHOLD=0.7f; // 70% a second - -@implementation MLOGestureFlick - --(CGFloat) normalizeSpeed:(CGFloat) gestureSpeed currentSpeed:(CGFloat) currentSpeed{ - NSLog(@"GestureSpeed=%f currentSpeed=%f",gestureSpeed,currentSpeed); - if(currentSpeed* gestureSpeed > 0){ - gestureSpeed+=currentSpeed; - } - if(gestureSpeed > MAX_SPEED){ - return MAX_SPEED; - } - if (gestureSpeed < -MAX_SPEED){ - return -MAX_SPEED; - } - if (abs(gestureSpeed) < SPEED_IGNORE_LIMIT) { - return 0; - } - return gestureSpeed; - -} --(id)initWithEngine:(MLOGestureEngine *) engine{ - - self = [self init]; - - if(self){ - self.engine = engine; - _startTime = -1; - _yFlickSpeed= _xFlickSpeed=0.0f; - _isEvaluatingFlic =NO; - } - return self; -} - --(BOOL)eval:(UIGestureRecognizer *) gesture{ - - BOOL returned = NO; - - UIGestureRecognizerState state = gesture.state; - - if(state == UIGestureRecognizerStateBegan){ - self.isEvaluatingFlic = YES; - - self.startTime = CACurrentMediaTime(); - self.startPoint = [gesture locationInView:_engine.renderer.view]; - - }else if(state == UIGestureRecognizerStateFailed - || state == UIGestureRecognizerStateCancelled){ - self.startTime = -1; - self.isEvaluatingFlic =NO; - - }else{ - - if(state == UIGestureRecognizerStateEnded){ - - CFTimeInterval startTime = self.startTime; - - CGFloat xSpeed = self.xFlickSpeed; - CGFloat ySpeed = self.yFlickSpeed; - - [_engine.currentAnimation cancel]; - - if(startTime > 0){ - - CGPoint t0 =self.startPoint; - - CFTimeInterval deltaT = CACurrentMediaTime() - startTime; - - self.startTime =-1; - - if( (deltaT < MAX_INTERVAL_BETWEEN_EVENTS_THRESHOLD) && - (deltaT > 0) && - (_engine.handledGesturesCount == 0)){ - - CGPoint t1 = [gesture locationInView:_engine.renderer.view]; - - - returned = [self flicXSpeed: [self normalizeSpeed: (t1.x - t0.x) / deltaT - currentSpeed: xSpeed] - ySpeed: [self normalizeSpeed: (t1.y - t0.y) / deltaT - currentSpeed: ySpeed]]; - } - } - - self.isEvaluatingFlic =NO; - } - } - - return returned; - -} - --(BOOL)flicXSpeed:(CGFloat) xSpeedInitial ySpeed:(CGFloat) ySpeedInitial{ - - if((xSpeedInitial !=0) || (ySpeedInitial!=0)) { - - NSLog(@"FLIC: xSpeed=%f ySpeed=%f",xSpeedInitial, ySpeedInitial); - - __block CGFloat xDistanceTotal = 0,yDistanceTotal=0; - - const CGFloat maxSpeedVector = max( abs(xSpeedInitial) , abs(ySpeedInitial) ); - const CGFloat duration =min( maxSpeedVector / DECCELERATION , MAX_DURATION ); - const CGFloat deccelerationRate = maxSpeedVector / duration; - const CGFloat xSign= xSpeedInitial<0? -1: 1; - const CGFloat ySign= ySpeedInitial<0? -1: 1; - - MLOScrollerViewController * scroller = _engine.scroller; - - __block MLOAnimation * copy = nil; - - MLOAnimation * animation = - [[MLOAnimation alloc] - initWithBehavior: CANCELABLE - fractionType: FULL_FRACTION - animation: ^(CGFloat fraction){ - - CGFloat time = fraction * duration; - CGFloat reducedSpeed = deccelerationRate* time; - CGFloat decelerationDistance = reducedSpeed *time / 2.0f; - - CGFloat xDistanceCurrent = xSpeedInitial *time; - CGFloat yDistanceCurrent = ySpeedInitial *time; - CGFloat xSpeedCurrent = 0; - CGFloat ySpeedCurrent = 0; - - if(xSign*xDistanceCurrent > decelerationDistance){ - xDistanceCurrent -= (xSign * decelerationDistance); - xSpeedCurrent = xSpeedInitial - xSign * reducedSpeed; - }else{ - xDistanceCurrent = xDistanceTotal; - } - - if(ySign*yDistanceCurrent > decelerationDistance){ - yDistanceCurrent -= (ySign * decelerationDistance); - ySpeedCurrent = ySpeedInitial - ySign * reducedSpeed; - - }else{ - yDistanceCurrent = yDistanceTotal; - } - - [self setFlicSpeedX:xSpeedCurrent y:ySpeedCurrent context:@"FLIC iteration"]; - - CGFloat deltaX = xDistanceCurrent - xDistanceTotal; - CGFloat deltaY = yDistanceCurrent - yDistanceTotal; - - if([_engine loPanDeltaX:deltaX deltaY:deltaY state:UIGestureRecognizerStateChanged]){ - - [scroller updateByPixelDeltaY:deltaY]; - - xDistanceTotal = xDistanceCurrent; - yDistanceTotal = yDistanceCurrent; - }else{ - [copy cancel]; - } - } ]; - - animation.duration = duration; - animation.fps = FLICK_FPS; - [animation linearCurve]; - - copy = animation; - - animation.endBlock = ^{ - if(![copy isCancelled] || !self.isEvaluatingFlic){ - - [self setFlicSpeedX:0.0f y:0.0f context:@"FLIC end"]; - [_engine endFlick]; - } - }; - [_engine.currentAnimation cancel]; - _engine.currentAnimation = animation; - - [animation animate]; - - return YES; - } - - NSLog(@"FLIC ignored: xSpeed = ySpeed = 0"); - - return NO; - } - --(void) setFlicSpeedX: (CGFloat) xSpeed y:(CGFloat) ySpeed context:(NSString *)context{ - self.xFlickSpeed = xSpeed; - self.yFlickSpeed = ySpeed; - if(LOG_FLICK_FRAMES){ - NSLog(@"FLIC (%@) : set xSpeed = %f, ySpeed = %f",context, xSpeed,ySpeed); - } -} - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.h b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.h deleted file mode 100644 index 420682a76c3a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.h +++ /dev/null @@ -1,33 +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 "MLOObject.h" - -static const CGFloat - MAX_ZOOM = 600.0f, - MIN_ZOOM = 80.0f; - -typedef enum {DELTA_X,DELTA_Y} MLOPixelDeltaDirection; -#define MLOPixelDeltaDirectionString(enum) [@[@"DELTA_X",@"DELTA_Y"] objectAtIndex:enum] - -@class MLOGestureEngine; -@interface MLOGestureLimiter : MLOObject -@property CGSize documentSizeInLogic; - --(id) initWithGestureEngine:(MLOGestureEngine *) engine; --(void) showLibreOffice; --(CGFloat)limitDelta:(CGFloat) delta direction:(MLOPixelDeltaDirection) direction; --(void)logPanRawDeltaX:(NSInteger) preDeltaX rawDeltaY:(NSInteger) preDeltaY limitedDeltaX:(NSInteger) actualDeltaX limitedDeltaY:(NSInteger) actualDeltaY; --(void)beginPinch; --(void)onRotate; --(CGFloat)inPinchGetRatioToLastScale:(CGFloat) newScale; --(void)fireLoZoomEventsDuringPinch; --(CGFloat)currentPinchScale; --(CGFloat)endPinchAndGetScaleForLo:(CGFloat)scale; --(CGFloat)zoom; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.m b/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.m deleted file mode 100644 index c6da14d919a7..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOGestureLimiter.m +++ /dev/null @@ -1,269 +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 "MLOGestureLimiter.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOMainViewController_Friend.h" -#import "MLOScrollerData.h" -#import "MLOScrollerViewController.h" -#import "MLORenderManager_Impl.h" -#import "mlo_utils.h" -#import "mlo_uno.h" - -@interface MLOGestureLimiter () -@property MLOGestureEngine * engine; -@property MLOMainViewController * mainViewController; -@property CGFloat actualZoom; -@property CGFloat actualPixelToLogicScale; -@property CGSize halfViewSizeInLogic; -@property CGPoint viewCenterInLogic; -@property BOOL didCreateViewCenterInLogic; -@property CGFloat initialPinchZoom; -@property CGFloat previousPinchScale; -@property CGFloat previousScaleSentToLibreOffice; -@end - -static const CGFloat DELTA_SCALE_ZOOM_IN_THRESHOLD=1.5f, - DELTA_SCALE_ZOOM_OUT_THRESHOLD=0.7f, - MIN_ZOOM_FOR_HORIZONAL_PAN = 133.0f; - - -@implementation MLOGestureLimiter - --(CGFloat) zoom{ - return self.actualZoom; -} --(id) initWithGestureEngine:(MLOGestureEngine *) engine{ - - self = [self init]; - if(self){ - self.engine= engine; - self.mainViewController = nil; - } - return self; -} - --(void) showLibreOffice{ - self.mainViewController = _engine.mainViewController; - [self resetLocationMetrics]; -} - --(NSString *)azimuthToString:(CGFloat) delta direction:(MLOPixelDeltaDirection) direction{ - if(delta==0){ - return @"N/A"; - } - switch (direction) { - case DELTA_X: - if(delta < 0.0f) { - return @"swipe LEFT (scroll right)"; - } - return @"swipe RIGHT (scroll left)"; - - case DELTA_Y: - if(delta < 0.0f){ - - return @"swipe UP (scroll down)"; - } - return @"swipe DOWN (scroll up)"; - } -} - --(void)logPanRawDeltaX:(NSInteger) rawDeltaX rawDeltaY:(NSInteger) rawDeltaY limitedDeltaX:(NSInteger) limitedDeltaX limitedDeltaY:(NSInteger) limitedDeltaY{ - NSLog(@"PAN %@ %@: limited:(%d,%d) raw:(%d,%d) center:(%d,%d) viewSize:(%d,%d) logicSize:(%d,%d)", - [self azimuthToString:rawDeltaX direction:DELTA_X], - [self azimuthToString:rawDeltaY direction:DELTA_Y], - limitedDeltaX, - limitedDeltaY, - rawDeltaX, - rawDeltaY, - (NSInteger)self.viewCenterInLogic.x, - (NSInteger)self.viewCenterInLogic.y, - (NSInteger)self.halfViewSizeInLogic.width *2, - (NSInteger)self.halfViewSizeInLogic.height *2, - (NSInteger)self.documentSizeInLogic.width, - (NSInteger)self.documentSizeInLogic.height); -} - - --(CGFloat)limitDelta:(CGFloat) delta direction:(MLOPixelDeltaDirection) direction{ - - if(delta==0){ - return 0; - } - CGFloat deltaInLogic = [self pixelsToLogic:delta]; - - CGFloat limit = [self limitForRawDelta:deltaInLogic direction:direction]; - - if(deltaInLogic > 0){ - deltaInLogic = min(limit,deltaInLogic); - }else{ - deltaInLogic = max(limit,deltaInLogic); - } - - [self updateCenterInLogic:deltaInLogic direction:direction]; - - return [self logicToPixels:deltaInLogic]; -} - --(CGFloat) limitForRawDelta:(CGFloat) raw direction:(MLOPixelDeltaDirection) direction{ - - CGFloat halfscreen = [self halfViewSizeInLogic:direction]; - CGFloat center = [self viewCenterCord:direction]; - - CGFloat limit; - - if(raw < 0.0f){ - - CGFloat document = [self documentSizeInLogic:direction]; - limit = halfscreen + center - document; - - if(LOG_GESTURE_LIMITING){ - NSLog(@"%@ LIMIT: raw=%f limit(%f) = halfscreen(%f) + center(%f) - document(%f)",MLOPixelDeltaDirectionString(direction),raw,limit,halfscreen,center,document); - } - - }else{ - limit = center - halfscreen; - - if(LOG_GESTURE_LIMITING){ - NSLog(@"%@ LIMIT: raw=%f limit(%f) = center(%f) - halfscreen(%f)",MLOPixelDeltaDirectionString(direction),raw,limit,center,halfscreen); - } - } - if(limit*raw <0){ - // negative means limit flipped sign, so limit is zero - return 0; - } - - return limit; -} - --(CGFloat) halfViewSizeInLogic:(MLOPixelDeltaDirection) direction{ - switch (direction) { - case DELTA_X: return self.halfViewSizeInLogic.width; - case DELTA_Y: return self.halfViewSizeInLogic.height; - } -} - --(CGFloat) documentSizeInLogic:(MLOPixelDeltaDirection) direction{ - switch (direction) { - case DELTA_X: return self.documentSizeInLogic.width; - case DELTA_Y: return self.documentSizeInLogic.height; - } -} - --(CGFloat) viewCenterCord:(MLOPixelDeltaDirection) direction{ - switch (direction) { - case DELTA_X: return [self centerInLogic].x; - case DELTA_Y: return [self centerInLogic].y; - } -} - --(void) updateCenterInLogic:(CGFloat) delta direction:(MLOPixelDeltaDirection) direction{ - switch (direction) { - case DELTA_X: _viewCenterInLogic.x-=delta; break; - case DELTA_Y: _viewCenterInLogic.y-=delta; break; - } -} - --(void)createHalfViewSizeInLogic{ - self.halfViewSizeInLogic = CGSizeMake(_mainViewController.canvas.frame.size.width - * self.actualPixelToLogicScale - / 2.0f, - _mainViewController.canvas.frame.size.height - * self.actualPixelToLogicScale - / 2.0f); -} - --(CGFloat)pixelsToLogic:(CGFloat) distanceInPixels{ - return roundf(self.actualPixelToLogicScale * distanceInPixels); -} - --(CGFloat)logicToPixels:(CGFloat) distanceInLogic{ - return roundf(distanceInLogic / self.actualPixelToLogicScale); -} - --(CGPoint)centerInLogic{ - if(!self.didCreateViewCenterInLogic){ - [self createHalfViewSizeInLogic]; - self.viewCenterInLogic = CGPointMake(self.halfViewSizeInLogic.width, - self.halfViewSizeInLogic.height); - self.didCreateViewCenterInLogic = YES; - } - - return self.viewCenterInLogic; -} - --(void)resetLocationMetrics{ - self.actualZoom = 100.0f; - [self updateActualZoom:100.f]; - self.didCreateViewCenterInLogic = NO; -} - --(void)updateActualZoom:(CGFloat) newActualZoom{ - - CGFloat viewResizeScale = self.actualZoom / newActualZoom; - - self.halfViewSizeInLogic = CGSizeMake(self.halfViewSizeInLogic.width * viewResizeScale, - self.halfViewSizeInLogic.height * viewResizeScale); - self.actualZoom = newActualZoom; - - static const CGFloat PIXEL_TO_LOGIC_RATION_TIMES_HUNDRED = PIXEL_TO_LOGIC_RATIO * 100.0f; - - self.actualPixelToLogicScale = PIXEL_TO_LOGIC_RATION_TIMES_HUNDRED / newActualZoom; - } - --(void)beginPinch{ - [_mainViewController.scroller updateByLogic]; - self.previousPinchScale = NO_SCALE; - self.previousScaleSentToLibreOffice = NO_SCALE; - self.initialPinchZoom = self.actualZoom; -} - - --(void)onRotate{ - if(self.didCreateViewCenterInLogic){ - [self createHalfViewSizeInLogic]; - } -} --(CGFloat) inPinchGetRatioToLastScale:(CGFloat)newScale{ - - CGFloat newZoom = self.initialPinchZoom *newScale; - - newZoom = max(min(newZoom, MAX_ZOOM),MIN_ZOOM); - - NSLog(@"new zoom is %f",newZoom); - - [self updateActualZoom:newZoom]; - - newScale = newZoom / self.initialPinchZoom; - - CGFloat scaleRatioToLastScale = newScale / self.previousPinchScale; - - self.previousPinchScale =newScale; - - return scaleRatioToLastScale; -} - --(void)fireLoZoomEventsDuringPinch{ - CGFloat deltaScale = self.previousPinchScale / self.previousScaleSentToLibreOffice; - - if((deltaScale > DELTA_SCALE_ZOOM_IN_THRESHOLD) || - (deltaScale < DELTA_SCALE_ZOOM_OUT_THRESHOLD)){ - self.previousScaleSentToLibreOffice = self.previousPinchScale; - [_engine loZoomDeltaX:0.0f deltaY:0.0f scale:deltaScale]; - } -} --(CGFloat)endPinchAndGetScaleForLo:(CGFloat)scale{ - [self updateActualZoom: floorf(self.actualZoom)]; - return scale/self.previousScaleSentToLibreOffice; -} - --(CGFloat)currentPinchScale{ - return self.previousPinchScale; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.h b/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.h deleted file mode 100644 index 6649ce00045b..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.h +++ /dev/null @@ -1,20 +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 "MLOObject.h" - -@class MLOMainViewController; -@interface MLOKeyboardManager : MLOObject<UITextViewDelegate> - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void)addToMainViewController; --(void)show; --(void)hide; --(void)showLibreOffice; --(void)hideLibreOffice; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.m b/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.m deleted file mode 100644 index fde1d8263c37..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/gestures/MLOKeyboardManager.m +++ /dev/null @@ -1,139 +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 "MLOKeyboardManager.h" -#import "MLOMainViewController_Friend.h" -#import "MLOManager.h" -#import "MLOGestureEngine_Impl.h" -#include <touch/touch.h> - -@interface MLOKeyboardManager () -@property MLOMainViewController * mainViewController; -@property UITextView * textView; -@property BOOL allowLoToinvokdeKeyboard; -@property BOOL isShown; -@end - -@implementation MLOKeyboardManager - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [self init]; - if(self){ - - self.mainViewController = mainViewController; - - [self initTextView]; - - self.isShown = NO; - - id defaultCenter = [NSNotificationCenter defaultCenter]; - - [defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - [defaultCenter addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; - } - return self; -} --(void)addToMainViewController{ - [self.mainViewController.canvas addSubview:self.textView]; -} --(void)hideLibreOffice{ - self.allowLoToinvokdeKeyboard =NO; - [self hide]; -} --(void)showLibreOffice{ - self.allowLoToinvokdeKeyboard =NO; -} --(void)initTextView{ - self.textView = [[UITextView alloc] initWithFrame:CGRECT_ONE]; - self.textView.alpha = 0.0f; - self.textView.autocapitalizationType = UITextAutocapitalizationTypeNone; - self.textView.delegate = self; -} - --(void)show{ - self.isShown =YES; - NSLog(@"MLOKeyboardManager : show"); - [self.textView becomeFirstResponder]; -} - --(void)hide{ - if(self.isShown){ - self.isShown =NO; - NSLog(@"MLOKeyboardManager : hide"); - [self.textView resignFirstResponder]; - } -} - --(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text -{ - NSLog(@"textView: %@ shouldChangeTextInRange:[%u,%u] replacementText:%@", textView, range.location, range.length, text); - - NSInteger length = [text length]; - - for (NSUInteger i = 0; i < length; i++){ - touch_lo_keyboard_input([text characterAtIndex: i]); - } - - if(length>0){ - [self.mainViewController onTextEdit]; - } - return NO; -} - --(void)loInvokeKeyboard{ - if(self.allowLoToinvokdeKeyboard){ - [self show]; - }else{ - self.allowLoToinvokdeKeyboard = YES; - } -} - --(BOOL)canBecomeFirstResponder{ - return YES; -} - --(void)keyboardWillShow:(NSNotification *)note{ - IGNORE_ARG(note); - [self.mainViewController.gestureEngine onKeyboardShow]; -} - --(void)keyboardDidHide:(NSNotification *)note{ - IGNORE_ARG(note); - [self.mainViewController.gestureEngine onKeyboardHide]; -} - - -// C functions -// =========== -// -// Functions called in the LO thread, which thus need to dispatch any -// CocoaTouch activity to happen on the GUI thread. Use -// dispatch_async() consistently. - -void touch_ui_show_keyboard() -{ - dispatch_async(dispatch_get_main_queue(), ^{ - [[MLOManager getInstance].mainViewController.keyboard loInvokeKeyboard]; - }); -} - -void touch_ui_hide_keyboard() -{ - dispatch_async(dispatch_get_main_queue(), ^{ - [[MLOManager getInstance].mainViewController.keyboard hide]; - }); -} - -bool touch_ui_keyboard_visible() -{ - // Should return info whether the soft keyboard is currently displayed, - // or a hardware keyboard is attached/paired. - return [MLOManager getInstance].mainViewController.keyboard.isShown; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.h b/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.h deleted file mode 100644 index 34d91ea5581b..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.h +++ /dev/null @@ -1,13 +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 "MLOObject.h" - -@interface MLOPostRenderManager : MLOObject - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.m b/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.m deleted file mode 100644 index 0d841e1b171d..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLOPostRenderManager.m +++ /dev/null @@ -1,34 +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 "MLOPostRenderManager.h" -#import "MLOMainViewController.h" - -@interface MLOPostRenderManager () -@property UITextView * invisibleSelection; -@end - -@implementation MLOPostRenderManager - --(id)init{ - self = [super init]; - if(self){ - self.invisibleSelection = [UITextView new]; - - _invisibleSelection.backgroundColor = [UIColor clearColor]; - _invisibleSelection.textColor = [UIColor clearColor]; - - } - return self; -} - --(void)addToMainViewController:(MLOMainViewController *) mainViewController{ - [mainViewController.canvas addSubview:_invisibleSelection]; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.h b/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.h deleted file mode 100644 index 8c4be9c682a3..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.h +++ /dev/null @@ -1,19 +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 "MLORenderingUIView.h" - -@class MLORenderManager; -@interface MLORenderBuffer : MLORenderingUIView -@property NSInteger index; -@property MLORenderBuffer * previous; --(id)initWithArrayIndex:(NSInteger) index renderManager:(MLORenderManager *) manager; -+(CGFloat) getAverageFps; -+(CGFloat) getMaxFps; --(void)hide; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.m b/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.m deleted file mode 100644 index b4dadc7c4c82..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderBuffer.m +++ /dev/null @@ -1,107 +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 "MLORenderBuffer.h" -#import "MLORenderManager_Impl.h" -#import "mlo_utils.h" -#import <QuartzCore/QuartzCore.h> -#include <touch/touch.h> - -@interface MLORenderBuffer () -@property MLORenderManager * manager; -@end -static const CGFloat - MIN_AVERAGE_RENDER_TIME_THRESHOLD=1.0f/100.0f, - MIN_FPS=10.0f; - -static const NSTimeInterval SCALING_ANIMATION_DURATION = 0.02f; - -static CGFloat averageFps,maxFps; -@implementation MLORenderBuffer - --(id)initWithArrayIndex:(NSInteger) index renderManager:(MLORenderManager *) manager{ - self= [self init]; - if(self){ - self.index = index; - self.manager = manager; - self.backgroundColor = [UIColor whiteColor]; - self.previous = nil; - } - return self; -} - --(void)hide{ - self.alpha = 0; - [self resetTransform]; -} - --(void)setNeedsDisplayInRect:(CGRect)rect{ - [self resetTransform]; - [super setNeedsDisplayInRect:rect]; -} - --(void) resetTransform{ - if(self.frame.origin.x ||self.frame.origin.y ){ - self.frame = CGRectMake(0,0,_manager.bufferFrame.size.width,_manager.bufferFrame.size.height); - } -} - -- (void)drawRect:(CGRect)rect -{ - if(ENABLE_LO_DESKTOP){ - CGContextRef context = UIGraphicsGetCurrentContext(); - - //rect = self.frame; - LOG_RECT(rect, @"drawRect"); - - CGContextSaveGState(context); - CGContextSetFillColorWithColor(context,[UIColor whiteColor].CGColor); - CGContextTranslateCTM(context, 0, _manager.bufferFrame.size.height); - CGContextScaleCTM(context, 1, -1); - CGContextScaleCTM(context, 1, 1); - NSDate *startDate = [NSDate date]; - - [_manager loRenderWillBegin]; - - touch_lo_render_windows(context, rect.origin.y, rect.origin.y, rect.size.width, rect.size.height); - - CGContextRestoreGState(context); - - CGFloat duration = [[NSDate date] timeIntervalSinceDate: startDate]; - - maxFps = max(maxFps,1.0f/duration); - - static float totalTime = 0,counter = 0; - - totalTime +=duration; - counter++; - - CGFloat averageTime = totalTime / counter; - if(averageTime >MIN_AVERAGE_RENDER_TIME_THRESHOLD){ - averageFps = 1.0f/ averageTime; - } - - if(LOG_DRAW_RECT){ - NSLog(@"drawRect: lo_render_windows: time=%f sec, average=%f sec, fps=%f", - duration, averageTime, averageFps); - } - if(_manager.currentGesture != PINCH){ - [_manager swapPreviousBuffer:_previous withNextBuffer:self]; - } - } -} - -+(CGFloat) getAverageFps{ - return max(averageFps, MIN_FPS); -} - -+(CGFloat) getMaxFps{ - return max(maxFps, MIN_FPS); -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.h b/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.h deleted file mode 100644 index 8453c5c23037..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.h +++ /dev/null @@ -1,30 +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 <UIKit/UIKit.h> - -static const BOOL ENABLE_PINCH_RENDERING_VIA_IOS = YES; - -@class MLOGestureEngine; - -@interface MLORenderManager : MLOViewController - -+(MLORenderManager *) getInstance; - --(void) showLibreOffice:(MLOGestureEngine *) gestureEngine; --(void) hideLibreOffice; --(void) panDeltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY; --(void) pinchDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY scale:(CGFloat)scale; --(void) endGestures; --(void) setWidth:(NSInteger) width height:(NSInteger) height; --(void) renderInContext:(CGContextRef) context; --(CGPoint) getShiftFromCanvasCenter; --(void)renderNow; -@end - diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.m b/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.m deleted file mode 100644 index ea7abe662289..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager.m +++ /dev/null @@ -1,336 +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 "MLOCommon.h" - -#import <UIKit/UIKit.h> - -#import "MLOMainViewController.h" -#import "MLORenderManager_Impl.h" -#import "MLORenderBuffer.h" -#import "MLOScalingBuffer.h" -#import "MLOGestureLimiter.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOSelectionViewController.h" -#import "NSObject+MLOUtils.h" -#import "MLOPostRenderManager.h" -#import "mlo_utils.h" -#import <QuartzCore/QuartzCore.h> - -#include <touch/touch.h> - -static MLORenderManager * instance = nil; - -static const CGFloat - HORIZONAL_BUFFER_SCALE=1.0f, - VERTICAL_BUFFER_SCALE=1.0f, - BUFFER_SCALE_BIAS =1.0f, - - RENDERING_BIAS_RATIO = 1.0f/(BUFFER_SCALE_BIAS*HORIZONAL_BUFFER_SCALE *VERTICAL_BUFFER_SCALE), - - MAX_RENDER_PER_SECOND_ON_DEFAULT_ZOOM =4 * RENDERING_BIAS_RATIO, - MAX_RENDER_PER_SECOND_ON_MAX_ZOOM_IN=3 * RENDERING_BIAS_RATIO; - -static const NSTimeInterval - LO_PAN_RENDER_MAX_DURATION = 0.3f, - LO_PINCH_RENDER_MAX_DURATION = 0.5f, - RESET_TRANSFORM_ANIMATION_DURATION=0.1f, - LO_RENDER_BACKOFF_MIN = 1.0f / MAX_RENDER_PER_SECOND_ON_DEFAULT_ZOOM, - LO_RENDER_BACKOFF_MAX = 1.0f / MAX_RENDER_PER_SECOND_ON_MAX_ZOOM_IN, - LO_RENDER_BACK_OFF_MAX_DELTA = LO_RENDER_BACKOFF_MAX - LO_RENDER_BACKOFF_MIN; - - - -static const NSInteger BUFFER_COUNT=2; - -#define MLOGestureDirectionString(enum) [@[@"X",@"Y",@"Z"] objectAtIndex:enum] - -@interface MLORenderManager () -@property MLOGestureEngine * gestureEngine; -@property MLOPostRenderManager * post; -@property NSArray * buffers; -@property NSInteger activeBufferIndex,nextBufferIndex,frameIdCounter; -@property NSTimeInterval bufferTransfromResetDeadline,renderBlockReleaseTime; -@property CGFloat inRenderTiltX,inRenderTiltY, inRenderTiltScale; -@end - -@implementation MLORenderManager - -+(MLORenderManager *) getInstance{ - if(instance == nil){ - instance = [MLORenderManager new]; - } - return instance; -} - --(MLORenderBuffer *)getBufferAtIndex:(NSInteger) index{ - return [_buffers objectAtIndex:index]; -} - --(id)init{ - self = [super init]; - if(self){ - self.gestureEngine = nil; - [self createBufffers]; - self.renderBlockReleaseTime = 0; - self.activeBufferIndex = 0; - self.nextBufferIndex = _activeBufferIndex + 1; - [self loRenderWillBegin]; - self.view.backgroundColor = [UIColor whiteColor]; - self.currentGesture = NO_GESTURE; - } - return self; -} - --(void) createBufffers{ - NSMutableArray * array = [NSMutableArray new]; - - for (NSInteger i = 0 ; i < BUFFER_COUNT; i++) { - - [array addObject:[[MLORenderBuffer alloc] initWithArrayIndex: i renderManager:self]]; - } - - self.buffers = [NSArray arrayWithArray:array]; - - for (NSInteger i = 0 ; i < BUFFER_COUNT; i++) { - - MLORenderBuffer * buffer = [_buffers objectAtIndex:i]; - - NSInteger previousIndex = BUFFER_COUNT -1; - if(i !=0){ - previousIndex = i-1; - } - buffer.previous = [_buffers objectAtIndex:previousIndex]; - [self.view addSubview:buffer]; - } -} - --(void)showLibreOffice:(MLOGestureEngine *) gestureEngine{ - self.gestureEngine = gestureEngine; -} - --(void)hideLibreOffice{ - self.currentGesture = NO_GESTURE; - [self.scaler hide]; - self.gestureEngine = nil; -} - --(void) panDeltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY{ - - self.currentGesture = PAN; - - if(deltaX || deltaY){ - [[self getActiveBuffer] moveDeltaX:deltaX deltaY:deltaY]; - - self.inRenderTiltX+=deltaX; - self.inRenderTiltY+=deltaY; - } -} - --(void) pinchDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY scale:(CGFloat)scale{ - - if(ENABLE_PINCH_RENDERING_VIA_IOS){ - - self.currentGesture = PINCH; - - if(self.scaler ==nil){ - self.scaler = [[MLOScalingBuffer alloc] initWithRenderManager:self]; - } - - [self.scaler scale:scale deltaX:deltaX deltaY:deltaY]; - - self.inRenderTiltScale*=scale; - self.inRenderTiltX = self.inRenderTiltX*scale +deltaX; - self.inRenderTiltY = self.inRenderTiltY*scale +deltaY; - - } - -} --(void)endGestures{ - self.currentGesture = NO_GESTURE; - NSLog(@"RenderManager: self.currentGesture = NO_GESTURE"); -} - --(CGPoint) getShiftFromCanvasCenter{ - - CGPoint bufferCenter= [self currentBufferCenter]; - CGPoint canvasCenter = _gestureEngine.mainViewController.canvas.center; - - return CGPointMake(bufferCenter.x - canvasCenter.x, - bufferCenter.y - canvasCenter.y); -} - --(CGPoint) currentBufferCenter{ - if(self.currentGesture ==PINCH){ - return self.scaler.center; - } - return [self getActiveBuffer].center; -} - --(void)loRenderWillBegin{ - self.inRenderTiltX = NO_MOVE_DELTA; - self.inRenderTiltY = NO_MOVE_DELTA; - self.inRenderTiltScale = NO_SCALE; -} - --(void)setWidth:(NSInteger) width height:(NSInteger) height{ - - self.view.frame = CGRectMake(0,0, width,height); - - CGFloat bufferWidth = width*HORIZONAL_BUFFER_SCALE; - CGFloat bufferHeight = height*VERTICAL_BUFFER_SCALE; - self.bufferFrame = CGRectMake(0,0, bufferWidth,bufferHeight); - - for (MLORenderBuffer * buffer in _buffers) { - buffer.frame = self.bufferFrame; - } - - touch_lo_set_view_size(bufferWidth,bufferHeight); -} --(MLORenderBuffer *) getActiveBuffer{ - return[_buffers objectAtIndex:self.activeBufferIndex]; -} - --(MLORenderBuffer *) getNextBuffer{ - return[_buffers objectAtIndex:self.nextBufferIndex]; -} - --(void) renderInContext:(CGContextRef) context{ - // used for magnification - [[self getActiveBuffer].layer renderInContext:context]; -} - --(void)swapIndexes{ - self.nextBufferIndex = (self.nextBufferIndex +1)% BUFFER_COUNT; - self.activeBufferIndex = (self.activeBufferIndex +1)% BUFFER_COUNT; -} - --(void)swapPreviousBuffer:(MLORenderingUIView*) previous withNextBuffer:(MLORenderBuffer *) next{ - - NSTimeInterval bufferTransformResetDelay = [self getBufferTransformResetDelay]; - NSTimeInterval bufferTransformResetDeadline =CACurrentMediaTime() + bufferTransformResetDelay; - - self.bufferTransfromResetDeadline = bufferTransformResetDeadline; - - if(self.scaler && self.scaler.didRender){ - previous = self.scaler; - } - - [self showBuffer:next]; - - [self swapIndexes]; - - [previous hide]; - -} - --(NSTimeInterval) getBufferTransformResetDelay{ - - switch(self.currentGesture){ - case PAN: return LO_PAN_RENDER_MAX_DURATION; - case PINCH: return LO_PINCH_RENDER_MAX_DURATION; - case NO_GESTURE: return 0; - } -} - --(void)showBuffer:(MLORenderBuffer *) buffer{ - - buffer.alpha = 1.0f; -} - --(CGFloat) currentZoomRatio{ - return [_gestureEngine.limiter zoom] / MAX_ZOOM; -} - --(void) renderWithRect:(CGRect) rect{ - - if(ENABLE_LO_DESKTOP){ - - switch(self.currentGesture){ - case PAN: - { - NSTimeInterval now = CACurrentMediaTime(); - - NSTimeInterval delta = LO_RENDER_BACKOFF_MIN + - LO_RENDER_BACK_OFF_MAX_DELTA * [self currentZoomRatio]; - - NSTimeInterval releaseTime = now + delta; - - NSTimeInterval currentReleaseTime = self.renderBlockReleaseTime; - - NSInteger currentFrameId = self.frameIdCounter++; - - if(now > currentReleaseTime){ - - [self pereodicRender:rect releaseTime:releaseTime]; - - }else{ - - [self performBlock:^{ - - if((self.renderBlockReleaseTime == currentReleaseTime) - && (currentFrameId==0)){ - - [self pereodicRender:rect releaseTime:releaseTime]; - } - }afterDelay:delta]; - } - } - break; - case PINCH: - case NO_GESTURE: - [[self getNextBuffer] setNeedsDisplayInRect:rect]; - break; - } - } - } - --(void)renderNow{ - [[self getNextBuffer] setNeedsDisplayInRect:self.bufferFrame]; -} - --(void)pereodicRender:(CGRect) rect releaseTime:(NSTimeInterval) releaseTime{ - - static NSTimeInterval lastRender = 0; - - [[self getNextBuffer] setNeedsDisplayInRect:rect]; - - self.frameIdCounter = 0; - - self.renderBlockReleaseTime =releaseTime; - - NSTimeInterval now = CACurrentMediaTime(); - NSLog(@"Render interval %f",now - lastRender); - - lastRender = now; -} - - -// C functions -// =========== -// -// Functions called in the LO thread, which thus need to dispatch any -// CocoaTouch activity to happen on the GUI thread. Use -// dispatch_async() consistently. - - -void touch_ui_damaged(int minX, int minY, int width, int height) -{ - CGRect rect = CGRectMake(minX, minY, width, height); - - dispatch_async(dispatch_get_main_queue(), ^{ - - [[MLORenderManager getInstance] renderWithRect:rect]; - - }); - // NSLog(@"lo_damaged: %dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y); -} - -@end - -// vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager_Impl.h b/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager_Impl.h deleted file mode 100644 index 0194cf821e51..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderManager_Impl.h +++ /dev/null @@ -1,26 +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 "MLORenderManager.h" - -static const CGFloat - NO_SCALE = 1.0f, - NO_MOVE_DELTA = 0.0f; - -typedef enum {PAN,PINCH,NO_GESTURE} MLOGestureType; -#define MLOGestureTypeString(enum) [@[@"PAN",@"PINCH",@"NO_GESTURE"] objectAtIndex:enum] - -@class MLORenderBuffer,MLOScalingBuffer; -@interface MLORenderManager () -@property MLOScalingBuffer * scaler; -@property CGRect bufferFrame; -@property MLOGestureType currentGesture; --(void)swapPreviousBuffer:(MLORenderBuffer*) previous withNextBuffer:(MLORenderBuffer *) next; --(void)loRenderWillBegin; --(MLORenderBuffer *) getActiveBuffer; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.h b/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.h deleted file mode 100644 index 7226773a942a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.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 "MLOSubView.h" - -@interface MLORenderingUIView: MLOSubView - --(void)moveDeltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY; --(void)hide; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.m b/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.m deleted file mode 100644 index d374a85ff58a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLORenderingUIView.m +++ /dev/null @@ -1,20 +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 "MLORenderingUIView.h" - -@implementation MLORenderingUIView - --(void)moveDeltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY{ - CGPoint center = self.center; - self.center = CGPointMake(center.x+ deltaX,center.y + deltaY); -} --(void)hide{ - NSLog(@"Unimplemnted hide method for %@",self); -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.h b/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.h deleted file mode 100644 index fbddf24ec4ae..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.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 "MLORenderingUIView.h" - -@class MLORenderManager; -@interface MLOScalingBuffer :MLORenderingUIView -@property BOOL didRender; --(id)initWithRenderManager:(MLORenderManager *) manager; --(void)scale:(CGFloat) scale deltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.m b/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.m deleted file mode 100644 index 488f253f4717..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/render/MLOScalingBuffer.m +++ /dev/null @@ -1,79 +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 "MLOScalingBuffer.h" -#import "MLORenderBuffer.h" -#import "MLORenderingUIView.h" - -#import "MLORenderManager_Impl.h" -#import <QuartzCore/QuartzCore.h> - -@interface MLOScalingBuffer () -@property MLORenderManager * manager; -@property MLORenderBuffer * active; -@property BOOL didHideActive; -@end - -@implementation MLOScalingBuffer - --(id)initWithRenderManager:(MLORenderManager *) manager{ - self= [self initWithFrame:manager.view.frame]; - if(self){ - self.didRender = NO; - self.didHideActive =NO; - self.manager = manager; - self.active =[manager getActiveBuffer]; - self.alpha = 1.0f; - self.backgroundColor = [UIColor clearColor]; - [self.manager.view addSubview:self]; - self.frame = manager.bufferFrame; - [self setNeedsDisplay]; - - } - return self; -} - --(void)hideActive{ - if(self.didRender && !self.didHideActive){ - self.didHideActive = YES; - [self.active hide]; - } -} - --(void)scale:(CGFloat) scale deltaX:(CGFloat) deltaX deltaY:(CGFloat) deltaY{ - - [self hideActive]; - if(self.didHideActive){ - self.layer.transform = CATransform3DMakeScale(scale,scale,1); - } - - [self moveDeltaX:deltaX deltaY:deltaY]; -} - --(void)hide{ - self.alpha = 0.0f; - [self removeFromSuperview]; - self.manager.scaler = nil; -} - --(void)drawRect:(CGRect)rect{ - - if(!self.didRender){ - - CGContextRef context = UIGraphicsGetCurrentContext(); -// CGContextSaveGState(context); -// CGContextFillRect(context, self.bounds); - [self.active.layer renderInContext:context]; -// CGContextRestoreGState(context); - self.didRender = YES; - }else{ - [self hideActive]; - [super drawRect:rect]; - } -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.h deleted file mode 100644 index 89dd9e73dd7e..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.h +++ /dev/null @@ -1,36 +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 "MLOObject.h" - -typedef void (^MLOAnimationBlock)(CGFloat fraction); -typedef void (^MLOAnimationBlockEnd)(); - -typedef enum {CANCELABLE, MANDATORY} MLOAnimationBehavior; -#define MLOAnimationBehaviorString(enum) [@[@"CANCELABLE",@"MANDATORY"] objectAtIndex:enum] -typedef enum {DELTA_ONLY,FULL_FRACTION} MLOAnimationFractionType; -#define MLOAnimationFractionTypeString(enum) [@[@"DELTA_ONLY",@"FULL_FRACTION"] objectAtIndex:enum] - -static const NSTimeInterval DEFAULT_MLO_ANIMATION_DURAION=1.0F; - -static const CGFloat DEFAULT_ANIMATION_FPS=25; - -@interface MLOAnimation : MLOObject -@property NSTimeInterval duration; -@property CGFloat fps; -@property (nonatomic,strong) MLOAnimationBlockEnd endBlock; - --(id)initWithBehavior:(BOOL) behavior fractionType:(MLOAnimationFractionType) fractionType animation:(MLOAnimationBlock) animation; --(void) linearCurve; --(void) easeOutCurve; --(void) easeInCurve; --(void) cancel; --(void) animate; --(BOOL) isCancelled; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.m deleted file mode 100644 index ee7dee20b1fc..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOAnimation.m +++ /dev/null @@ -1,149 +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 "MLOAnimation.h" - - -typedef CGFloat (^MLOAnimationCurve)(CGFloat time); - -@interface MLOAnimation () -@property BOOL active,didPost,cancelled; -@property CGFloat frameCount; -@property NSDate * startDate; -@property MLOAnimationBehavior behavior; -@property MLOAnimationFractionType fractionType; -@property (nonatomic,strong) MLOAnimationBlock animation; -@property (nonatomic,strong) MLOAnimationCurve curve; -@end - -@implementation MLOAnimation - --(void) linearCurve{ - static const MLOAnimationCurve LINEAR = ^(CGFloat completedFraction){ - return completedFraction; - }; - [self setCurve:LINEAR name:@"LINEAR"]; -} --(void) easeOutCurve{ - static const MLOAnimationCurve EASE_OUT = ^(CGFloat completedFraction){ - return 1 - completedFraction*completedFraction; - }; - [self setCurve:EASE_OUT name:@"EASE_OUT"]; -} - --(void) easeInCurve{ - static const MLOAnimationCurve EASE_IN = ^(CGFloat completedFraction){ - return completedFraction*completedFraction; - }; - - [self setCurve:EASE_IN name:@"EASE_IN"]; -} - --(void)setCurve:(MLOAnimationCurve) curve name:(NSString *) name{ - self.curve = curve; - NSLog(@"MLOAnimation curve set to: %@",name); -} - --(void) cancel{ - if(_behavior == CANCELABLE){ - self.cancelled= YES; - self.active = NO; - [self doPost:nil]; - - if(_startDate){ - - NSLog(@"MLOAnimation cancelled after %f millis",[_startDate timeIntervalSinceNow]); - }else{ - NSLog(@"MLOAnimation aborted"); - } - }else{ - NSLog(@"CLOAnimation cannot be cancelled"); - } -} --(BOOL) isCancelled{ - return self.cancelled; -} - --(id)initWithBehavior:(BOOL) behavior fractionType:(MLOAnimationFractionType) fractionType animation:(MLOAnimationBlock) animation{ - self = [super init]; - if(self){ - _active=YES; - _duration = DEFAULT_MLO_ANIMATION_DURAION; - _fps = DEFAULT_ANIMATION_FPS; - _behavior=CANCELABLE; - _fractionType = fractionType; - _frameCount = -1.0f; - _startDate = nil; - _didPost =NO; - _cancelled=NO; - [self linearCurve]; - self.animation = animation; - } - return self; -} - --(void)animate{ - - if(!_startDate){ - self.startDate = [NSDate date]; - _frameCount = _duration *_fps; - - if(_frameCount>0){ - CGFloat frameDuration = 1.0f/_fps; - - NSLog(@"MLOAnimation: duration=%f frameCount=%f fps=%f frameDuration=%f fractionType=%@",_duration,_frameCount,_fps,frameDuration,[self fractionTypeAsString]); - - for (CGFloat i = 1; i <= _frameCount; i++) { - [self performSelector:@selector(doFrame:) withObject:[NSNumber numberWithFloat:i] afterDelay: i*frameDuration]; - } - [self performSelector:@selector(doPost:) withObject:nil afterDelay:_duration + frameDuration]; - }else{ - NSLog(@"MLOAnimation cannot run (zero frames)"); - } - } -} - --(void) doPost:(NSObject *) niller{ - if(!_didPost){ - _didPost = YES; - if(_endBlock){ - _endBlock(); - } - } -} - --(NSString *)fractionTypeAsString{ - switch (_fractionType) { - case DELTA_ONLY: - return @"DELTA_ONLY"; - case FULL_FRACTION: - return @"FULL_FRACTION"; - } -} - --(void)doFrame:(NSNumber *) frame{ - if(_active){ - - CGFloat fFrame = [frame floatValue]; - - CGFloat currentFraction = _curve(fFrame/_frameCount); - - if(_fractionType == DELTA_ONLY){ - currentFraction -= _curve( (fFrame-1.0f) /_frameCount); - } - - _animation(_curve(currentFraction)); - - if(fFrame ==_frameCount){ - - _behavior =MANDATORY; - } - } -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.h deleted file mode 100644 index 59f75cbe052a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.h +++ /dev/null @@ -1,19 +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 "MLOCommon.h" -#import <UIKit/UIKit.h> -@class MLOResourceImage; -@interface MLOButton : UIButton - -+(id)buttonWithImage:(MLOResourceImage *) image; --(void)addTarget:(id)target action:(SEL)action; --(void)addAction:(SEL)action; --(void)setDefaultImage:(UIImage *)image; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.m deleted file mode 100644 index e3db44b2c3f9..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOButton.m +++ /dev/null @@ -1,35 +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 "MLOButton.h" -#import "MLOResourceImage.h" - -@implementation MLOButton - -+(id)buttonWithImage:(MLOResourceImage *) image{ - id button = [MLOButton buttonWithType:UIButtonTypeCustom]; - if(button){ - [button setDefaultImage:image.image]; - } - return button; -} - - --(void)addTarget:(id)target action:(SEL)action{ - [self addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; -} --(void)addAction:(SEL)action{ - [self addTarget:self action:action]; -} - --(void)setDefaultImage:(UIImage *)image{ - [self setImage:image forState:UIControlStateNormal]; - self.contentMode = UIViewContentModeScaleAspectFit; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOCommon.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOCommon.h deleted file mode 100644 index 1f9e8a5434e9..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOCommon.h +++ /dev/null @@ -1,43 +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/. - -#ifndef __Mobile_LibreOffice_MLOCommon_h__ -#define __Mobile_LibreOffice_MLOCommon_h__ - -typedef enum { LO_APP, TILE_TESTER} MLOAppRole; -#define MLOAppRoleString(enum) [@[@"LO_APP",@"RENDER_TILE_TESTER"] objectAtIndex:enum] -static const MLOAppRole APP_ROLE = MLO_APP_ROLE; -static const BOOL ENABLE_LO_DESKTOP = APP_ROLE == LO_APP; - -static const BOOL - LOG_DRAW_RECT = NO, - LOG_GET_VIEW_DATA = YES, - LOG_FLICK_FRAMES=NO, - LOG_PAN=NO, - LOG_PINCH=YES, - LOG_DOUBLE_TAP=YES, - LOG_GESTURE_LIMITING = NO; - -#define LOG_RECT(RECT,NAME) NSLog(@"%@: w:%d, h:%d, origin:(%d,%d)",NAME, (int) RECT.size.width, (int) RECT.size.height, (int) RECT.origin.x, (int) RECT.origin.y) -#define IGNORE_ARG(X) ((void) X) - -#define CPPU_ENV gcc3 -#define HAVE_GCC_VISIBILITY_FEATURE - -#import "time.h" - -typedef enum {IN,OUT} MLOFadeType; -#define MLOFadeTypeString(enum) [@[@"IN",@"OUT"] objectAtIndex:enum] - -#define CGRECT_ZERO CGRectMake(0,0,0,0) -#define CGRECT_ONE CGRectMake(1,1,1,1) -static const CGFloat MLO_IPAD_HEIGHT_IN_PIXELS = 1024, - MLO_IPAD_WIDTH_IN_PIXELS = 768; - - -#endif diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.h deleted file mode 100644 index 0cada17a1fa2..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.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 "MLOCommon.h" -#import <Foundation/Foundation.h> - -@interface MLOObject : NSObject - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.m deleted file mode 100644 index a50b8f8b01d5..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOObject.m +++ /dev/null @@ -1,13 +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 "MLOObject.h" - -@implementation MLOObject - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.h deleted file mode 100644 index bcad8f7ff91f..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.h +++ /dev/null @@ -1,32 +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 "MLOObject.h" - -typedef enum {NORMAL,RETINA} MLOResourceImageSize; -#define MLOResourceImageSizeString(enum) [@[@"NORMAL",@"RETINA"] objectAtIndex:enum] -typedef enum {IMAGE, MASK} MLOResourceImageType; -#define MLOResourceImageTypeString(enum) [@[@"MASK",@"RETINA"] objectAtIndex:enum] - -@interface MLOResourceImage : MLOObject --(NSString *)name; --(UIImage *)image; - -+(MLOResourceImage *) backWithSize:(MLOResourceImageSize) size; -+(MLOResourceImage *) shrink; -+(MLOResourceImage *) expand; -+(MLOResourceImage *) edit; -+(MLOResourceImage *) find; -+(MLOResourceImage *) print; -+(MLOResourceImage *) save; -+(MLOResourceImage *) left; -+(MLOResourceImage *) right; -+(MLOResourceImage *) selectionHandle; -+(NSString *) magnifierName:(MLOResourceImageType) type; -+(UIImage *) loLogo; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.m deleted file mode 100644 index 7094c3bf617f..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOResourceImage.m +++ /dev/null @@ -1,104 +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 "MLOResourceImage.h" - -@interface MLOResourceImage () - -@property NSString * name; -@property UIImage * image; -@end - - -@implementation MLOResourceImage - -+(MLOResourceImage *)imageWithName:(NSString *) name{ - return [MLOResourceImage imageWithName:name size:NORMAL]; -} - -+(MLOResourceImage *)imageWithName:(NSString *) name size:(MLOResourceImageSize) size{ - MLOResourceImage * image = [MLOResourceImage new]; - if(image){ - image.name = name; - image.image = [MLOResourceImage getButtonImage:name size:size]; - } - return image; -} - -+(UIImage *) getButtonImage:(NSString *) name size:(MLOResourceImageSize) size{ - return [MLOResourceImage getImage: [@"Button" stringByAppendingString:name] size:size]; -} - -+(UIImage *) getImage:(NSString *) midfix size:(MLOResourceImageSize) size{ - return [UIImage imageNamed: [MLOResourceImage getImageName:midfix size:size]]; -} - -+(NSString *) getImageName:(NSString *) midfix size:(MLOResourceImageSize) size{ - return [NSString stringWithFormat: [MLOResourceImage formatForSize:size],midfix]; -} -+(NSString *) getImageName:(NSString *) midfix type:(MLOResourceImageType) type size:(MLOResourceImageSize) size{ - return [MLOResourceImage getImageName: [midfix stringByAppendingString:[MLOResourceImage midfixSuffixForType:type]] - size: size]; -} -+(UIImage *) getImage:(NSString *) midfix type:(MLOResourceImageType) type size:(MLOResourceImageSize) size{ - return [UIImage imageNamed: [MLOResourceImage getImageName:midfix type: type size:size]]; -} - -+(NSString *) midfixSuffixForType:(MLOResourceImageType) type{ - switch (type) { - case IMAGE: return @""; - case MASK: return @"Mask"; - } -} - - -+(NSString *) formatForSize:(MLOResourceImageSize) size{ - switch (size) { - case NORMAL: return @"MLO%@.png"; - case RETINA: return @"MLO%@@2x.png"; - } -} - -+(UIImage *) loLogo{ - return [self getImage:@"LibreOfficeLogo" size:NORMAL]; -} - -+(MLOResourceImage *) backWithSize:(MLOResourceImageSize) size{ - return [MLOResourceImage imageWithName:@"Back" size:size]; -} -+(MLOResourceImage *) shrink{ - return [MLOResourceImage imageWithName:@"Shrink"]; -} -+(MLOResourceImage *) expand{ - return [MLOResourceImage imageWithName:@"Expand"]; -} -+(MLOResourceImage *) edit{ - return [MLOResourceImage imageWithName:@"Edit"]; -} -+(MLOResourceImage *) find{ - return [MLOResourceImage imageWithName:@"Find"]; -} -+(MLOResourceImage *) print{ - return [MLOResourceImage imageWithName:@"Print"]; -} -+(MLOResourceImage *) save{ - return [MLOResourceImage imageWithName:@"Save"]; -} -+(MLOResourceImage *) left{ - return [MLOResourceImage imageWithName:@"Left"]; -} -+(MLOResourceImage *) right{ - return [MLOResourceImage imageWithName:@"Right"]; -} -+(MLOResourceImage *) selectionHandle{ - return [MLOResourceImage imageWithName:@"SelectionHandle"]; -} -+(NSString *) magnifierName:(MLOResourceImageType) type{ - return [MLOResourceImage getImageName:@"Magnifier" type:type size:RETINA]; -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.h deleted file mode 100644 index 1655502ce9f9..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.h +++ /dev/null @@ -1,26 +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 <UIKit/UIKit.h> -#import "MLOCommon.h" - -typedef enum {ZERO, ONE, INITIAL,FULL_SCREEN} MLORectSize; -#define MLORectSizeString(enum) [@[@"ZERO",@"ONE",@"INITIAL",@"FULL_SCREEN"] objectAtIndex:enum] - -@interface MLOSubView : UIView - -@property CGFloat fadeDuration; - -- (id)initWithFrame:(CGRect)frame color:(UIColor *) color cornerRadius:(CGFloat) cornerRadius alpha:(CGFloat) alpha; -- (id)initHiddedWithColor:(UIColor *) color cornerRadius:(CGFloat) cornerRadius; -- (id)initHiddedWithColor:(UIColor *) color; --(void)fade:(MLOFadeType) type; --(void)fadeToPercent:(CGFloat) toPercent; --(void)setSize:(MLORectSize) size; --(void) hide; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.m deleted file mode 100644 index f12ea643aace..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOSubView.m +++ /dev/null @@ -1,97 +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 "MLOCommon.h" -#import "MLOSubView.h" - -#import <QuartzCore/QuartzCore.h> - -#define SIZE_CASE(CASE,RECT) case CASE: self.frame = self.bounds = RECT;break; - -static const CGFloat DEFAULT_FADE_DURAION= 1.0f; - -@interface MLOSubView () -@property CGRect defaultRect; -@end - -@implementation MLOSubView - -- (id)initWithFrame:(CGRect)frame color:(UIColor *) color cornerRadius:(CGFloat) cornerRadius alpha:(CGFloat) alpha -{ - self = [super initWithFrame:frame]; - if (self) { - self.defaultRect = frame; - self.backgroundColor = color; - self.fadeDuration = DEFAULT_FADE_DURAION; - - if([self isLegalNewAlpha:alpha]){ - self.alpha = alpha; - } - - if(cornerRadius >= 0){ - [self.layer setCornerRadius:cornerRadius]; - [self.layer setMasksToBounds:YES]; - } - } - return self; -} - -- (id)initHiddedWithColor:(UIColor *) color cornerRadius:(CGFloat) cornerRadius{ - - return [self initWithFrame:CGRECT_ZERO color:color cornerRadius:cornerRadius alpha: 0.0f]; -} - -- (id)initHiddedWithColor:(UIColor *) color{ - return [self initHiddedWithColor:color cornerRadius:-1.0f]; -} - - --(BOOL)isLegalNewAlpha:(CGFloat) alpha{ - return (alpha>=0) && (alpha<=1) && (alpha!= self.alpha); -} - - --(void)fade:(MLOFadeType) type{ - CGFloat alpha; - switch (type) { - case IN: alpha = 1.0f; break; - case OUT: alpha = 0.0f; break; - } - [self fadeToPercent:alpha]; -} - - --(void)setSize:(MLORectSize) size{ - - switch(size){ - SIZE_CASE(ZERO, CGRECT_ZERO) - SIZE_CASE(ONE, CGRECT_ONE) - SIZE_CASE(INITIAL, _defaultRect) - SIZE_CASE(FULL_SCREEN, [[UIApplication sharedApplication] keyWindow].frame) - } -} - --(void) hide{ - self.alpha=0; - [self setSize:ZERO]; -} - --(void)fadeToPercent:(CGFloat) toPercent{ - if([self isLegalNewAlpha:toPercent]){ - - [UIView animateWithDuration:1.0 animations:^{ - - self.alpha = toPercent; - - }]; - } -} - - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.h b/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.h deleted file mode 100644 index 105c7540cdf8..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.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 <UIKit/UIKit.h> -#import "MLOCommon.h" - -@interface MLOViewController : UIViewController - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.m b/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.m deleted file mode 100644 index 1dacf2249ba1..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/MLOViewController.m +++ /dev/null @@ -1,18 +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" - -@interface MLOViewController () - -@end - -@implementation MLOViewController - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.h b/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.h deleted file mode 100644 index 30be1e2a44a5..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.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> - -@interface NSObject (MLOUtils) --(CGRect) getFullFrameForRect:(CGRect) similarRect; --(void) performBlock:(void (^)(void))block - afterDelay:(NSTimeInterval)delay; --(BOOL)returnSuccees:(BOOL) success forAction:(NSString *) action andAlertForError:(NSError *) error; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.m b/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.m deleted file mode 100644 index 5a4e27c09da0..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/utils/NSObject+MLOUtils.m +++ /dev/null @@ -1,66 +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 "NSObject+MLOUtils.h" -static CGFloat smaller = -1,bigger = -1; -static CGRect portrait,landscape; - -@implementation NSObject (MLOUtils) - --(void)fetchStatics{ - if(smaller<0){ - smaller = [UIScreen mainScreen].bounds.size.height; - bigger = [UIScreen mainScreen].bounds.size.width; - if(smaller> bigger){ - NSInteger temp = bigger; - bigger= smaller; - smaller= temp; - } - portrait = CGRectMake(0, 0, smaller, bigger); - landscape = CGRectMake(0, 0, bigger, smaller); - } -} - --(CGRect) getFullFrameForRect:(CGRect) similarRect{ - [self fetchStatics]; - if(similarRect.size.width >smaller){ - - return landscape; - } - return portrait; -} -- (void)performBlock:(void (^)(void))block - afterDelay:(NSTimeInterval)delay -{ - [self performSelector:@selector(fireBlockAfterDelay:) - withObject:block - afterDelay:delay]; -} - -- (void)fireBlockAfterDelay:(void (^)(void))block { - block(); -} - --(BOOL)returnSuccees:(BOOL) success forAction:(NSString *) action andAlertForError:(NSError *) error { - if(!success){ - - UIAlertView *failedDeleteAlert = - [[UIAlertView alloc]initWithTitle:@"Meh:" - message:[NSString stringWithFormat:@"Failed to perform: %@",action] - delegate:self - cancelButtonTitle:@"Close" - otherButtonTitles:nil]; - - [failedDeleteAlert show]; - - NSLog(@"Could not %@ :%@ ",action,[error localizedDescription]); - } - return success; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.h deleted file mode 100644 index bd30ba7181d9..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.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" - -@class MLORenderManager,MLOSelectionViewController,MLOScrollerViewController,MLOKeyboardManager; -@interface MLOMainViewController : MLOViewController<UITextViewDelegate> - -@property MLOSelectionViewController * selection; -@property MLOScrollerViewController * scroller; -@property MLOKeyboardManager * keyboard; -@property UIView * canvas; - --(void) rotate; --(void) showLibreOffice:(UIWindow *) window; --(void) onTextEdit; --(void) hideLibreOffice; --(BOOL) isTappable; --(void) flash; --(CGFloat) getZoom; -@end - -// vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.m deleted file mode 100644 index 518a66e12505..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController.m +++ /dev/null @@ -1,186 +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 "MLOToolbarViewController.h" -#import "MLOSelectionViewController.h" -#import "MLOGestureEngine.h" -#import "MLOScrollerViewController.h" -#import "MLOManager.h" -#import "MLOGestureLimiter.h" -#import "MLOGestureEngine_Impl.h" -#import "MLORenderManager.h" -#import "NSObject+MLOUtils.h" -#import "MLOTopbarViewController.h" -#import "MLOMainViewController_Private.h" -#import "MLOKeyboardManager.h" -#import "MLOAppRoleFactory.h" -#import "MLOAppRoleBase.h" -#import "mlo_uno.h" - -static const CGFloat - FLASH_DURATION= 0.2f, - EXPAND_DURATION=0.5f; - -@implementation MLOMainViewController - --(void)onTextEdit{ - [_scroller contentHasChanged]; -} - --(BOOL)isTappable{ - return [_toolbar isTappable]; -} - --(void)showLibreOffice:(UIWindow *) window{ - - self.topBarHeight = TOP_BAR_HEIGHT; - - [[UIApplication sharedApplication]setStatusBarHidden:YES]; - - self.view.bounds = self.view.frame = [self getFullFrameForRect:self.view.frame]; - - [self.role initWindow:window]; - - [self onStart]; - - [self.topbar showLibreOffice]; - - [self.role showLibreOffice]; - -} - --(void)onStart{ - self.focused = YES; - [self rotate]; -} - --(void) hideLibreOffice{ - if(self.focused){ - - self.focused = NO; - - [self.topbar hideLibreOffice]; - - [[UIApplication sharedApplication]setStatusBarHidden:NO]; - - [self.role hideLibreOffice]; - [self.view removeFromSuperview]; - - [[MLOManager getInstance] hideLibreOffice]; - } -} - --(void)initCanvas{ - self.view.frame = self.view.bounds =[self getFullFrameForRect:[[MLOManager getInstance] bounds]]; - CGRect canvasRect = CGRectMake(0, - TOP_BAR_HEIGHT, - self.view.frame.size.width, - self.view.frame.size.height - TOP_BAR_HEIGHT); - self.canvas = [[UIView alloc] initWithFrame:canvasRect]; - self.role.view = self.canvas; - self.canvas.clipsToBounds = YES; - self.canvas.backgroundColor = [UIColor whiteColor]; -} - -- (id) init{ - self = [super init]; - if(self){ - - self.role = [MLOAppRoleFactory getInstanceWithMainViewController:self]; - - [self initCanvas]; - - [self.role initSubviews]; - - self.topbar = [[MLOTopbarViewController alloc] initWithMainViewController:self]; - - [self addSubviews]; - - [self onStart]; - - self.focused = NO; - self.topBarHeight = TOP_BAR_HEIGHT; - } - return self; -} - --(void) flash{ - self.flasher.frame =self.view.frame; - self.flasher.alpha = 1.0f; - [self.view addSubview:_flasher]; - [UIView animateWithDuration:FLASH_DURATION animations:^{ - self.flasher.alpha=0.0f; - } completion:^(BOOL finished) { - [self.flasher removeFromSuperview]; - }]; -} - --(void) toggleExpand{ - CGFloat targetHeight = (_topBarHeight==0.0f)?TOP_BAR_HEIGHT:0.0f; - CGRect mainFrame = self.view.frame; - - [UIView animateWithDuration:EXPAND_DURATION animations:^(void){ - - self.canvas.frame = CGRectMake(0, targetHeight, mainFrame.size.width, mainFrame.size.height - targetHeight); - self.renderManager.view.alpha= 0.0f; - - - } completion:^(BOOL completed){ - - self.topBarHeight = targetHeight; - [self rotate]; - [self.toolbar expandDidToggle]; - }]; -} - --(void)resize{ - CGRect mainViewRect = [self getFullFrameForRect:self.view.bounds]; - LOG_RECT(mainViewRect, @"MLO Resize: main view"); - - self.view.bounds = self.view.frame = mainViewRect; - - CGFloat width = self.view.frame.size.width; - CGFloat height = self.view.frame.size.height - self.topBarHeight; - - CGRect canvasRect =CGRectMake(0, _topBarHeight, width, height); - self.canvas.frame = canvasRect; - [self.role setWidth:width height:height]; - - LOG_RECT(canvasRect, @"MLO Resize: canvas"); -} - --(void) addSubviews{ - - [self.topbar addToMainViewController]; - [self.view addSubview:self.canvas]; - self.view.backgroundColor = [UIColor whiteColor]; - [self.role addSubviews]; -} - --(void)rotate{ - if(self.focused){ - [self.role rotate]; - } -} - --(void)resetSubviews{ - - [_gestureEngine reset]; - [_scroller reset]; - [_selection reset]; -} - --(CGFloat) getZoom{ - return [_gestureEngine.limiter zoom]; -} - - -@end - - -// vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h deleted file mode 100644 index b15a63a7a023..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h +++ /dev/null @@ -1,18 +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 "MLOMainViewController.h" - -static const CGFloat TOP_BAR_HEIGHT =40.0f; - -@class MLOGestureEngine,MLORenderManager; -@interface MLOMainViewController () -@property MLOGestureEngine * gestureEngine; -@property MLORenderManager * renderManager; --(void) toggleExpand; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h deleted file mode 100644 index 37f6a385c97f..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h +++ /dev/null @@ -1,22 +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 "MLOMainViewController_Friend.h" - -@class MLOAppRoleBase,MLOToolbarButton,MLOTopbarViewController,MLOToolbarViewController; -@interface MLOMainViewController () -@property BOOL focused; -@property CGFloat topBarHeight; -@property UIView * flasher; -@property MLOTopbarViewController * topbar; -@property MLOToolbarViewController * toolbar; -@property MLOAppRoleBase * role; - --(void)resize; --(void)resetSubviews; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h deleted file mode 100644 index 041e19862ea7..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.h +++ /dev/null @@ -1,23 +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 "MLOObject.h" - -typedef enum {WIDTH_IS_HEIGHT,WIDTH_IS_NOT_HEIGHT} MLOTestingTileParametersMode; -#define MLOTestingTileParametersModeString(enum) [@[@"WIDTH_IS_HEIGHT",@"WIDTH_IS_NOT_HEIGHT"] objectAtIndex:enum] - -typedef void (^MLOTestingTileParameterExtractor)(CGFloat value); - -@class MLOTestingTileParametersViewController; -@interface MLOTestingTileParameter : MLOObject --(MLOTestingTileParameter *)initWithParams:(MLOTestingTileParametersViewController *) params label:(NSString *)label widthIsNotHeightExtractor:(MLOTestingTileParameterExtractor) widthIsNotHeightExtractor widthIsHeightExtractor:(MLOTestingTileParameterExtractor) widthIsHeightExtractor defaultValue:(NSInteger) defaultValue; --(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 deleted file mode 100644 index f43dfb8e322b..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m +++ /dev/null @@ -1,204 +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 "MLOTestingTileParameter.h" -#import "MLOTestingTileParametersViewController.h" - -@interface MLOTestingTileParameter () -@property MLOTestingTileParametersViewController * params; -@property (nonatomic,strong) MLOTestingTileParameterExtractor widthIsHeightExtractor; -@property (nonatomic,strong) MLOTestingTileParameterExtractor widthIsNotHeightExtractor; -@property UILabel * label; -@property UITextField * data; -@property UITextField * step; -@property NSInteger defaultValue; -@property UIStepper * dataStepper; -@property UIStepper * stepStepper; -@end - -static const CGFloat DEFAULT_STEP_VALUE = 10; - -@implementation MLOTestingTileParameter - --(MLOTestingTileParameter *)initWithParams:(MLOTestingTileParametersViewController *) params label:(NSString *)label widthIsNotHeightExtractor:(MLOTestingTileParameterExtractor) widthIsNotHeightExtractor widthIsHeightExtractor:(MLOTestingTileParameterExtractor) widthIsHeightExtractor defaultValue:(NSInteger) defaultValue{ - NSLog(@"Creating tile testing param %@ with default value %d",label,defaultValue); - self = [self init]; - if(self){ - self.params = params; - self.widthIsHeightExtractor = widthIsHeightExtractor; - self.widthIsNotHeightExtractor = widthIsNotHeightExtractor; - self.defaultValue = defaultValue; - [self initLabel:label]; - self.dataStepper = [self stepperWithMinValue:-MAXFLOAT]; - self.stepStepper = [self stepperWithMinValue:1]; - // The step stepper obviously needs a step value of 1, - // and an initial value of DEFAULT_STEP_VALUE. - self.stepStepper.stepValue = 1; - self.stepStepper.value = DEFAULT_STEP_VALUE; - [self initDataTextField]; - [self initStepTextField]; - } - return self; -} - --(UIStepper *) stepperWithMinValue:(CGFloat) minValue{ - UIStepper * stepper = [UIStepper new]; - stepper.maximumValue = MAXFLOAT; - stepper.minimumValue = minValue; - stepper.stepValue = DEFAULT_STEP_VALUE; - stepper.autorepeat = YES; - stepper.continuous = NO; - [stepper addObserver:self forKeyPath:@"value" - options: NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld - context:0]; - return stepper; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - - if (object == self.dataStepper) { - NSNumber * newNumber = change[NSKeyValueChangeNewKey]; - NSNumber * oldNumber = change[NSKeyValueChangeOldKey]; - - CGFloat value = [self currentDataValue] + [newNumber floatValue] - [oldNumber floatValue]; - - if(value == ((NSInteger) value)){ - self.data.text = [[NSNumber numberWithInteger:(NSInteger) value] stringValue]; - }else{ - self.data.text = [[NSNumber numberWithFloat:value] stringValue]; - } - [self.params renderTile]; - }else if (object == self.stepStepper){ - - NSNumber * floatNumber = change[NSKeyValueChangeNewKey]; - NSInteger value = [floatNumber integerValue]; - NSNumber * newValue = [NSNumber numberWithInteger:value]; - self.step.text = [newValue stringValue]; - self.dataStepper.stepValue = [newValue floatValue]; - } -} - - --(void)initStepTextField{ - - self.step =[[UITextField alloc] initWithFrame:CGRECT_ZERO]; - self.data.textAlignment = NSTextAlignmentLeft; - self.step.text = [[NSNumber numberWithInteger:(NSInteger)DEFAULT_STEP_VALUE] stringValue]; -} - --(NSString *)description{ - return [@"MLOTestingTileParameter: " stringByAppendingString:self.label.text]; -} - --(void) initLabel:(NSString *) label{ - self.label =[[UILabel alloc] initWithFrame:CGRECT_ZERO]; - self.label.text = label; - self.label.textAlignment = NSTextAlignmentCenter; -} - --(void) initDataTextField{ - self.data = [[UITextField alloc] initWithFrame:CGRECT_ZERO]; - [self.data setKeyboardType:UIKeyboardTypeNumberPad]; - self.data.textAlignment = NSTextAlignmentLeft; - [self resetValue]; -} - --(void)resetValue{ - - self.data.text = [NSString stringWithFormat:@"%d",self.defaultValue]; -} - --(void)setParamFrame:(CGRect) paramFrame{ - NSLog(@"%@ setParamFrame",self); - - CGFloat x = paramFrame.origin.x; - CGFloat y = paramFrame.origin.y; - CGFloat w = paramFrame.size.width; - CGFloat h = paramFrame.size.height; - - CGFloat labelW = w/3.0f; - CGFloat otherW = w/6.0f; - - self.label.frame=CGRectMake(x, - y, - labelW, - h); - self.data.frame =CGRectMake(x + labelW, - y, - otherW, - h); - self.dataStepper.frame = CGRectMake(x + labelW + otherW, - y, - otherW, - h); - - self.step.frame = CGRectMake(x + labelW + 2*otherW, - y, - otherW, - h); - self.stepStepper.frame = CGRectMake(x + labelW + 3*otherW, - y, - otherW, - h); - -} - --(void)addToSuperview{ - NSLog(@"%@ addToSuperview",self); - [self.params.view addSubview:self.label]; - [self.params.view addSubview:self.data]; - [self.params.view addSubview:self.dataStepper]; - [self.params.view addSubview:self.step]; - [self.params.view addSubview:self.stepStepper]; -} - --(BOOL)isNumber:(NSString *) string{ - - return [[NSNumberFormatter new]numberFromString:string] == nil; -} - --(CGFloat) currentDataValue{ - if([self isNumber:self.data.text]){ - - NSLog(@"%@ got illegal value: %@, reseting to %d",self,self.data.text,self.defaultValue); - - [self resetValue]; - } - return [self.data.text floatValue]; -} - --(MLOTestingTileParameterExtractor) getExtractor:(MLOTestingTileParametersMode) mode{ - switch (mode) { - case WIDTH_IS_HEIGHT: - return self.widthIsHeightExtractor; - case WIDTH_IS_NOT_HEIGHT: - return self.widthIsNotHeightExtractor; - } -} - --(void)extractMode:(MLOTestingTileParametersMode) mode{ - MLOTestingTileParameterExtractor extractor = [self getExtractor:mode]; - if(extractor!=nil){ - // NSLog(@"%@ extract %@",self,MLOTestingTileParametersModeString(mode)); - 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/MLOTopbarViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTopbarViewController.h deleted file mode 100644 index 1eac2d7b889b..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTopbarViewController.h +++ /dev/null @@ -1,17 +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 "MLOObject.h" -@class MLOMainViewController; -@interface MLOTopbarViewController : MLOObject --(void)addToMainViewController; --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void)hideLibreOffice; --(void)showLibreOffice; --(void)onRotate; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTopbarViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTopbarViewController.m deleted file mode 100644 index 7799e500f733..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTopbarViewController.m +++ /dev/null @@ -1,93 +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 "MLOTopbarViewController.h" -#import "MLOMainViewController_Friend.h" -#import "MLOMainViewController.h" -#import "MLOButton.h" -#import "MLOResourceImage.h" -#import "MLOManager.h" - -@interface MLOTopbarViewController () -@property MLOMainViewController * mainViewController; -@property UIView * blackbox; -@property MLOButton * button; -@property UILabel * label; -@property MLOResourceImage * buttonImage; -@end - -static const CGFloat - BUTTON_LEFT_SPACING = 18.0f, - FONT_SIZE = 15.0f; - - -@implementation MLOTopbarViewController --(id)initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [self init]; - if(self){ - self.mainViewController = mainViewController; - - self.blackbox = [[UIView alloc] initWithFrame:CGRECT_ZERO]; - _blackbox.backgroundColor = [UIColor blackColor]; - - self.label = [[UILabel alloc] initWithFrame:CGRECT_ZERO]; - _label.textColor = [UIColor whiteColor]; - _label.backgroundColor = [UIColor clearColor]; - _label.textAlignment = NSTextAlignmentCenter; - _label.font =[UIFont systemFontOfSize:FONT_SIZE]; - - self.buttonImage = [MLOResourceImage backWithSize:NORMAL]; - self.button = [MLOButton buttonWithImage:_buttonImage]; - [_button addTarget:_mainViewController action:@selector(hideLibreOffice)]; - - [self hideLibreOffice]; - } - return self; -} --(void)addToMainViewController{ - [_mainViewController.view addSubview:_blackbox]; - [_mainViewController.view addSubview:_button]; - [_mainViewController.view addSubview:_label]; -} - --(void)hideLibreOffice{ - _button.alpha =0.0f; - _button.alpha =0.0f; - _label.alpha =0.0f; - _blackbox.frame = CGRECT_ZERO; - _button.frame =CGRECT_ZERO; - _label.frame = CGRECT_ZERO; -} - --(void)showLibreOffice{ - _blackbox.alpha= 1.0f; - _button.alpha = 1.0f; - _label.alpha=1.0f; - _label.text = [[MLOManager getInstance] filenameWithExtension]; -} - --(void)onRotate{ - - CGFloat screenWidth = _mainViewController.view.frame.size.width; - - _blackbox.frame = CGRectMake(0,0,screenWidth,TOP_BAR_HEIGHT); - - _button.frame = CGRectMake(0,//BUTTON_LEFT_SPACING, - 0,//(TOP_BAR_HEIGHT - _buttonImage.image.size.height)/2.0f, - TOP_BAR_HEIGHT,// _buttonImage.image.size.width, - TOP_BAR_HEIGHT);// _buttonImage.image.size.height); - - static const CGFloat - LABEL_Y = (TOP_BAR_HEIGHT - FONT_SIZE)/4.0f, - LABEL_HEIGHT = TOP_BAR_HEIGHT - LABEL_Y; - - _label.frame = CGRectMake(BUTTON_LEFT_SPACING, LABEL_Y, screenWidth-BUTTON_LEFT_SPACING, LABEL_HEIGHT); -} - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.h deleted file mode 100644 index 65371709dfca..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.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 "MLOViewController.h" -#import "MLOAppRoleProtocol.h" -@class MLOMainViewController,MLOAppRoleBase; -@interface MLOAppRoleBase : MLOViewController<MLOAppRoleProtocol> - -@property MLOMainViewController * mainViewController; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m deleted file mode 100644 index 02f7ce9b3bff..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m +++ /dev/null @@ -1,13 +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 "MLOAppRoleBase.h" - -@implementation MLOAppRoleBase - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.h deleted file mode 100644 index 262f7c48fa24..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.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 "MLOObject.h" - -@class MLOAppRoleBase,MLOMainViewController; -@interface MLOAppRoleFactory : MLOObject -+(MLOAppRoleBase *) getInstanceWithMainViewController:(MLOMainViewController *) mainViewController; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m deleted file mode 100644 index ba27a4f36320..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m +++ /dev/null @@ -1,37 +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 "MLOAppRoleFactory.h" -#import "MLOAppRoleLoApp.h" -#import "MLOAppRoleTileTester.h" -#import "MLOMainViewController.h" - -@implementation MLOAppRoleFactory - -+(MLOAppRoleBase *) getInstanceWithMainViewController:(MLOMainViewController *) mainViewController{ - MLOAppRoleBase * role; - - NSLog(@"Creating app role: %@",MLOAppRoleString(APP_ROLE)); - - switch (APP_ROLE) { - case LO_APP: - { - role = [MLOAppRoleLoApp new]; - break; - } - case TILE_TESTER: - { - role= [MLOAppRoleTileTester new]; - break; - } - } - role.mainViewController = mainViewController; - return role; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h deleted file mode 100644 index 8fb181b810a2..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h +++ /dev/null @@ -1,13 +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 "MLOAppRoleBase.h" - -@interface MLOAppRoleLoApp : MLOAppRoleBase - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m deleted file mode 100644 index fc3fb4ce004a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m +++ /dev/null @@ -1,112 +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 "MLOAppRoleLoApp.h" -#import "MLOMainViewController_Private.h" -#import "MLORenderManager.h" -#import "MLOGestureEngine.h" -#import "MLOToolbarViewController.h" -#import "MLOSelectionViewController.h" -#import "MLOScrollerViewController.h" -#import "MLOTopbarViewController.h" -#import "MLOKeyboardManager.h" - -static const NSTimeInterval ROTATE_FLASH_DURATION=0.5f; - -@implementation MLOAppRoleLoApp - --(NSString *)description{ - return @"MLOAppRoleLoApp"; -} - --(void)initSubviews{ - MLOMainViewController * main = [self mainViewController]; - main.scroller = [[MLOScrollerViewController alloc] initWithMainViewController:main]; - main.selection = [[MLOSelectionViewController alloc] initWithMainViewController: main]; - main.toolbar = [[MLOToolbarViewController alloc] initWithMainViewController:main]; - main.keyboard = [[MLOKeyboardManager alloc]initWithMainViewController:main]; - main.flasher =[[UIView alloc] initWithFrame:CGRECT_ZERO]; - main.flasher.alpha = 0.0f; - main.flasher.backgroundColor = [UIColor whiteColor]; - main.gestureEngine = nil; -} - --(void)setWidth:(CGFloat) width height:(CGFloat) height{ - - [[self mainViewController].renderManager setWidth:width height:height]; -} - --(void)addSubviews{ - - MLOMainViewController * main = [self mainViewController]; - main.renderManager = [MLORenderManager getInstance]; - - [main resize]; - - [main.canvas addSubview: main.renderManager.view]; - - main.gestureEngine = [[MLOGestureEngine alloc] initWithMainViewController:main]; - [main.toolbar addToMainViewController]; - [main.scroller addToMainViewController]; - [main.selection addToMainViewController]; - [main.keyboard addToMainViewController]; -} - --(void)rotate{ - - MLOMainViewController * main = self.mainViewController; - - NSLog(@"MLO rotate"); - - main.renderManager.view.alpha= 0.0f; - - [main resize]; - - [main.gestureEngine onRotate]; - - [main.topbar onRotate]; - - [main.scroller reset]; - - [main.scroller showLibreOffice]; - - [main.selection onRotate]; - - [main.toolbar onRotate]; - - [UIView animateWithDuration:ROTATE_FLASH_DURATION animations:^(void){ - main.renderManager.view.alpha=1.0f; - }]; -} - - --(void)showLibreOffice{ - - [self.mainViewController.toolbar showLibreOffice]; - [self.mainViewController.keyboard showLibreOffice]; -} - --(void)hideLibreOffice{ - MLOMainViewController * main = self.mainViewController; - - [main.toolbar hideLibreOffice]; - [main resetSubviews]; - [main.gestureEngine hideLibreOffice]; - [main.scroller hideLibreOffice]; - [main.selection reset]; - [main.keyboard hideLibreOffice]; -} - --(void)initWindow:(UIWindow *) window{ - MLOMainViewController * main = self.mainViewController; - [main.renderManager setWidth:main.view.frame.size.width height:main.view.frame.size.height]; - - [main.gestureEngine showLibreOffice:window]; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h deleted file mode 100644 index fcbbdedc9ec4..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h +++ /dev/null @@ -1,21 +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> - -@protocol MLOAppRoleProtocol <NSObject> - -@optional --(void)initSubviews; --(void)setWidth:(CGFloat) width height:(CGFloat) height; --(void)addSubviews; --(void)rotate; --(void)initWindow:(UIWindow *) window; --(void)showLibreOffice; --(void)hideLibreOffice; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h deleted file mode 100644 index 01f121ee2d40..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h +++ /dev/null @@ -1,15 +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 "MLOAppRoleBase.h" -@class MLOTestingTileRendererViewController,MLOTestingTileParametersViewController; -@interface MLOAppRoleTileTester : MLOAppRoleBase -@property MLOTestingTileRendererViewController * renderer; -@property MLOTestingTileParametersViewController * params; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m deleted file mode 100644 index 743c0c113cde..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m +++ /dev/null @@ -1,78 +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 "MLOAppRoleTileTester.h" -#import "MLOMainViewController_Private.h" -#import "MLOTopbarViewController.h" -#import "MLOTestingTileRendererViewController.h" -#import "MLOTestingTileParametersViewController.h" - - -@implementation MLOAppRoleTileTester - --(void)initSubviews{ - NSLog(@"%@ initSubviews",self); - self.renderer = [[MLOTestingTileRendererViewController alloc] initWithTester:self]; - self.params = [[MLOTestingTileParametersViewController alloc] initWithTester:self]; - -} - --(NSString *)description{ - return @"MLOAppRoleTileTester"; -} - - --(void)setWidth:(CGFloat) width height:(CGFloat) height{ - NSLog(@"%@ setWidth:height",self); - if(width > height){ - CGFloat halfWidth = width/2.0f; - self.renderer.view.frame =CGRectMake(0, 0, halfWidth, height); - self.params.view.frame =CGRectMake(halfWidth,0, halfWidth, height); - }else{ - CGFloat halfHeight = height/2.0f; - self.params.view.frame =CGRectMake(0, 0, width, halfHeight); - self.renderer.view.frame =CGRectMake(0,halfHeight, width, halfHeight); - } - [self.renderer resize]; - [self.params resize]; - -} --(void)addSubviews{ - NSLog(@"%@ addSubviews",self); - - [self.renderer addToSuperview]; - [self.params addToSuperview]; - - [self.mainViewController resize]; -} - --(void)rotate{ - NSLog(@"%@ rotate",self); - MLOMainViewController * main = [self mainViewController]; - - [main resize]; - - [main.topbar onRotate]; - - [self.renderer resize]; - [self.params resize]; -} - - --(void)showLibreOffice{ - NSLog(@"%@ showLibreOffice",self); -} --(void)hideLibreOffice{ - NSLog(@"%@ hideLibreOffice",self); -} - --(void)initWindow:(UIWindow *) window{ - NSLog(@"%@ initWindow",self); - -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.h deleted file mode 100644 index d47b4db00f32..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.h +++ /dev/null @@ -1,33 +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 "MLOObject.h" - -static const CGFloat - PIXEL_TO_LOGIC_RATIO = 14.978,//513885/30/MLO_IPAD_HEIGHT_IN_PIXELS, - CANVAS_WIDTH_IN_LOGIC = 13000, - // NOTE: - // value keeps shifting between 14.975 and 14.984, - // though mostly it is on the 14.975 area - - LO_PAGE_SEPARATOR_HEIGHT_IN_LOGIC = 18 * PIXEL_TO_LOGIC_RATIO, - LO_HORIZONAL_BORDER_WIDTH_IN_LOGIC = 18 * PIXEL_TO_LOGIC_RATIO, - PORTRAIT_PAGE_HEIGHT_IN_LOGIC_WITH_SEPARATOR = 513885 /30, - PORTRAIT_PAGE_HEIGHT_IN_LOGIC_WITHOUT_SEPARATOR = PORTRAIT_PAGE_HEIGHT_IN_LOGIC_WITH_SEPARATOR - LO_PAGE_SEPARATOR_HEIGHT_IN_LOGIC; - -@class MLOMainViewController, MLOScrollerTooltip,MLOScrollerGridViewController; -@interface MLOScrollerData : MLOObject --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void) onRotateWithGrid:(MLOScrollerGridViewController *) grid; --(NSInteger) getTotalPages; --(CGRect) getNewScrollerFrame; --(CGRect) getShiftedScrollerFrame:(CGFloat) pixelDeltaX; --(void) updateTooltip:(MLOScrollerTooltip *) tooltip withGrid:(MLOScrollerGridViewController *) grid; --(void) showLibreOffice; --(void) hideLibreOffice; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.m deleted file mode 100644 index 61d0f1eadb58..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerData.m +++ /dev/null @@ -1,209 +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 "MLOScrollerData.h" -#import "MLOMainViewController_Friend.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOScrollerGridViewController.h" -#import "MLOScrollerTooltip.h" -#import "MLOGestureLimiter.h" -#import "mlo_uno.h" -#import "mlo_utils.h" - -@interface MLOScrollerData () - -@property int left, top, zoom, visibleLeft, visibleTop, visibleRight, visibleBottom, zoomType, isBooklet; -@property float totalPages, totalHeightInLogic, frameWidth, frameHeight, scrollerX, scrollerTotalHeight,tooltipPageHeight,tooltipX,tooltipMaxY; -@property NSMutableString *mutableString; -@property CGRect maxCanvas,contentCanvas,visibleCanvas; -@property MLOMainViewController * mainViewController; - -@end - -static const float - SCROLLER_WIDTH=10, - SCROLLER_PADDING = 0, - - GRID_TO_TOOLTIP_DISTANCE = 2.0f, - - TOOLTIP_HEIGHT=60, - TOOLTIP_WIDTH=100, - - FLOAT_RESET=-1.0f; - -static const int INT_RESET= -1; - -@implementation MLOScrollerData - - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController{ - self= [super init]; - if(self){ - self.mutableString = [NSMutableString stringWithString:@""]; - self.mainViewController = mainViewController; - [self reset]; - } - return self; -} - --(void) showLibreOffice{ -} - --(void)hideLibreOffice{ - [self reset]; -} - --(void)reset{ - _tooltipMaxY= _tooltipPageHeight = _tooltipX = _totalPages = _totalHeightInLogic = _frameWidth= _frameHeight= _scrollerX= _scrollerTotalHeight = FLOAT_RESET; - _left = _top = _zoom = _visibleLeft = _visibleTop = _visibleRight = _visibleBottom = _zoomType = _isBooklet = INT_RESET; - -} - --(void) updateViewData{ - - mlo_fetch_view_data(_mutableString); - - sscanf([_mutableString UTF8String], "%d;%d;%d;%d;%d;%d;%d;%d;%d;", - &_left, - &_top, - &_zoom, - &_visibleLeft, - &_visibleTop, - &_visibleRight, - &_visibleBottom, - &_zoomType, - &_isBooklet); - - if(LOG_GET_VIEW_DATA){ - NSLog(@"left=%d top=%d zoom=%d vLeft=%d vTop=%d vRight=%d vBottom=%d zoomType=%d isBooklet=%d", - _left, - _top, - _zoom, - _visibleLeft, - _visibleTop, - _visibleRight, - _visibleBottom, - _zoomType, - _isBooklet); - } -} - --(BOOL)canCalculateDocumentSizeInLogic{ - return (_totalHeightInLogic != FLOAT_RESET); -} - --(void) onRotateWithGrid:(MLOScrollerGridViewController *) grid{ - static const float SCROLLLER_X_OFFSET =SCROLLER_PADDING + SCROLLER_WIDTH , - DOUBLE_SCROLLER_PADDING =2*SCROLLER_PADDING, - GRID_X_OFFSET= MLO_SCROLLER_GRID_WIDTH, - TOOLTIP_X_OFFSET= GRID_X_OFFSET + GRID_TO_TOOLTIP_DISTANCE+ TOOLTIP_WIDTH; - - CGRect canvasFrame = _mainViewController.canvas.frame; - - _frameHeight = canvasFrame.size.height; - - _frameWidth = canvasFrame.size.width; - - _scrollerX = _frameWidth - SCROLLLER_X_OFFSET; - - _tooltipX = _frameWidth - TOOLTIP_X_OFFSET; - - _tooltipMaxY = _frameHeight - TOOLTIP_HEIGHT; - - _scrollerTotalHeight =_frameHeight -DOUBLE_SCROLLER_PADDING; - - _tooltipPageHeight = _frameHeight/_totalPages; - - [grid onRotate:_frameWidth - GRID_X_OFFSET]; -} - --(NSInteger) getTotalPages{ - - NSInteger newTotalPages= mlo_get_page_count(); - - if(newTotalPages!= _totalPages){ - - _totalPages = newTotalPages; - _totalHeightInLogic = _totalPages* PORTRAIT_PAGE_HEIGHT_IN_LOGIC_WITH_SEPARATOR; - - _tooltipPageHeight = _frameHeight/_totalPages; - - _mainViewController.gestureEngine.limiter.documentSizeInLogic = CGSizeMake(CANVAS_WIDTH_IN_LOGIC, - _totalHeightInLogic); - } - - return newTotalPages; -} - - --(CGRect) getShiftedScrollerFrame:(CGFloat) pixelDeltaX{ - pixelDeltaX *= PIXEL_TO_LOGIC_RATIO / [_mainViewController getZoom] * 100; - CGFloat newTop = _visibleTop + pixelDeltaX; - CGFloat newBottom = _visibleBottom + pixelDeltaX; - - BOOL isOverTop = newTop < 0.0f; - BOOL isBelowBotton = newBottom > _totalHeightInLogic; - - if(!isOverTop && !isBelowBotton){ - _visibleTop = newTop; - _visibleBottom = newBottom; - }else{ - CGFloat scrollerHeightInLogic = _visibleBottom- _visibleTop; - if(isOverTop){ - _visibleTop = 0.0f; - _visibleBottom =scrollerHeightInLogic; - }else{ - _visibleBottom = _totalHeightInLogic; - _visibleTop = _totalHeightInLogic - scrollerHeightInLogic; - } - } - - return [self getNewScrollerFrame]; -} --(CGRect)getNewScrollerFrame{ - - [self updateViewData]; - - CGFloat topRatio = max(_visibleTop / _totalHeightInLogic,0.0); - CGFloat heightRatio = min((_visibleBottom / _totalHeightInLogic) - topRatio,1.0); - - return CGRectMake(_scrollerX, - SCROLLER_PADDING +topRatio*_scrollerTotalHeight, - SCROLLER_WIDTH, - heightRatio*_scrollerTotalHeight); -} --(NSInteger) getCurrentPage{ - - return min( - max( - ceilf( - _visibleTop - / PORTRAIT_PAGE_HEIGHT_IN_LOGIC_WITH_SEPARATOR - ), - 1), - _totalPages); -} - --(void) updateTooltip:(MLOScrollerTooltip *) tooltip withGrid:(MLOScrollerGridViewController *) grid{ - if(mlo_is_document_open() && _visibleTop>=0){ - - NSInteger currentPage = [self getCurrentPage]; - - if(tooltip){ - - [tooltip updateWithFrame:CGRectMake(_tooltipX, - min(_tooltipPageHeight * (currentPage -1),_tooltipMaxY), - TOOLTIP_WIDTH, - TOOLTIP_HEIGHT) inPage:currentPage]; - } - [grid onCurrentPageChanged:currentPage]; - } -} - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.h deleted file mode 100644 index 70bb544b6238..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.h +++ /dev/null @@ -1,19 +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 "MLOObject.h" - -static const CGFloat MLO_SCROLLER_GRID_WIDTH = 20.0f; -@class MLOMainViewController; -@interface MLOScrollerGridViewController : MLOObject --(id) initWithMainViewController:(MLOMainViewController *) mainViewController; --(void) hide; --(void) onCurrentPageChanged:(NSInteger) newCurrentPage; --(void) onPageCountChanged:(NSInteger) newPageCount; --(void)onRotate:(CGFloat) x; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.m deleted file mode 100644 index a7162453940a..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerGridViewController.m +++ /dev/null @@ -1,136 +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 "MLOScrollerGridViewController.h" -#import "MLOMainViewController.h" - -static const CGFloat GRID_LINE_WIDTH=1.5f, - GRID_ACTUAL_WIDTH = MLO_SCROLLER_GRID_WIDTH- GRID_LINE_WIDTH, - UNSELECTED_ALPHA=0.05f, - SELECTED_ALPHA=0.15f; - -@interface MLOScrollerGridViewController () -@property MLOMainViewController * mainViewController; -@property NSInteger pageCount,currentPage; -@property CGFloat height,x,gridCellHeight; -@property NSMutableArray * pages; -@end - -@implementation MLOScrollerGridViewController - - --(void)hide{ - - [self resetMembers]; - - for(UIView * cell in _pages){ - [cell removeFromSuperview]; - cell.alpha=0.0f; - } - - [_pages removeAllObjects]; - -} - --(void)resetMembers{ - _pageCount=-1; - _currentPage=0; - _height=-1.0f; - _x=-1.0f; - _gridCellHeight=-1.0; -} - --(id) initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [super init]; - if (self) { - self.mainViewController = mainViewController; - [self resetMembers]; - self.pages = [NSMutableArray new]; - } - return self; -} - --(void)onRotate:(CGFloat) x{ - _height =_mainViewController.canvas.frame.size.height; - _x=x; - [self reshape]; -} - --(UIView *) getNewCell{ - UIView * cell =[UIView new]; - - cell.backgroundColor = [UIColor blackColor]; - cell.alpha = UNSELECTED_ALPHA; - - [_mainViewController.canvas addSubview:cell]; - - return cell; -} - --(void)onPageCountChanged:(NSInteger) newPageCount{ - if(_pageCount!=newPageCount){ - _pageCount = newPageCount; - - NSInteger currentSize = [_pages count]; - - NSInteger delta = abs(currentSize-newPageCount); - - if(delta>0){ - BOOL isAdd = currentSize< newPageCount; - - for (NSInteger i=0; i<delta; i++) { - - if(isAdd){ - - [_pages addObject:[self getNewCell]]; - - }else{ - [_pages removeLastObject]; - } - } - - [self reshape]; - - if(!isAdd){ - if(_currentPage > newPageCount){ - [self onCurrentPageChanged:newPageCount]; - } - } - } - } -} - --(void)reshape{ - if((_x>=0) &&(_pageCount>0)){ - _gridCellHeight= (_height - GRID_LINE_WIDTH*(_pageCount +1 ))/_pageCount; - - CGFloat y = GRID_LINE_WIDTH; - - for (UIView * cell in _pages){ - - cell.frame = CGRectMake(_x+GRID_LINE_WIDTH, y, GRID_ACTUAL_WIDTH, _gridCellHeight); - - y+=_gridCellHeight +GRID_LINE_WIDTH; - } - } -} - --(void) onCurrentPageChanged:(NSInteger) newCurrentPage{ - if(_currentPage!=newCurrentPage){ - if( (_currentPage > 0) && ([_pages count] >= _currentPage)){ - ((UIView *) [_pages objectAtIndex:_currentPage-1]).alpha = UNSELECTED_ALPHA; - } - if( (newCurrentPage > 0) && ([_pages count] >= newCurrentPage)){ - ((UIView *) [_pages objectAtIndex:newCurrentPage -1]).alpha = SELECTED_ALPHA; - } - _currentPage = newCurrentPage; - } - -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.h deleted file mode 100644 index fdc3b4f05849..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.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 <UIKit/UIKit.h> - -@interface MLOScrollerTooltip : UITextView -@property NSString * extension; --(void) updateWithFrame:(CGRect) newFrame inPage:(NSInteger) page; --(void) hide; --(void) hideLibreOffice; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.m deleted file mode 100644 index 776f84e01f51..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerTooltip.m +++ /dev/null @@ -1,78 +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 "MLOCommon.h" -#import "MLOScrollerTooltip.h" -#import "MLOManager.h" -#import <QuartzCore/QuartzCore.h> - -@interface MLOScrollerTooltip () -@property NSInteger lastPage; -@end - -static const CGFloat BORDER_WIDTH = 1.0f,VISIBLE_ALPHA=0.85f; - -@implementation MLOScrollerTooltip - -- (id)init{ - - self = [super init]; - if(self){ - - self.alpha= 0.0f; - self.frame =CGRECT_ONE; - self.backgroundColor = [UIColor whiteColor]; - - self.layer.borderWidth = BORDER_WIDTH; - self.layer.borderColor = [[UIColor grayColor] CGColor]; - - self.extension=nil; - _lastPage = -1; - - self.textAlignment = NSTextAlignmentCenter; - self.textColor = [UIColor blackColor]; - } - return self; -} - --(void) updateWithFrame:(CGRect) newFrame inPage:(NSInteger) page{ - - BOOL isForceUpdateFrame =NO; - - if(_extension==nil){ - self.extension = [[[MLOManager getInstance] extension] uppercaseString]; - - isForceUpdateFrame = YES; - } - - if((self.frame.origin.y != newFrame.origin.y) || isForceUpdateFrame){ - - self.alpha=VISIBLE_ALPHA; - - self.frame = newFrame; - - self.text = [NSString stringWithFormat:@"Page %d This %@ is editable",page,_extension]; - - [self setNeedsDisplay]; - - _lastPage = page; - } - -} - --(void) hide{ - self.frame = self.bounds=CGRECT_ONE; - self.alpha = 0.0f; -} - --(void) hideLibreOffice{ - self.extension = nil; -} - - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.h deleted file mode 100644 index 4498e1e2c363..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.h +++ /dev/null @@ -1,26 +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 "MLOObject.h" -@class MLOScrollerData; -@class MLOMainViewController; -@interface MLOScrollerViewController : MLOObject -@property MLOScrollerData * data; - --(void)updateByLogic; --(void)updateByPixelDeltaY:(CGFloat) pixelDeltaY; --(void)contentHasChanged; --(void)onRotate; --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void) reset; --(void) fadeOut; --(void) addToMainViewController; --(void) hideLibreOffice; --(void) showLibreOffice; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.m deleted file mode 100644 index ccb9d5df6ffd..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/scroller/MLOScrollerViewController.m +++ /dev/null @@ -1,157 +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 "MLOScrollerViewController.h" -#import "MLOMainViewController.h" -#import "MLOSubView.h" -#import "MLOScrollerData.h" -#import "MLOScrollerTooltip.h" -#import "MLOScrollerGridViewController.h" -#import "mlo_uno.h" - -@interface MLOScrollerViewController () -@property BOOL isContentChanged,hasUpdated; -@property MLOMainViewController * mainViewController; -@property MLOSubView * scroller; -@property MLOScrollerTooltip * tooltip; -@property MLOScrollerGridViewController * grid; -@property NSDate * fadeOutTime; -@end - -static const CGFloat -SCROLLER_CORNER_RADIUS =3.0f, -RESHAPE_ANIMATION_DURATION= 0.05f, -SCROLLER_FADE_OUT_DELAY=0.45f, -SCROLLER_FADE_OUT_DURATION=1.0f, -SCROLLER_FADE_OUT_INVOCATION =SCROLLER_FADE_OUT_DELAY+0.05f; - -// Tooltip is removed at request of PM -// Maybe they'll want it back, or similar, in the future - -static const BOOL IS_SHOW_TOOLTIP =NO; - -@implementation MLOScrollerViewController - --(id) initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [super init]; - if(self){ - self.mainViewController = mainViewController; - self.scroller = [[MLOSubView alloc] initHiddedWithColor:[UIColor grayColor] cornerRadius:SCROLLER_CORNER_RADIUS]; - self.data = [[MLOScrollerData alloc] initWithMainViewController:mainViewController]; - if(IS_SHOW_TOOLTIP){ - self.tooltip = [MLOScrollerTooltip new]; - }else{ - self.tooltip = nil; - } - self.fadeOutTime = nil; - self.grid = [[MLOScrollerGridViewController alloc] initWithMainViewController:mainViewController]; - _isContentChanged =YES; - _hasUpdated =NO; - - [_data onRotateWithGrid:_grid]; - } - return self; -} - --(void) addToMainViewController{ - - [_mainViewController.canvas addSubview:_scroller]; - [_mainViewController.canvas addSubview:_tooltip]; -} - --(void) showLibreOffice{ - [_data showLibreOffice]; - [self contentHasChanged]; - - if(mlo_is_document_open()){ - [self updateByLogic:NO]; - } -} - --(void)contentHasChanged{ - self.isContentChanged = YES; -} - --(void)onRotate{ - [self contentHasChanged]; - [_data onRotateWithGrid:_grid]; - -} - --(void)updateByLogic{ - [self updateByLogic:YES]; -} - --(void)updateByPixelDeltaY:(CGFloat) pixelDeltaY{ - - [self updateAndShowScroller:YES newScrollerFrame:[_data getShiftedScrollerFrame:pixelDeltaY]]; -} - --(void)updateByLogic:(BOOL) isShow { - - if(_isContentChanged){ - - [_grid onPageCountChanged:[_data getTotalPages]]; - - _isContentChanged=NO; - } - - [self updateAndShowScroller:isShow newScrollerFrame:[_data getNewScrollerFrame]]; -} - --(void)updateAndShowScroller:(BOOL) isShow newScrollerFrame:(CGRect) newScrollerFrame{ - - if(isShow){ - - _scroller.alpha = 0.5; - } - [UIView animateWithDuration:_hasUpdated ? RESHAPE_ANIMATION_DURATION :0.0f - animations:^{ _scroller.frame = newScrollerFrame; } - completion:^(BOOL isCompleted){ - - self.fadeOutTime = [NSDate dateWithTimeIntervalSinceNow:SCROLLER_FADE_OUT_DELAY]; - [self performSelector:@selector(timedFadeOut) withObject:nil afterDelay:SCROLLER_FADE_OUT_INVOCATION]; - - }]; - - [_data updateTooltip:_tooltip withGrid:_grid]; - - _hasUpdated=YES; -} - - --(void) reset{ - - [_scroller hide]; - [_tooltip hide]; - - _hasUpdated=NO; - [self onRotate]; -} - --(void) timedFadeOut { - NSDate * date = self.fadeOutTime; - - if(![[date laterDate:[NSDate date]] isEqualToDate:date]){ - [self fadeOut]; - } -} - --(void)fadeOut{ - - [_scroller fade:OUT]; -} - --(void) hideLibreOffice{ - [_tooltip hideLibreOffice]; - [_grid hide]; - [self contentHasChanged]; - [_data hideLibreOffice]; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.h deleted file mode 100644 index f89e5c238351..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.h +++ /dev/null @@ -1,17 +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 <UIKit/UIKit.h> - -@class MLOSelectionViewController; -@interface MLOContextualMenuFocus : UIView --(id)initWithSelectionViewController:(MLOSelectionViewController *) selectionViewController; --(void)loCopyToClipboard:(id) sender; --(void)loSelectAll:(id) sender; --(void)defineBuffer:(id) sender; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.m deleted file mode 100644 index 3587d4d5a1f2..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOContextualMenuFocus.m +++ /dev/null @@ -1,61 +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 "MLOCommon.h" -#import "MLOContextualMenuFocus.h" -#import "MLOSelectionViewController_Impl.h" -#import "mlo_uno.h" - -@interface MLOContextualMenuFocus () -@property MLOSelectionViewController * selectionViewController; -@end -@implementation MLOContextualMenuFocus - --(id)initWithSelectionViewController:(MLOSelectionViewController *) selectionViewController{ - self = [self init]; - if(self){ - self.selectionViewController = selectionViewController; - self.frame = CGRECT_ZERO; - self.backgroundColor = [UIColor clearColor]; - } - return self; -} - --(void)loCopyToClipboard:(id) sender{ - [UIPasteboard generalPasteboard].string =[_selectionViewController.buffer copy]; - -} - --(void)loSelectAll:(id) sender{ - - NSLog(@"Calling mlo_select_all()"); - mlo_select_all(); - NSLog(@"mlo_select_all() returned. reshowing contextualMenu"); - [_selectionViewController showPostSelectAll]; -} - - --(void)defineBuffer:(id) sender{ - [_selectionViewController defineBuffer]; -} - --(NSString *) description{ - return @"MLO contextual menu focus UIView"; -} -- (BOOL) canPerformAction:(SEL)selector withSender:(id) sender { - if ((selector == @selector(loCopyToClipboard:)) || - ((selector == @selector(loSelectAll:)) || - (selector == @selector(defineBuffer:)))) { - return YES; - } - return NO; -} -- (BOOL) canBecomeFirstResponder { - return YES; -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.h deleted file mode 100644 index ad8db2a50559..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.h +++ /dev/null @@ -1,20 +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 <UIKit/UIKit.h> - -@class MLOMainViewController; -@interface MLOMagnifier : UIView - --(id) initWithMainViewController:(MLOMainViewController *) mainViewController; --(void) addToMainViewController; - --(void) showAt:(CGPoint) point; --(void) hide; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.m deleted file mode 100644 index f877ce8164b5..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOMagnifier.m +++ /dev/null @@ -1,94 +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 "MLOMainViewController_Friend.h" -#import "MLOMagnifier.h" -#import "MLOResourceImage.h" -#import "MLORenderManager.h" -#import <QuartzCore/QuartzCore.h> - - -@interface MLOMagnifier () -@property CGPoint hotspot; -@property MLOMainViewController * mainViewController; -@property NSString * glassImageName,* maskImageName; -@property BOOL shown,added; -@end - -static const CGFloat MAGNIFIER_DIM = 160.0f, - HOTSPOT_TO_MAGNIFIER_DISTANCE= 66.0f; - -@implementation MLOMagnifier - --(id) initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [self initWithFrame:CGRectMake(MAGNIFIER_DIM,MAGNIFIER_DIM,MAGNIFIER_DIM,MAGNIFIER_DIM)]; - if(self){ - self.mainViewController = mainViewController; - self.layer.cornerRadius = MAGNIFIER_DIM / 2.0f; - self.layer.masksToBounds = YES; - self.glassImageName = [MLOResourceImage magnifierName:IMAGE]; - self.maskImageName = [MLOResourceImage magnifierName:MASK]; - self.shown = NO; - self.added = NO; - } - return self; -} - --(void) addToMainViewController{ - -} - - --(void) showAt:(CGPoint) point{ - if(!self.shown){ - self.shown = YES; - [_mainViewController.canvas addSubview:self]; - } - - self.hotspot = point; - - self.center = CGPointMake(point.x, point.y-HOTSPOT_TO_MAGNIFIER_DISTANCE); - - [self setNeedsDisplay]; - -} --(void) hide{ - - if(self.shown){ - self.shown =NO; - [self removeFromSuperview]; - } - - self.center = CGPointMake(2*MAGNIFIER_DIM, 2*MAGNIFIER_DIM); - -} - - -- (void)drawRect:(CGRect)rect -{ - CGContextRef context = UIGraphicsGetCurrentContext(); - UIImage * glass = [UIImage imageNamed:_glassImageName]; - // CGImageRef mask = [UIImage imageNamed:_maskImageName].CGImage; - CGRect bounds = self.bounds; - - CGContextSaveGState(context); - //CGContextClipToMask(context, bounds, mask); - CGContextFillRect(context, bounds); - CGContextScaleCTM(context, 1.2, 1.2); - - //draw your subject view here - CGContextTranslateCTM(context,1*(self.frame.size.width*0.5),1*(self.frame.size.height*0.5)); - //CGContextScaleCTM(context, 1.5, 1.5); - CGContextTranslateCTM(context,-1*(self.hotspot.x),-1*(self.hotspot.y)); - [_mainViewController.renderManager renderInContext:context]; - - CGContextRestoreGState(context); - [glass drawInRect: bounds]; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.h deleted file mode 100644 index 72148f1524f4..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.h +++ /dev/null @@ -1,22 +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/. - -typedef enum {TOP_LEFT,BOTTOM_RIGHT} MLOSelectionHandleType; -#define MLOSelectionHandleTypeString(enum) [@[@"TOP_LEFT",@"BOTTOM_RIGHT"] objectAtIndex:enum] - -@class MLOSelectionViewController; -@interface MLOSelectionHandle : UIView - --(id)initWithType:(MLOSelectionHandleType) type selection:(MLOSelectionViewController *) selectionViewController; --(void)addToMainViewController; --(void)showAt:(CGPoint) edge; --(void)hide; --(void)onRotate; --(CGPoint)getPivot; --(BOOL)handleMoveAtPoint:(CGPoint) center gestureState:(UIGestureRecognizerState) state; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.m deleted file mode 100644 index 646a4c243957..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionHandle.m +++ /dev/null @@ -1,168 +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 "MLOSelectionHandle.h" -#import "MLOMainViewController_Friend.h" -#import "MLOSelectionViewController_Impl.h" -#import "MLOGestureEngine_Impl.h" -#import "MLOResourceImage.h" - -@interface MLOSelectionHandle () -@property MLOSelectionViewController * selection; -@property CGPoint lineTop, pivot; -@property BOOL tracking; -@end - -static const CGFloat LINE_HEIGHT = 20.0f, - LINE_WIDTH = 2.0f, - LINE_TO_HANDLE_SPACING=7.0f, - LINE_THICKNESS_PADDING = 3.0f, - HANDLE_THICKNESS_PADDING = 15.0f, - EXTERNAL_PADDING = 3.0f, - SIDE_PADDING = 15.0f, - VERTICAL_PADDING = HANDLE_THICKNESS_PADDING + LINE_THICKNESS_PADDING, - HORIZONAL_PADDING = SIDE_PADDING * 2.0f; - -@implementation MLOSelectionHandle - --(id)initWithType:(MLOSelectionHandleType) type selection:(MLOSelectionViewController *) selectionViewController{ - self = [self init]; - if(self){ - - self.selection = selectionViewController; - self.backgroundColor = [UIColor clearColor]; - - MLOResourceImage * handleImage = [MLOResourceImage selectionHandle]; - - CGFloat handleWidth = handleImage.image.size.width; - CGFloat handleHeight = handleImage.image.size.height; - CGFloat handleHeightWithSpacingToLine = LINE_TO_HANDLE_SPACING + handleHeight; - CGFloat frameWidth = HORIZONAL_PADDING + handleWidth; - - CGFloat lineYOrigin; - CGFloat handleYOrigin; - CGFloat pivotY; - - switch (type) { - case TOP_LEFT: - handleYOrigin = HANDLE_THICKNESS_PADDING; - pivotY = handleYOrigin + LINE_HEIGHT; - lineYOrigin = pivotY + LINE_TO_HANDLE_SPACING; - break; - - case BOTTOM_RIGHT: - lineYOrigin = LINE_THICKNESS_PADDING; - pivotY = lineYOrigin + LINE_HEIGHT; - handleYOrigin = pivotY+ LINE_TO_HANDLE_SPACING; - break; - } - - self.frame = CGRectMake(0, - 0, - frameWidth, - VERTICAL_PADDING + LINE_HEIGHT + handleHeightWithSpacingToLine); - - self.lineTop = CGPointMake(SIDE_PADDING + ((handleWidth - LINE_WIDTH) / 2.0f), - lineYOrigin); - - self.pivot = CGPointMake(frameWidth/2.0f, - pivotY); - - UIImageView * handle = [[UIImageView alloc] initWithImage:handleImage.image]; - - [self addSubview: handle]; - handle.frame = CGRectMake(SIDE_PADDING, - handleYOrigin, - handleWidth, - handleHeight); - self.alpha = 0.0f; - self.tracking =NO; - } - return self; -} --(void)addToMainViewController{ - [_selection.mainViewController.canvas addSubview:self]; - - -} --(CGPoint) getPivot{ - return CGPointMake(self.frame.origin.x + _pivot.x, self.frame.origin.y + _pivot.y); -} --(void)showAt:(CGPoint) edge{ - - [self putAt:edge withAlpha:1.0f]; -} - --(void)putAt:(CGPoint) center withAlpha:(CGFloat) alpha{ - self.frame = CGRectMake(center.x - _pivot.x, - center.y - _pivot.y, - self.frame.size.width, - self.frame.size.height); - self.alpha = alpha; -} - --(void)hide{ - [self putAt:CGPointMake(0,0) withAlpha:0.0f]; -} - --(void)onRotate{ - [self hide]; -} --(void)drawRect:(CGRect)rect{ - [super drawRect:rect]; - - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); - - CGContextSetLineWidth(context, LINE_WIDTH); - - CGContextMoveToPoint(context, _lineTop.x,_lineTop.y); //start at this point - - CGContextAddLineToPoint(context, _lineTop.x, _lineTop.y + LINE_HEIGHT); //draw to this point - - CGContextStrokePath(context); // draw the path -} - --(BOOL)handleMoveAtPoint:(CGPoint) center gestureState:(UIGestureRecognizerState) state{ - if((self.alpha==0.0f)|| - !CGRectContainsPoint(self.frame, center)){ - - [self endTracking]; - - return NO; - } - - if (state == UIGestureRecognizerStateChanged) { - self.tracking = YES; - [self showAt:center]; - - _selection.finger = center; - - [_selection reselect:NO]; - - }else if((state == UIGestureRecognizerStateEnded) || - (state == UIGestureRecognizerStateCancelled) || - (state == UIGestureRecognizerStateFailed)){ - - _selection.finger = center; - - [self endTracking]; - } - return YES; -} - --(void)endTracking{ - if(self.tracking){ - self.tracking=NO; - - [_selection reselect:YES]; - - } -} -@end - diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.h deleted file mode 100644 index fb904dfdff18..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.h +++ /dev/null @@ -1,22 +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 "MLOObject.h" - -@class MLOMainViewController; -@interface MLOSelectionViewController : MLOObject - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void)addToMainViewController; --(void)reset; --(void) onRotate; --(void) showBetweenFinger:(CGPoint) finger andPreviousPoint:(CGPoint) previousPoint showMenu:(BOOL) showMenu; --(void) showPostSelectAll; --(void) hide; --(BOOL)handleMoveAtPoint:(CGPoint) center gestureState:(UIGestureRecognizerState) state; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.m deleted file mode 100644 index 4e042b5e779d..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController.m +++ /dev/null @@ -1,231 +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 "MLOMainViewController_Friend.h" -#import "MLOSelectionViewController_Impl.h" -#import "MLOContextualMenuFocus.h" -#import "MLOSelectionHandle.h" -#import "MLOMagnifier.h" -#import "MLORenderManager.h" -#import "MLOThesaurusViewController.h" -#import "mlo_utils.h" -#import "mlo_uno.h" -#include <touch/touch.h> - -@interface MLOSelectionViewController () -@property MLOContextualMenuFocus * focus; -@property MLOSelectionHandle * topLeft, * bottomRight; -@property MLOMagnifier * magnifier; -@property BOOL menuShown,magnifierShown; -@end - -static const CGFloat FOCUS_DIM=20.0f; - -@implementation MLOSelectionViewController - --(id) initWithMainViewController:(MLOMainViewController *)mainViewController{ - self = [super init]; - if(self){ - self.mainViewController = mainViewController; - self.buffer = [NSMutableString stringWithString:@""]; - self.focus = [[MLOContextualMenuFocus alloc] initWithSelectionViewController:self]; - self.topLeft = [[MLOSelectionHandle alloc] initWithType: TOP_LEFT selection:self]; - self.bottomRight = [[MLOSelectionHandle alloc] initWithType: BOTTOM_RIGHT selection:self]; - self.magnifier = [[MLOMagnifier alloc] initWithMainViewController:mainViewController]; - self.menuShown =NO; - self.magnifierShown =NO; - self.finger = CGPointMake(0,0); - } - - return self; -} --(void) addToMainViewController{ - [_mainViewController.canvas addSubview:_focus]; - [_topLeft addToMainViewController]; - [_bottomRight addToMainViewController]; - [_magnifier addToMainViewController]; -} - --(void) reset{ - [self hide:NO]; -} --(UIMenuItem *)copyItem{ - return [[UIMenuItem alloc] - initWithTitle: @"Copy" - action: @selector(loCopyToClipboard:)]; -} --(UIMenuItem *)selectAllItem{ - return [[UIMenuItem alloc] - initWithTitle: @"Select All" - action: @selector(loSelectAll:)]; -} - --(UIMenuItem *)defineItem{ - return [[UIMenuItem alloc] - initWithTitle: @"Define" - action: @selector(defineBuffer:)]; -} - --(void) showMenuAtCenter:(CGPoint)center{ - [self showAtCenter:center selectAll:YES]; -} - --(void) showPostSelectAll{ - - [self hideTouchTrackers]; - [self showAtCenter:CGPointMake(_mainViewController.canvas.frame.size.width / 2.0f, FOCUS_DIM) selectAll:NO]; -} - --(void) showAtTopLeft:(CGPoint) topLeft bottomRight:(CGPoint) bottomRight showMenu:(BOOL) showMenu{ - [_topLeft showAt:topLeft]; - [_bottomRight showAt:bottomRight]; - if(showMenu){ - [self hideMagnifier]; - [self showMenuAtCenter:CGPointMake( (bottomRight.x + bottomRight.x) /2.0f, - (bottomRight.y + bottomRight.y) /2.0f)]; - self.menuShown = YES; - }else{ - [self hideMenu:YES]; - [_magnifier showAt:self.finger]; - self.magnifierShown=YES; - } - - [_mainViewController.renderManager renderNow]; -} - --(void) showBetweenFinger:(CGPoint) finger andPreviousPoint:(CGPoint) previousPoint showMenu:(BOOL) showMenu{ - self.finger = finger; - [self showBetweenPointA:finger andPointB:previousPoint showMenu:showMenu]; -} - --(void) showBetweenPointA:(CGPoint) pointA andPointB:(CGPoint) pointB showMenu:(BOOL) showMenu{ - - if((pointA.y < pointB.y) || - ((pointA.y == pointB.y) && (pointA.x < pointB.x))){ - - [self showAtTopLeft:pointA bottomRight:pointB showMenu:showMenu]; - }else{ - [self showAtTopLeft:pointB bottomRight:pointA showMenu:showMenu]; - } -} - --(void)showAtCenter:(CGPoint) center selectAll:(BOOL) isSelectAll{ - - CGFloat width = _mainViewController.canvas.frame.size.width; - CGFloat height = _mainViewController.canvas.frame.size.height; - - self.focus.frame = CGRectMake( min(max(0,center.x - FOCUS_DIM),width - FOCUS_DIM), - min(max(0,center.y - FOCUS_DIM),height - FOCUS_DIM), - FOCUS_DIM, - FOCUS_DIM); - - [self.focus becomeFirstResponder]; - - UIMenuController *menuController = [UIMenuController sharedMenuController]; - - [menuController setMenuItems:[self getMenuItems:isSelectAll]]; - - [menuController setTargetRect:self.focus.frame - inView:_mainViewController.canvas]; - [menuController setMenuVisible:YES animated:YES]; -} - --(NSArray *)getMenuItems:(BOOL) isSelectAll{ - - mlo_get_selection(_buffer); - - NSLog(@"Copied LO selection to keyboard: %@",_buffer); - - if(isSelectAll){ - - if([UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:_buffer]){ - NSLog(@"Creating contextual menu with Copy, Select All, and Define"); - - return @[[self copyItem], [self selectAllItem], [self defineItem]]; - - } - NSLog(@"Creating contextual menu with Copy and Select All"); - - return @[[self copyItem],[self selectAllItem]]; - } - - NSLog(@"Creating contextual menu with Copy only"); - - return @[[self copyItem]]; - } - --(NSString *)description{ - return @"MLO contextual menu view controller"; -} - --(void) hide{ - [self hide:YES]; -} - --(void) hideTouchTrackers{ - [_topLeft hide]; - [_bottomRight hide]; - [self hideMagnifier]; -} - --(void) hideMenu:(BOOL) animate{ - if(self.menuShown){ - self.menuShown =NO; - [[UIMenuController sharedMenuController] setMenuVisible:NO animated:animate]; - } -} - --(void) hideMagnifier{ - if(self.magnifierShown){ - self.magnifierShown =NO; - [_magnifier hide]; - } -} - --(void) hide:(BOOL) animate{ - - [self hideTouchTrackers]; - - [self hideMenu:animate]; - - [self.focus resignFirstResponder]; - self.focus.frame =CGRECT_ZERO; -} - --(void)reselect:(BOOL) showMenu{ - - CGPoint pointA = [_topLeft getPivot]; - CGPoint pointB = [_bottomRight getPivot]; - - touch_lo_mouse_drag(pointA.x, pointA.y, DOWN); - - touch_lo_mouse_drag(pointB.x, pointB.y, MOVE); - - touch_lo_mouse_drag(pointB.x, pointB.y, UP); - - [self showBetweenPointA:pointA andPointB:pointB showMenu:showMenu]; -} - --(void) onRotate{ - [self reset]; - -} - --(BOOL)handleMoveAtPoint:(CGPoint) center gestureState:(UIGestureRecognizerState) state{ - return (self.focus.frame.origin.x != 0) && - ([_topLeft handleMoveAtPoint:center gestureState:state] || - [_bottomRight handleMoveAtPoint:center gestureState:state]); -} - - --(void)defineBuffer{ - [[[MLOThesaurusViewController alloc] initWithSelectionViewController:self] show]; - -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController_Impl.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController_Impl.h deleted file mode 100644 index 1654f530b020..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOSelectionViewController_Impl.h +++ /dev/null @@ -1,17 +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 "MLOSelectionViewController.h" -@class MLOMainViewController; -@interface MLOSelectionViewController () -@property MLOMainViewController * mainViewController; -@property NSMutableString * buffer; -@property CGPoint finger; --(void)reselect:(BOOL) showMenu; --(void)defineBuffer; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.h deleted file mode 100644 index 78864b6d944b..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.h +++ /dev/null @@ -1,15 +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 <UIKit/UIKit.h> -@class MLOSelectionViewController; -@interface MLOThesaurusViewController : UIReferenceLibraryViewController - --(id) initWithSelectionViewController:(MLOSelectionViewController *) selectionViewController; --(void)show; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.m deleted file mode 100644 index e6249033be91..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/selection/MLOThesaurusViewController.m +++ /dev/null @@ -1,48 +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 "MLOThesaurusViewController.h" -#import "MLOSelectionViewController_Impl.h" -#import "MLOMainViewController_Friend.h" -#import "MLOGestureEngine_Impl.h" - -static const CGFloat THESAURUS_PADDING = 100.0f; -@interface MLOThesaurusViewController () -@property MLOSelectionViewController * selection; -@end - -@implementation MLOThesaurusViewController - - --(id) initWithSelectionViewController:(MLOSelectionViewController *) selectionViewController{ - self = [self initWithTerm:selectionViewController.buffer]; - if(self){ - self.selection = selectionViewController; - self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; - self.modalPresentationStyle = UIModalPresentationFormSheet; - } - return self; -} - --(void)show{ - static const CGFloat TWO_PADDINGS = THESAURUS_PADDING*2.0; - self.view.frame = CGRectMake(THESAURUS_PADDING, - THESAURUS_PADDING, - _selection.mainViewController.canvas.frame.size.width - TWO_PADDINGS , - _selection.mainViewController.canvas.frame.size.height - TWO_PADDINGS); - - _selection.mainViewController.gestureEngine.focused = NO; - [_selection.mainViewController presentViewController:self animated:YES completion:nil]; - -} - --(void)viewDidDisappear:(BOOL)animated{ - _selection.mainViewController.gestureEngine.focused = YES; - [_selection reselect:YES]; -} -@end 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 diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.h deleted file mode 100644 index df1a634cb8f1..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.h +++ /dev/null @@ -1,18 +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 "MLOObject.h" - -@class MLOToolbarButton,MLOMainViewController; -@interface MLOFinder : MLOObject --(id)initWithToolbarButton:(MLOToolbarButton *) findButton; --(void)addToMainViewController:(MLOMainViewController *)mainViewController; --(void)show; --(void)hide; - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.m deleted file mode 100644 index 17d1081c2974..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOFinder.m +++ /dev/null @@ -1,281 +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 "MLOFinder.h" -#import "MLOToolbarButton.h" -#import "MLOButton.h" -#import "MLOMainViewController_Friend.h" -#import "MLOGestureEngine_Impl.h" -#import "MLORenderManager.h" -#import "MLOSubView.h" -#import "MLOResourceImage.h" -#import "mlo_uno.h" - -@interface MLOFinder () -@property MLOSubView * blackBox; -@property UILabel * label; -@property UITextField * textField; -@property NSString * lastSearched; -@property NSDate * findTime; -@property MLOButton * leftButton,* rightButton; -@property NSInteger selectionCount,selectedIndex; -@property MLOMainViewController * mainViewController; -@end - -static const NSTimeInterval - - NAVIGATION_BUTTON_FADE_DURATION = 1.0f, - FIND_DELAY = 1.0, - FIND_INVOCATION=FIND_DELAY+0.01; - -static const CGFloat - FADE_DURATION = 0.5f, - FADE_IN_TARGET = 1.0f, - FADE_OUT_TARGET = 0.0f, - - TEXT_AREA_WIDTH = 150.0f, - SPACING_FROM_FIND_TOOLBAR_BUTTON=50.0f, - BLACK_BOX_CORNER_RADIUS=15.0f, - - BLACK_BOX_INNER_PADDING_X = 10.0f, - BLACK_BOX_INNER_PADDING_Y = 10.0f, - TEXT_AREA_TO_NAVIAGATION_BUTTONS_SPACING = 5.0f, - - LABEL_HEIGHT = 18.0f, - LABEL_TO_INPUT_FIELD_PADDING=8.0f, - - INPUT_FIELD_HEIGHT = 20.0f, - - BLACK_BOX_INNER_HEIGHT =LABEL_HEIGHT + LABEL_TO_INPUT_FIELD_PADDING + INPUT_FIELD_HEIGHT, - BLACK_BOX_HEIGHT=2*BLACK_BOX_INNER_PADDING_Y + BLACK_BOX_INNER_HEIGHT; - -@implementation MLOFinder - --(id)initWithToolbarButton:(MLOToolbarButton *) findButton{ - - self = [super init]; - if(self){ - - self.selectedIndex = -1; - self.selectionCount = -1; - - MLOResourceImage * leftButtonImage = [MLOResourceImage left]; - MLOResourceImage * rightButtonImage =[MLOResourceImage right]; - - CGFloat leftButtonWidth =leftButtonImage.image.size.width; - CGFloat rightButtonWidth = rightButtonImage.image.size.width; - - CGRect findButtonFrame = findButton.frame; - - CGFloat xOrigin = findButtonFrame.origin.x + findButtonFrame.size.width + SPACING_FROM_FIND_TOOLBAR_BUTTON; - CGFloat yOrigin = findButtonFrame.origin.y; - - CGFloat leftButtonXOrigin = xOrigin + BLACK_BOX_INNER_PADDING_X; - - CGFloat textAreaXOrigin = leftButtonXOrigin +leftButtonWidth + TEXT_AREA_TO_NAVIAGATION_BUTTONS_SPACING; - CGFloat textAreaYOrigin = yOrigin +BLACK_BOX_INNER_PADDING_Y; - - CGFloat rightButtonXOrigin = textAreaXOrigin + TEXT_AREA_WIDTH + TEXT_AREA_TO_NAVIAGATION_BUTTONS_SPACING; - - [self addBlackBoxXOrigin: xOrigin - yOrigin: yOrigin - width: leftButtonWidth + - rightButtonWidth + - (TEXT_AREA_TO_NAVIAGATION_BUTTONS_SPACING + BLACK_BOX_INNER_PADDING_X)*2 + - TEXT_AREA_WIDTH ]; - - - [self addLabelXOrigin:textAreaXOrigin yOrigin:textAreaYOrigin]; - [self addTextFieldXOrigin:textAreaXOrigin yOrigin:textAreaYOrigin]; - - self.leftButton = - [self addButtonXOrigin:leftButtonXOrigin - yOrigin:textAreaYOrigin - image:leftButtonImage - selector:@selector(onTapLeft) - name:@"left (previous)"]; - - self.rightButton = - [self addButtonXOrigin:rightButtonXOrigin - yOrigin:textAreaYOrigin - image:rightButtonImage - selector:@selector(onTapRight) - name:@"right (next)"]; - - self.lastSearched = @""; - self.findTime = [NSDate date]; - } - return self; -} --(void) onTapLeft{ - [self onTap:MARK_PREVIOUS]; -} --(void) onTapRight{ - [self onTap:MARK_NEXT]; -} - --(void) onTap:(MLOFindSelectionType) type{ - self.selectedIndex = mlo_find(_lastSearched, type); - [self updateLabel]; - -} - --(void)updateLabel{ - CGFloat navigationAlpha; - if(_selectionCount>0){ - self.label.text = [NSString stringWithFormat: @"Find (%d of %d)",_selectedIndex + 1,_selectionCount]; - navigationAlpha = 1.0f; - - }else{ - - self.label.text = @"Find"; - navigationAlpha = 0.0f; - } - - [self.mainViewController.gestureEngine.renderer renderNow]; - - if(_leftButton.alpha != navigationAlpha){ - [UIView animateWithDuration:NAVIGATION_BUTTON_FADE_DURATION animations:^{ - _leftButton.alpha = navigationAlpha; - _rightButton.alpha = navigationAlpha; - - }]; - } - -} - --(MLOButton *) addButtonXOrigin:(CGFloat) xOrigin yOrigin:(CGFloat) yOrigin image:(MLOResourceImage *) image selector:(SEL) selector name:(NSString *) buttonName{ - MLOButton * button = [MLOButton buttonWithImage:image]; - - CGFloat height = image.image.size.height; - - if(height < BLACK_BOX_INNER_HEIGHT){ - yOrigin += (BLACK_BOX_INNER_HEIGHT - height)/2.0f; - } - - button.frame = CGRectMake(xOrigin,yOrigin,image.image.size.width,height); - button.alpha = 0.0f; - [button addTarget:self action:selector]; - NSLog(@"Created the navigation button %@",buttonName); - return button; -} - --(void)addBlackBoxXOrigin:(CGFloat) xOrigin yOrigin:(CGFloat)yOrigin width:(CGFloat) width{ - self.blackBox = - [[MLOSubView alloc] - initWithFrame: CGRectMake(xOrigin, - yOrigin, - width, - BLACK_BOX_HEIGHT) - color: [UIColor blackColor] - cornerRadius: BLACK_BOX_CORNER_RADIUS - alpha: 0.0f]; - - NSLog(@"Created finder blackbox"); -} - --(void) addLabelXOrigin:(CGFloat) xOrigin yOrigin:(CGFloat) yOrigin{ - self.label = [[UILabel alloc] initWithFrame:CGRectMake(xOrigin, - yOrigin, - TEXT_AREA_WIDTH, - LABEL_HEIGHT)]; - _label.textColor=[UIColor whiteColor]; - _label.backgroundColor = [UIColor clearColor]; - _label.alpha=0.0f; - - [self updateLabel]; -} - --(void) addTextFieldXOrigin:(CGFloat) xOrigin yOrigin:(CGFloat) yOrigin{ - self.textField = [[UITextField alloc] initWithFrame:CGRectMake(xOrigin, - yOrigin+LABEL_HEIGHT +LABEL_TO_INPUT_FIELD_PADDING, - TEXT_AREA_WIDTH, - INPUT_FIELD_HEIGHT)]; - _textField.text =@""; - _textField.textColor = [UIColor blackColor]; - _textField.backgroundColor = [UIColor whiteColor]; - _textField.alpha = 0.0f; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onTextChanged) - name:UITextFieldTextDidChangeNotification - object:_textField]; -} - - - --(void)show{ - [self fadeTo:FADE_IN_TARGET]; - [_textField becomeFirstResponder]; -} --(void)hide{ - [self fadeTo:FADE_OUT_TARGET]; - - [_textField resignFirstResponder]; -} - --(void)fadeTo:(CGFloat) alphaTarget{ - if(_blackBox.alpha !=alphaTarget){ - - BOOL isFadeNavigationButton = (_selectionCount > 0) || (alphaTarget == 0.0f); - - [UIView animateWithDuration:FADE_DURATION animations:^{ - _blackBox.alpha = alphaTarget; - _label.alpha = alphaTarget; - _textField.alpha = alphaTarget; - - if(isFadeNavigationButton){ - _leftButton.alpha = alphaTarget; - _rightButton.alpha = alphaTarget; - } - }]; - } -} - - --(void)addToMainViewController:(MLOMainViewController *)mainViewController{ - [mainViewController.canvas addSubview:_blackBox]; - [mainViewController.canvas addSubview:_label]; - [mainViewController.canvas addSubview:_textField]; - [mainViewController.canvas addSubview:_leftButton]; - [mainViewController.canvas addSubview:_rightButton]; - self.mainViewController = mainViewController; -} -- (void)onTextChanged{ - - self.findTime = [NSDate dateWithTimeIntervalSinceNow:FIND_DELAY]; - - [self performSelector:@selector(invokeFind) withObject:nil afterDelay:FIND_INVOCATION]; - -} - --(void) invokeFind{ - - if(![[_findTime laterDate:[NSDate date]] isEqualToDate:_findTime]){ - - NSInteger trimmedLength = [_textField.text stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]].length; - - if( (_textField.text.length > 0) && - (trimmedLength>0) && - ![_textField.text isEqualToString:_lastSearched]){ - - self.lastSearched = [_textField.text copy]; - - self.selectionCount = mlo_find(_lastSearched, MARK_FIRST); - self.selectedIndex = 0; - - }else if(trimmedLength==0){ - - self.lastSearched =@""; - self.selectionCount = -1; - self.selectedIndex = -1; - } - - [self updateLabel]; - } -} -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.h deleted file mode 100644 index 5e6b297570f2..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.h +++ /dev/null @@ -1,31 +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 "MLOButton.h" - -typedef void (^MLOToolbarButtonCallback)(); -#define MLO_TOOLBAR_BUTTON_STUB_CALLBACK ^{ NSLog(@"stub toolbar button callback");} - - -@class MLOToolbarViewController,MLOResourceImage; - -typedef enum { AUTOMATIC, RETAP_OR_OTHER_TAPPED,RETAP_ONLY} MLOToolbarButtonTapReleaseType; -#define MLOToolbarButtonTapReleaseTypeString(enum) [@[@"AUTOMATIC",@"RETAP_OR_OTHER_TAPPED",@"RETAP_ONLY"] objectAtIndex:enum] - -@interface MLOToolbarButton : MLOButton -@property MLOResourceImage * alternateImage; - -+(MLOToolbarButton*)buttonWithImage:(MLOResourceImage *) image onTap:(MLOToolbarButtonCallback) onTap tapRelease:(MLOToolbarButtonTapReleaseType)type; -+(MLOToolbarButton*)buttonWithImage:(MLOResourceImage *) image onTap:(MLOToolbarButtonCallback) onTap tapRelease:(MLOToolbarButtonTapReleaseType)type onTapRelease:(MLOToolbarButtonCallback)onTapRelease; - --(void)addToToolbarControler:(MLOToolbarViewController *) toolbar; --(void)showLibreOffice; --(void)hideLibreOffice; --(void)onOtherButtonTapped; --(void)switchImage; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.m deleted file mode 100644 index 5576ec9a19f9..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarButton.m +++ /dev/null @@ -1,157 +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 "MLOToolbarButton.h" -#import "MLOToolbarViewController.h" -#import "MLOToolbarViewController_Impl.h" -#import "MLOMainViewController.h" -#import "MLOResourceImage.h" - -static const CGFloat - TAPPED_ALPHA=1.0f, - UNTAPPED_ALPHA=0.3f, - BUTTON_IMAGE_X_EDGE_OF_CANVAS_PADDING = 40.0f, - BUTTON_IMAGE_Y_EDGE_OF_CANVAS_PADDING = 30.0f, - BUTTON_IMAGE_Y_SPACING = 40.0f, - BUTTON_THICKENING = 10.f, - FADE_TO_UNTAPPED_TIME=0.5f; - -static NSInteger toolbarButtonsTotalHeight=BUTTON_IMAGE_Y_EDGE_OF_CANVAS_PADDING; - -static const BOOL IS_FLASH_ON_TAP = NO; - -@interface MLOToolbarButton () -@property MLOToolbarViewController * toolbarController; -@property (nonatomic,strong) MLOToolbarButtonCallback onTap, onTapRelease; -@property BOOL isTapped,currentImageIsMain; -@property MLOToolbarButtonTapReleaseType tapReleaseType; -@property MLOResourceImage * mainImage; -@end - - -@implementation MLOToolbarButton - --(void)addToToolbarControler:(MLOToolbarViewController *) toolbar{ - self.toolbarController = toolbar; - -} -+(MLOToolbarButton *)buttonWithImage:(MLOResourceImage *) image onTap:(MLOToolbarButtonCallback) onTap tapRelease:(MLOToolbarButtonTapReleaseType)type{ - return [MLOToolbarButton buttonWithImage:image onTap:onTap tapRelease:type onTapRelease:MLO_TOOLBAR_BUTTON_STUB_CALLBACK]; -} -+(MLOToolbarButton *)buttonWithImage:(MLOResourceImage *) image onTap:(MLOToolbarButtonCallback) onTap tapRelease:(MLOToolbarButtonTapReleaseType)type onTapRelease:(MLOToolbarButtonCallback)onTapRelease -{ - - MLOToolbarButton * button = [MLOToolbarButton buttonWithType:UIButtonTypeCustom]; - - if(button){ - - button.mainImage = image; - button.onTap = onTap; - button.tapReleaseType = type; - button.onTapRelease = onTapRelease; - button.alternateImage=nil; - - static const CGFloat BUTTON_X=BUTTON_IMAGE_X_EDGE_OF_CANVAS_PADDING -BUTTON_THICKENING, - BUTTON_TWICE_THICKENING=2.0f*BUTTON_THICKENING; - - button.frame = CGRectMake(BUTTON_X, - toolbarButtonsTotalHeight-BUTTON_THICKENING, - image.image.size.width + BUTTON_TWICE_THICKENING, - image.image.size.height + BUTTON_TWICE_THICKENING); - - toolbarButtonsTotalHeight += image.image.size.height + BUTTON_IMAGE_Y_SPACING; - - [button reset:0]; - [button addAction:@selector(onTapAction)]; - - } - return button; -} - --(BOOL)isHold{ - return _tapReleaseType != AUTOMATIC; -} - --(void)releaseIfNeeded{ - if(_isTapped && [self isHold]){ - [self invokeOnTapRelease]; - } - _isTapped = NO; -} - --(void)reset:(CGFloat) alpha{ - [self releaseIfNeeded]; - self.alpha = alpha; -} - --(void)onOtherButtonTapped{ - if(_tapReleaseType == RETAP_OR_OTHER_TAPPED){ - [self releaseIfNeeded]; - [self fadeToUntapped]; - } -} - --(void)invokeOnTapRelease{ - [self invoke:_onTapRelease named:@"onTapRelease"]; -} - --(void)switchImage{ - if(_alternateImage!=nil){ - - [self setDefaultImage:_currentImageIsMain ? _alternateImage.image : _mainImage.image ]; - _currentImageIsMain^=YES; - } -} -- (void) onTapAction{ - if(_isTapped){ - if([self isHold]){ - [self fadeToUntapped]; - [self invokeOnTapRelease]; - } - }else{ - _isTapped=YES; - - if(IS_FLASH_ON_TAP){ - [_toolbarController.mainViewController flash]; - } - self.alpha = TAPPED_ALPHA; - if(![self isHold]){ - [self fadeToUntapped]; - } - [_toolbarController hideAllButtonsBut:self]; - [self invoke:_onTap named:@"onTap"]; - } -} - --(void) fadeToUntapped{ - if(self.alpha>UNTAPPED_ALPHA){ - - [UIView animateWithDuration:FADE_TO_UNTAPPED_TIME animations:^{ - self.alpha = UNTAPPED_ALPHA; - }]; - } - - _isTapped = NO; -} - --(void)showLibreOffice{ - [self setDefaultImage:_mainImage.image]; - _currentImageIsMain = YES; - [self reset:UNTAPPED_ALPHA]; -} - --(void)hideLibreOffice{ - [self reset: 0]; -} - --(void) invoke:(MLOToolbarButtonCallback) callback named:(NSString *) name{ - callback(); - NSLog(@"%@ button perfromed: %@",_mainImage.name, name); -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.h deleted file mode 100644 index 454cf0134f51..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.h +++ /dev/null @@ -1,21 +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" - -@class MLOMainViewController,MLOToolbarButton; -@interface MLOToolbarViewController : MLOViewController --(id)initWithMainViewController:(MLOMainViewController *) mainViewController; --(void)addToMainViewController; --(void)showLibreOffice; --(void)hideLibreOffice; --(void) expandDidToggle; --(BOOL) isTappable; --(void) onRotate; --(void)hideAllButtonsBut:(MLOToolbarButton *) showButton; -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.m deleted file mode 100644 index 83a689cf7ef3..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController.m +++ /dev/null @@ -1,137 +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 "MLOToolbarViewController.h" -#import "MLOMainViewController.h" -#import "MLOToolbarButton.h" -#import "MLOFinder.h" -#import "MLOToolbarViewController_Impl.h" -#import "MLOMainViewController_Friend.h" -#import "MLOResourceImage.h" -#import "MLOTopbarViewController.h" -#import "MLOKeyboardManager.h" -#import "mlo_uno.h" - -@interface MLOToolbarViewController () -@property NSArray * buttons; -@property MLOToolbarButton * expandButton; -@property MLOFinder * finder; -@property CGFloat previousHeightOffset; -@property BOOL tappable; -@end - -@implementation MLOToolbarViewController - --(id)initWithMainViewController:(MLOMainViewController *) mainViewController{ - self = [self init]; - if (self) { - self.mainViewController = mainViewController; - self.buttons=@[[self createExpandButton], - [self createFindButton], - [self createEditButton], - [self createSaveButton] - //[self createPrintButton] - ]; - self.tappable = NO; - - _previousHeightOffset=-1.0f; - - } - return self; -} - --(void)addToMainViewController{ - - for (MLOToolbarButton * button in _buttons) { - - [button addToToolbarControler:self]; - - [_mainViewController.canvas addSubview:button]; - } - [_finder addToMainViewController:_mainViewController]; -} - --(void)showLibreOffice{ - - for (MLOToolbarButton * button in _buttons) { - [button showLibreOffice]; - } -} - --(void)hideAllButtonsBut:(MLOToolbarButton *) showButton{ - for (MLOToolbarButton * button in _buttons) { - if(![button isEqual:showButton]){ - [button onOtherButtonTapped]; - } - } -} --(BOOL)isTappable{ - return _tappable; -} --(void)expandDidToggle{ - [_expandButton switchImage]; -} - --(MLOToolbarButton *)createExpandButton{ - self.expandButton= - [MLOToolbarButton - buttonWithImage: [MLOResourceImage expand] - onTap: ^{ [self.mainViewController toggleExpand]; } - tapRelease: AUTOMATIC]; - - _expandButton.alternateImage =[MLOResourceImage shrink]; - - return _expandButton; -} --(void) hideLibreOffice{ - for (MLOToolbarButton * button in _buttons) { - [button hideLibreOffice]; - } -} - --(MLOToolbarButton *)createFindButton{ - MLOToolbarButton* findButton= - [MLOToolbarButton - buttonWithImage: [MLOResourceImage find] - onTap: ^{ [self.finder show]; } - tapRelease: RETAP_OR_OTHER_TAPPED - onTapRelease: ^{ [self.finder hide]; }]; - - self.finder = [[MLOFinder alloc] initWithToolbarButton:findButton]; - - return findButton; -} - --(void)onRotate{ -} - --(MLOToolbarButton *)createEditButton{ - return [MLOToolbarButton - buttonWithImage: [MLOResourceImage edit] - onTap: ^{ self.tappable =YES; } - tapRelease: RETAP_ONLY - onTapRelease: ^{ self.tappable = NO; - [self.mainViewController.keyboard hide]; - }]; -} - --(MLOToolbarButton *)createPrintButton{ - return [MLOToolbarButton - buttonWithImage: [MLOResourceImage print] - onTap: MLO_TOOLBAR_BUTTON_STUB_CALLBACK - tapRelease: RETAP_OR_OTHER_TAPPED]; -} - --(MLOToolbarButton *)createSaveButton{ - return [MLOToolbarButton - buttonWithImage: [MLOResourceImage save] - onTap: ^{ mlo_save(); } - tapRelease: AUTOMATIC]; -} - -@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController_Impl.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController_Impl.h deleted file mode 100644 index 19eab1c92d5f..000000000000 --- a/ios/shared/ios_sharedlo/objective_c/view_controllers/toolbar/MLOToolbarViewController_Impl.h +++ /dev/null @@ -1,13 +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 "MLOToolbarViewController.h" - -@interface MLOToolbarViewController () -@property MLOMainViewController * mainViewController; -@end |