Bin obsolete code that has not been built for ages and likely has bit-rotted
If somebody needs to have look, it can be found in git, or in old source tarballs, etc. No need to keep in the work tree.
@@ -1,149 +0,0 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# 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/.
|
||||
|
||||
$(eval $(call gb_CustomTarget_CustomTarget,ios/LibreOffice_app))
|
||||
|
||||
# We distinguish between builds for the simulator and device by
|
||||
# looking for the "iarmv7" or "i386" in the -arch option that is part
|
||||
# of $(CC)
|
||||
|
||||
ifneq ($(filter arm64,$(CC)),)
|
||||
xcode_sdk=iphoneos
|
||||
xcode_arch=arm64
|
||||
else ifneq ($(filter i386,$(CC)),)
|
||||
xcode_sdk=iphonesimulator
|
||||
xcode_arch=i386
|
||||
else
|
||||
xcode_sdk=iphoneos
|
||||
xcode_arch=armv7
|
||||
endif
|
||||
|
||||
# If run from Xcode, check that its configuration (device or
|
||||
# simulator) matches that of gbuild. We detect being run from Xcode by
|
||||
# looking for $(SCRIPT_OUTPUT_FILE_0). The Run Script build phase in
|
||||
# our project has as its (single) output file the location of the app
|
||||
# executable in its app bundle.
|
||||
|
||||
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
|
||||
|
||||
export CCACHE_CPP2=y
|
||||
|
||||
ifneq ($(CURRENT_ARCH),$(xcode_arch))
|
||||
$(error Xcode platform ($(CURRENT_ARCH)) does not match that of this build tree ($(xcode_arch)))
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
|
||||
ifeq ($(EXECUTABLE_NAME),LibreOffice)
|
||||
# When run from Xcode, we move the LibreOffice executable from solver into
|
||||
# the LibreOffice.app directory that Xcode uses. We also set up/copy all
|
||||
# the run-time configuration etc files that the app needs.
|
||||
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(SCRIPT_OUTPUT_FILE_0)
|
||||
|
||||
appdir=$(dir $(SCRIPT_OUTPUT_FILE_0))
|
||||
buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)
|
||||
|
||||
$(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,LibreOffice)
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
|
||||
mkdir -p $(appdir)/ure
|
||||
mv $(call gb_Executable_get_target,LibreOffice) $(SCRIPT_OUTPUT_FILE_0)
|
||||
#
|
||||
# Copy rdb files
|
||||
#
|
||||
cp $(INSTDIR)/ure/share/misc/types.rdb $(appdir)
|
||||
cp $(INSTDIR)/program/types/offapi.rdb $(appdir)
|
||||
cp $(INSTDIR)/program/types/oovbaapi.rdb $(appdir)
|
||||
cp $(INSTDIR)/program/services/services.rdb $(appdir)
|
||||
cp $(INSTDIR)/ure/share/misc/services.rdb $(appdir)/ure
|
||||
#
|
||||
# Copy .res files
|
||||
#
|
||||
# program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
|
||||
# we could set STAR_RESOURCE_PATH instead. sigh...
|
||||
#
|
||||
mkdir -p $(appdir)/program/resource
|
||||
cp $(INSTDIR)/$(LIBO_SHARE_RESOURCE_FOLDER)/*en-US.res $(appdir)/program/resource
|
||||
#
|
||||
# Artwork
|
||||
#
|
||||
mkdir -p $(appdir)/share/config
|
||||
cp -R $(INSTDIR)/$(LIBO_SHARE_FOLDER)/config/images_tango.zip $(appdir)/share/config/images.zip
|
||||
#
|
||||
# soffice.cfg
|
||||
#
|
||||
cp -R $(INSTROOT)/share/config/soffice.cfg $(appdir)/share/config
|
||||
#
|
||||
# "registry"
|
||||
#
|
||||
cp -R $(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry $(appdir)/share
|
||||
#
|
||||
# Set up rc, the "inifile". See getIniFileName_Impl().
|
||||
#
|
||||
( \
|
||||
echo '[Bootstrap]' && \
|
||||
echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' && \
|
||||
echo 'HOME=$$APP_DATA_DIR/tmp' && \
|
||||
: ) > $(appdir)/rc
|
||||
#
|
||||
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
|
||||
#
|
||||
# Do we really need all these?
|
||||
#
|
||||
( \
|
||||
echo '[Bootstrap]' && \
|
||||
echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' && \
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/share/registry' && \
|
||||
: ) > $(appdir)/fundamentalrc
|
||||
#
|
||||
( \
|
||||
echo '[Bootstrap]' && \
|
||||
: UNO_TYPES and UNO_SERVICES are set up in lo-viewer.mm, is that sane? && \
|
||||
: ) > $(appdir)/unorc
|
||||
#
|
||||
# bootstraprc must be in $BRAND_BASE_DIR/program
|
||||
#
|
||||
mkdir -p $(appdir)/program
|
||||
( \
|
||||
echo '[Bootstrap]' && \
|
||||
echo 'InstallMode=<installmode>' && \
|
||||
echo 'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
|
||||
echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
|
||||
: ) > $(appdir)/program/bootstraprc
|
||||
#
|
||||
# Is this really needed?
|
||||
#
|
||||
( \
|
||||
echo '[Version]' && \
|
||||
echo 'AllLanguages=en-US' && \
|
||||
echo 'BuildVersion=' && \
|
||||
echo 'buildid=$(buildid)' && \
|
||||
: ) > $(appdir)/program/versionrc
|
||||
#
|
||||
# Copy a sample document... good old test1.odt...
|
||||
#
|
||||
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt $(appdir)
|
||||
endif
|
||||
else
|
||||
# When run just from the command line, we don't have any app bundle to
|
||||
# copy or move the executable to. So do nothing. Except one trick:
|
||||
# Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
|
||||
# can then open it from there in Xcode.
|
||||
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(gb_Helper_PHONY)
|
||||
if test $(SRCDIR) != $(BUILDDIR); then \
|
||||
(cd $(SRCDIR) && tar cf - ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj) | (cd $(BUILDDIR) && tar xf -); \
|
||||
fi
|
||||
|
||||
$(call gb_CustomTarget_get_clean_target,ios/LibreOffice_app) :
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
|
||||
# Here we just assume that Xcode's settings are default, or something
|
||||
rm -rf experimental/LibreOffice/build
|
||||
|
||||
endif
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
@@ -1,111 +0,0 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# 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/.
|
||||
|
||||
#- Env ------------------------------------------------------------------------
|
||||
|
||||
MobileLibreOffice_resource := MobileLibreOffice/resource_link
|
||||
BUILDID :=$(shell cd $(SRCDIR) && git log -1 --format=%H)
|
||||
|
||||
#- Macros ---------------------------------------------------------------------
|
||||
|
||||
define MobileLibreOfficeXcodeBuild
|
||||
CC=;xcodebuild -project shared/ios_sharedlo.xcodeproj -target ios_sharedlo -arch $(XCODE_ARCHS) -configuration $(if $(ENABLE_DEBUG),Debug,Release) $(1) $(if $(verbose)$(VERBOSE),,>/dev/null)
|
||||
CC=;xcodebuild -project MobileLibreOffice/MobileLibreOffice.xcodeproj -target MobileLibreOffice -arch $(XCODE_ARCHS) -configuration $(if $(ENABLE_DEBUG),Debug,Release) $(1) $(if $(verbose)$(VERBOSE),,>/dev/null)
|
||||
endef
|
||||
|
||||
#- Targets --------------------------------------------------------------------
|
||||
|
||||
.PHONY: MobileLibreOffice_setup
|
||||
|
||||
#==============================================================================
|
||||
# Register target
|
||||
$(eval $(call gb_CustomTarget_CustomTarget,ios/MobileLibreOffice))
|
||||
#==============================================================================
|
||||
|
||||
#==============================================================================
|
||||
# Build
|
||||
# Depend on the custom target that sets up lo.xcconfig
|
||||
$(call gb_CustomTarget_get_target,ios/MobileLibreOffice): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig) MobileLibreOffice_setup
|
||||
#==============================================================================
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
|
||||
$(SRCDIR)/solenv/bin/native-code.py \
|
||||
-g core -g writer \
|
||||
> $(SRCDIR)/ios/shared/ios_sharedlo/cxx/native-code.mm
|
||||
$(call MobileLibreOfficeXcodeBuild, clean build)
|
||||
|
||||
#==============================================================================
|
||||
# Setup
|
||||
MobileLibreOffice_setup:
|
||||
#==============================================================================
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
|
||||
|
||||
# Resources #
|
||||
rm -rf $(MobileLibreOffice_resource) 2>/dev/null
|
||||
mkdir -p $(MobileLibreOffice_resource)
|
||||
mkdir -p $(MobileLibreOffice_resource)/ure
|
||||
|
||||
# copy rdb files
|
||||
cp $(INSTDIR)/ure/share/misc/types.rdb $(MobileLibreOffice_resource)
|
||||
cp $(INSTDIR)/program/types/offapi.rdb $(MobileLibreOffice_resource)
|
||||
cp $(INSTDIR)/program/types/oovbaapi.rdb $(MobileLibreOffice_resource)
|
||||
cp $(INSTDIR)/program/services/services.rdb $(MobileLibreOffice_resource)
|
||||
cp $(INSTDIR)/ure/share/misc/services.rdb $(MobileLibreOffice_resource)/ure
|
||||
|
||||
# copy .res files
|
||||
# program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
|
||||
# we could set STAR_RESOURCE_PATH instead. sigh...
|
||||
mkdir -p $(MobileLibreOffice_resource)/program/resource
|
||||
cp $(INSTDIR)/program/resource/*en-US.res $(MobileLibreOffice_resource)/program/resource
|
||||
|
||||
# soffice.cfg
|
||||
mkdir -p $(MobileLibreOffice_resource)/share/config
|
||||
cp -R $(INSTDIR)/share/config/soffice.cfg $(MobileLibreOffice_resource)/share/config
|
||||
|
||||
# "registry"
|
||||
cp -R $(INSTDIR)/share/registry $(MobileLibreOffice_resource)/share
|
||||
|
||||
# Set up rc, the "inifile". See getIniFileName_Impl().
|
||||
file=$(MobileLibreOffice_resource)/rc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' >> $$file; \
|
||||
echo 'HOME=$$APP_DATA_DIR/tmp' >> $$file;
|
||||
|
||||
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
|
||||
# Do we really need all these?
|
||||
file=$(MobileLibreOffice_resource)/fundamentalrc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' >> $$file; \
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/registry' >> $$file;
|
||||
|
||||
file=$(MobileLibreOffice_resource)/unorc; \
|
||||
echo '[Bootstrap]' > $$file;
|
||||
|
||||
# bootstraprc must be in $BRAND_BASE_DIR/program
|
||||
mkdir -p $(MobileLibreOffice_resource)/program
|
||||
file=$(MobileLibreOffice_resource)/program/bootstraprc; \
|
||||
echo '[Bootstrap]' > $$file; \
|
||||
echo 'InstallMode=<installmode>' >> $$file; \
|
||||
echo "ProductKey=LibreOffice $(PRODUCTVERSION)" >> $$file; \
|
||||
echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' >> $$file;
|
||||
|
||||
# Is this really needed?
|
||||
file=$(MobileLibreOffice_resource)/program/versionrc; \
|
||||
echo '[Version]' > $$file; \
|
||||
echo 'AllLanguages=en-US' >> $$file; \
|
||||
echo 'BuildVersion=' >> $$file; \
|
||||
echo "buildid=$(BUILDID)" >> $$file;
|
||||
|
||||
#==============================================================================
|
||||
# Clean
|
||||
$(call gb_CustomTarget_get_clean_target,ios/MobileLibreOffice):
|
||||
#==============================================================================
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
|
||||
$(call MobileLibreOfficeXcodeBuild, clean)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# vim: set noet sw=4 ts=4:
|
1
ios/MobileLibreOffice/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/resource_link
|
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 16 KiB |
@@ -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>
|
||||
#import "MLOInvoker.h"
|
||||
|
||||
@class MLOAppViewController;
|
||||
|
||||
@interface MLOAppDelegate : UIResponder <UIApplicationDelegate,MLOInvoker>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@property (strong, nonatomic) MLOAppViewController *viewController;
|
||||
|
||||
@end
|
@@ -1,113 +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 "MLOAppDelegate.h"
|
||||
#import "MLOAppViewController.h"
|
||||
#import "MLOFileManagerViewController.h"
|
||||
#import "MLOManager.h"
|
||||
#import "NSObject+MLOUtils.h"
|
||||
|
||||
|
||||
@implementation MLOAppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
|
||||
[[UIApplication sharedApplication]setStatusBarHidden:YES];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
|
||||
self.viewController = [[MLOAppViewController alloc] initWithAppDelegate:self];
|
||||
|
||||
self.window.rootViewController = self.viewController;
|
||||
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
[[UIApplication sharedApplication]setStatusBarHidden:YES];
|
||||
|
||||
[[MLOManager getInstance] application:application didFinishLaunchingWithOptions:launchOptions];
|
||||
|
||||
[[MLOManager getInstance] start];
|
||||
|
||||
[self.viewController.fileManager show];
|
||||
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
|
||||
{
|
||||
if (url != nil && [url isFileURL]) {
|
||||
|
||||
for (NSString * extension in @[@"docx",@"odt"]) {
|
||||
if([[[url pathExtension]lowercaseString] isEqualToString:extension]){
|
||||
|
||||
[self.viewController.fileManager openFilePath:[url path]];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void)willShowLibreOffice{
|
||||
|
||||
}
|
||||
-(void)didShowLibreOffice{
|
||||
|
||||
}
|
||||
-(void)willHideLibreOffice{
|
||||
|
||||
}
|
||||
-(void)didHideLibreOffice{
|
||||
|
||||
[self.viewController.fileManager didHideLibreOffice];
|
||||
}
|
||||
-(CGRect) bounds{
|
||||
return self.window.bounds;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
{
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
|
||||
[[MLOManager getInstance] applicationWillResignActive:application];
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||
{
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
|
||||
[[MLOManager getInstance] applicationDidEnterBackground:application];
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||
{
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
|
||||
[[MLOManager getInstance] applicationWillEnterForeground:application];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
{
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
|
||||
[[MLOManager getInstance] applicationWillTerminate:application];
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -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 <UIKit/UIKit.h>
|
||||
|
||||
@class MLOFileManagerViewController;
|
||||
@class MLOAppDelegate;
|
||||
|
||||
@interface MLOAppViewController : UIViewController
|
||||
@property MLOFileManagerViewController * fileManager;
|
||||
@property MLOAppDelegate * appDelegate;
|
||||
|
||||
-(id)initWithAppDelegate:(MLOAppDelegate *)appDelegate;
|
||||
-(CGRect)currentFullscreenFrame;
|
||||
|
||||
@end
|
@@ -1,131 +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 "MLOAppViewController.h"
|
||||
#import "MLOAppDelegate.h"
|
||||
#import "MLOManager.h"
|
||||
#import "MLOFileManagerViewController.h"
|
||||
#import "MLOResourceImage.h"
|
||||
|
||||
static const CGFloat LOGO_SCALE_RATIO = 0.5f;
|
||||
static const CGFloat BACKGROUND_ALPHA = 0.4f;
|
||||
static const NSTimeInterval FADE_IN_DURATION = 1.0f;
|
||||
|
||||
@interface MLOAppViewController ()
|
||||
@property UIView * backgroundImage;
|
||||
@property CGRect currentFullscreenFrame;
|
||||
@end
|
||||
|
||||
@implementation MLOAppViewController
|
||||
|
||||
-(id)initWithAppDelegate:(MLOAppDelegate *)appDelegate{
|
||||
self = [self init];
|
||||
if(self){
|
||||
|
||||
self.appDelegate = appDelegate;
|
||||
|
||||
[self addLoBackground];
|
||||
|
||||
[self rotateTo:[[UIApplication sharedApplication] statusBarOrientation]];
|
||||
|
||||
self.fileManager = [[MLOFileManagerViewController alloc] initWithAppViewController:self];
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
|
||||
}
|
||||
|
||||
-(void)addLoBackground{
|
||||
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
self.backgroundImage = [[UIView alloc] initWithFrame:CGRECT_ZERO];
|
||||
|
||||
[self.view addSubview:self.backgroundImage];
|
||||
[self.view sendSubviewToBack:self.backgroundImage];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(CGRect)backgroundRectForOrientation:(UIInterfaceOrientation) orientation{
|
||||
|
||||
CGRect appBounds = [self.appDelegate bounds];
|
||||
CGFloat bigger = appBounds.size.height;
|
||||
CGFloat smaller = appBounds.size.width;
|
||||
|
||||
if(smaller>bigger){
|
||||
bigger= smaller;
|
||||
smaller = appBounds.size.height;
|
||||
}
|
||||
|
||||
CGFloat frameWidth,frameHeight;
|
||||
|
||||
if((orientation == UIInterfaceOrientationLandscapeLeft) ||
|
||||
(orientation == UIInterfaceOrientationLandscapeRight)){
|
||||
frameHeight = smaller;
|
||||
frameWidth = bigger;
|
||||
}else{
|
||||
frameHeight= bigger;
|
||||
frameWidth = smaller;
|
||||
}
|
||||
|
||||
self.currentFullscreenFrame = CGRectMake(0,0,frameWidth,frameHeight);
|
||||
|
||||
CGFloat width = frameWidth * LOGO_SCALE_RATIO;
|
||||
|
||||
UIImage * logo = [MLOResourceImage loLogo];
|
||||
|
||||
CGFloat height = (width / logo.size.width) * logo.size.height;
|
||||
CGFloat originX = (frameWidth- width) /2.0f;
|
||||
CGFloat originY = (frameHeight - (height+((width-height)/2.0f))) /2.0f;
|
||||
|
||||
return CGRectMake(originX,originY,width,height);
|
||||
}
|
||||
|
||||
-(void)adjustLoBackground:(UIInterfaceOrientation) orientation{
|
||||
|
||||
self.backgroundImage.alpha = 0.0f;
|
||||
|
||||
self.backgroundImage.frame = [self backgroundRectForOrientation:orientation];
|
||||
|
||||
UIGraphicsBeginImageContext( self.backgroundImage.frame.size);
|
||||
[[MLOResourceImage loLogo] drawInRect: self.backgroundImage.bounds];
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
self.backgroundImage.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
|
||||
[UIView animateWithDuration:FADE_IN_DURATION animations:^{
|
||||
self.backgroundImage.alpha = BACKGROUND_ALPHA;
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)rotateTo:(UIInterfaceOrientation) orientation{
|
||||
|
||||
[self adjustLoBackground:orientation];
|
||||
|
||||
[self.fileManager onRotate];
|
||||
}
|
||||
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
|
||||
|
||||
[UIView animateWithDuration:duration*0.7f animations:^{
|
||||
|
||||
self.backgroundImage.alpha = 0.0f;
|
||||
}];
|
||||
|
||||
[self rotateTo:toInterfaceOrientation];
|
||||
}
|
||||
|
||||
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
|
||||
|
||||
[[MLOManager getInstance] application:nil didChangeStatusBarFrame:self.view.frame];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array>
|
||||
<string>mlo-icon-29</string>
|
||||
<string>mlo-icon-57</string>
|
||||
<string>mlo-icon-58</string>
|
||||
<string>mlo-icon-114</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MobileLibreOFfice</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.oracle.odt</string>
|
||||
<string>com.microsoft.word.doc</string>
|
||||
<string>com.microsoft.word.docx</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>mlo-icon-114.png</string>
|
||||
<string>mlo-icon-72.png</string>
|
||||
<string>mlo-icon-144.png</string>
|
||||
<string>mlo-icon-57.png</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Microsoft Office File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.microsoft.word.docx</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<string>docx</string>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/msword</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Open Office File</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.oracle.odt</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<string>odt</string>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/msword</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'MobileLibreOffice' target in the 'MobileLibreOffice' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_5_0
|
||||
#warning "This project uses features only available in iOS SDK 5.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.5 KiB |
@@ -1,2 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
@@ -1,23 +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 MLOCachedFile : MLOObject
|
||||
|
||||
-(id)initWithOriginFilePath:(NSString *) originFilePath;
|
||||
-(id)initByLoading:(id) source;
|
||||
-(id)toSavable;
|
||||
-(BOOL)deleteFile;
|
||||
-(BOOL)exists;
|
||||
-(NSString *) cachedFilePath;
|
||||
-(NSString *) cachedFileNameWithExtension;
|
||||
-(NSDate *) lastModified;
|
||||
+(NSUInteger)cachedFilesCount;
|
||||
+(void)setCachedFilesCount:(NSUInteger) count;
|
||||
@end
|
@@ -1,99 +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 "MLOCachedFile.h"
|
||||
#import "MLOFileCacheManager.h"
|
||||
#import "MLOManager.h"
|
||||
#import "NSObject+MLOFileUtils.h"
|
||||
#import "NSObject+MLOUtils.h"
|
||||
|
||||
static const NSString * CACHED_FILE_PATH_KEY = @"cahcedPath";
|
||||
static const NSString * CACHED_FILE_NAME_WITH_EXTENSION_KEY = @"cachedName";
|
||||
|
||||
@interface MLOCachedFile ()
|
||||
@property NSString * cachedFilePath;
|
||||
@property NSString * cachedFileNameWithExtension;
|
||||
@end
|
||||
|
||||
static NSUInteger cachedFilesCounter = 0;
|
||||
@implementation MLOCachedFile
|
||||
|
||||
|
||||
-(BOOL)createByCachingFilePath:(NSString *) originFilePath{
|
||||
self.cachedFileNameWithExtension = [originFilePath lastPathComponent];
|
||||
|
||||
NSString * newFileName = [NSString stringWithFormat:@"%d%@",cachedFilesCounter++,self.cachedFileNameWithExtension];
|
||||
self.cachedFilePath = [self cachedFilePath:newFileName];
|
||||
|
||||
NSError * error;
|
||||
|
||||
return [self returnSuccees:[[NSFileManager defaultManager] copyItemAtPath:originFilePath
|
||||
toPath:self.cachedFilePath
|
||||
error:&error]
|
||||
forAction:[NSString stringWithFormat:@"create cached file by copying %@ to %@",
|
||||
originFilePath,
|
||||
self.cachedFilePath]
|
||||
andAlertForError:error];
|
||||
}
|
||||
|
||||
+(NSUInteger)cachedFilesCount{
|
||||
return cachedFilesCounter;
|
||||
}
|
||||
|
||||
+(void)setCachedFilesCount:(NSUInteger) count{
|
||||
cachedFilesCounter = count;
|
||||
}
|
||||
|
||||
-(id)initWithOriginFilePath:(NSString *) originFilePath{
|
||||
|
||||
self = [self init];
|
||||
|
||||
if(self){
|
||||
|
||||
if(![self createByCachingFilePath:originFilePath]){
|
||||
self = nil;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initByLoading:(id) source{
|
||||
self = [self init];
|
||||
if(self){
|
||||
NSDictionary * dictionary = source;
|
||||
self.cachedFilePath = dictionary[CACHED_FILE_PATH_KEY];
|
||||
self.cachedFileNameWithExtension = dictionary[CACHED_FILE_NAME_WITH_EXTENSION_KEY];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) toSavable{
|
||||
return @{ CACHED_FILE_PATH_KEY : self.cachedFilePath,
|
||||
CACHED_FILE_NAME_WITH_EXTENSION_KEY : self.cachedFileNameWithExtension};
|
||||
}
|
||||
|
||||
-(BOOL)deleteFile{
|
||||
NSError * error;
|
||||
|
||||
return [self returnSuccees:[[NSFileManager defaultManager] removeItemAtPath:self.cachedFilePath
|
||||
error:&error]
|
||||
forAction:[NSString stringWithFormat:@"delete the cached file %@",self.cachedFilePath]
|
||||
andAlertForError:error];
|
||||
|
||||
}
|
||||
-(NSDictionary *) fileAttrributes{
|
||||
return [[NSFileManager defaultManager] attributesOfItemAtPath:self.cachedFilePath error:nil];
|
||||
}
|
||||
-(NSDate *) lastModified{
|
||||
return[[self fileAttrributes] fileModificationDate];
|
||||
}
|
||||
|
||||
-(BOOL)exists{
|
||||
return [[NSFileManager defaultManager] fileExistsAtPath:self.cachedFilePath];
|
||||
}
|
||||
@end
|
@@ -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"
|
||||
#import <MessageUI/MFMailComposeViewController.h>
|
||||
|
||||
@class MLOFileManagerViewController,MLOCachedFile;
|
||||
|
||||
@interface MLOFileCacheManager : MLOObject<MFMailComposeViewControllerDelegate>
|
||||
|
||||
@property MLOFileManagerViewController * fileManager;
|
||||
|
||||
-(id)initWithFileManager:(MLOFileManagerViewController *) fileManager;
|
||||
-(NSUInteger)count;
|
||||
-(void)deleteIndexPath:(NSIndexPath *) indexPath;
|
||||
-(UITableViewCell*)cellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath;
|
||||
-(void)openFilePath:(NSString *) filePath;
|
||||
-(void)openFileAtIndex:(NSUInteger) index;
|
||||
-(void)sendFileAtIndexPath:(NSIndexPath *) indexPath;
|
||||
|
||||
@end
|
@@ -1,210 +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 "MLOFileCacheManager.h"
|
||||
#import "MLOFileManagerViewController_Impl.h"
|
||||
#import "MLOCachedFile.h"
|
||||
#import "MLOAppViewController.h"
|
||||
#import "MLOAppDelegate.h"
|
||||
#import "MLOManager.h"
|
||||
#import "NSObject+MLOUtils.h"
|
||||
#import "NSObject+MLOFileUtils.h"
|
||||
|
||||
#define CACHED_DATA_FILE_NAME @"mlo_cache_data"
|
||||
|
||||
static const NSTimeInterval DELAY_BEFORE_OPENEING_FIRST_DOCUMENT = 2.0f;
|
||||
|
||||
@interface MLOFileCacheManager ()
|
||||
@property NSMutableArray * files;
|
||||
@property NSString *dbFilePath;
|
||||
@end
|
||||
|
||||
static NSString * OpenedFilesCountKey = @"openedFiles";
|
||||
static NSString * CachedFilesKey = @"cachedFiles";
|
||||
|
||||
@implementation MLOFileCacheManager
|
||||
|
||||
-(id)initWithFileManager:(MLOFileManagerViewController *) fileManager{
|
||||
self = [self init];
|
||||
if(self){
|
||||
self.fileManager =fileManager;
|
||||
self.dbFilePath = [self cachedFilePath:CACHED_DATA_FILE_NAME];
|
||||
[self load];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)loadFile{
|
||||
|
||||
NSDictionary * dictionary = [NSDictionary dictionaryWithContentsOfFile:self.dbFilePath];
|
||||
|
||||
[MLOCachedFile setCachedFilesCount:[((NSNumber *)dictionary[OpenedFilesCountKey]) unsignedIntValue]];
|
||||
|
||||
NSArray * array = dictionary[CachedFilesKey];
|
||||
|
||||
for (id loadable in array) {
|
||||
[self.files addObject:[[MLOCachedFile alloc] initByLoading:loadable]];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)load{
|
||||
|
||||
self.files = [NSMutableArray new];
|
||||
|
||||
if([[NSFileManager defaultManager] fileExistsAtPath:self.dbFilePath]){
|
||||
|
||||
[self loadFile];
|
||||
|
||||
}else{
|
||||
self.files = [NSMutableArray new];
|
||||
|
||||
NSString * exampleFileNameWithExtension = @"test1.odt";
|
||||
|
||||
[self addFileAndGetNewIndexForPath:
|
||||
[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:exampleFileNameWithExtension]];
|
||||
|
||||
}
|
||||
|
||||
[self.fileManager reloadData];
|
||||
|
||||
}
|
||||
-(void)save{
|
||||
NSMutableArray * array = [NSMutableArray new];
|
||||
|
||||
for (MLOCachedFile * file in self.files) {
|
||||
|
||||
[array addObject:[file toSavable]];
|
||||
|
||||
}
|
||||
|
||||
[@{OpenedFilesCountKey:[NSNumber numberWithUnsignedInt:[MLOCachedFile cachedFilesCount]],
|
||||
CachedFilesKey:array}
|
||||
|
||||
writeToFile:self.dbFilePath
|
||||
atomically:YES];
|
||||
|
||||
}
|
||||
|
||||
-(NSUInteger)addFileAndGetNewIndexForPath:(NSString *) newFilePath{
|
||||
|
||||
NSUInteger nextFileIndex = self.files.count;
|
||||
|
||||
MLOCachedFile * file = [[MLOCachedFile alloc] initWithOriginFilePath:newFilePath];
|
||||
|
||||
if([file exists]){
|
||||
|
||||
[self.files addObject:file];
|
||||
|
||||
[self save];
|
||||
|
||||
[self.fileManager reloadData];
|
||||
}else{
|
||||
nextFileIndex = self.files.count;
|
||||
}
|
||||
return nextFileIndex;
|
||||
}
|
||||
|
||||
-(NSUInteger)count{
|
||||
return self.files.count;
|
||||
}
|
||||
|
||||
-(MLOCachedFile *)getFileAtIndex:(NSUInteger) index{
|
||||
return self.files[index];
|
||||
}
|
||||
|
||||
-(void)deleteFileAtIndex:(NSUInteger)index{
|
||||
|
||||
MLOCachedFile * toDelete = [self getFileAtIndex:index];
|
||||
|
||||
if([toDelete deleteFile]){
|
||||
[self.files removeObject:toDelete];
|
||||
[self save];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)deleteIndexPath:(NSIndexPath*) indexPath{
|
||||
[self deleteFileAtIndex:indexPath.row];
|
||||
}
|
||||
|
||||
-(UITableViewCell*)cellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath{
|
||||
static NSString *CellIdentifier = @"Cell";
|
||||
|
||||
UITableViewCell * cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
|
||||
|
||||
MLOCachedFile * file = [self getFileAtIndex:indexPath.row];
|
||||
|
||||
cell.textLabel.text =file.cachedFileNameWithExtension;
|
||||
cell.detailTextLabel.text = [NSDateFormatter localizedStringFromDate:[file lastModified]
|
||||
dateStyle:NSDateFormatterShortStyle
|
||||
timeStyle:NSDateFormatterFullStyle];
|
||||
cell.accessoryType =UITableViewCellAccessoryDetailDisclosureButton;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(void)openFilePath:(NSString *) filePath{
|
||||
[self openFileAtIndex:[self addFileAndGetNewIndexForPath:filePath]];
|
||||
}
|
||||
-(void)openFileAtIndex:(NSUInteger) index{
|
||||
if(index != self.files.count){
|
||||
MLOCachedFile * file = [self getFileAtIndex:index];
|
||||
|
||||
[self performBlock:^{
|
||||
|
||||
[[MLOManager getInstance] openInLibreOfficeFilePath:[file cachedFilePath]
|
||||
fileNameWithExtension:[file cachedFileNameWithExtension]
|
||||
superView:self.fileManager.appViewController.view
|
||||
window:self.fileManager.appViewController.appDelegate.window
|
||||
invoker:self.fileManager.appViewController.appDelegate];
|
||||
|
||||
} afterDelay:DELAY_BEFORE_OPENEING_FIRST_DOCUMENT];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)sendFileAtIndexPath:(NSIndexPath *) indexPath{
|
||||
|
||||
MLOCachedFile * file = [self getFileAtIndex:indexPath.row];
|
||||
|
||||
MFMailComposeViewController *mailer = [MFMailComposeViewController new];
|
||||
|
||||
mailer.mailComposeDelegate = self;
|
||||
[mailer setMessageBody:@"Best" isHTML:NO];
|
||||
[mailer setSubject:file.cachedFileNameWithExtension];
|
||||
|
||||
NSData *myData =[[NSData alloc] initWithContentsOfFile:file.cachedFilePath];
|
||||
[mailer addAttachmentData:myData mimeType:@"iapplication/msword" fileName:file.cachedFileNameWithExtension];
|
||||
|
||||
[self.fileManager presentViewController:mailer animated:YES completion:nil];
|
||||
|
||||
}
|
||||
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case MFMailComposeResultCancelled:
|
||||
NSLog(@"Sending file: canceled");
|
||||
break;
|
||||
case MFMailComposeResultSaved:
|
||||
NSLog(@"Sending file: saved");
|
||||
break;
|
||||
case MFMailComposeResultSent:
|
||||
NSLog(@"Sending file: sent");
|
||||
break;
|
||||
case MFMailComposeResultFailed:
|
||||
NSLog(@"Sending file: failed");
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Sending file: not sent");
|
||||
break;
|
||||
}
|
||||
[self.fileManager dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -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 <UIKit/UIKit.h>
|
||||
|
||||
@class MLOFileManagerViewController;
|
||||
@interface MLOFileListViewController : UITableViewController
|
||||
|
||||
-(id)initWithFileManager:(MLOFileManagerViewController *)fileManager;
|
||||
-(void)onRotate;
|
||||
-(void)reloadData;
|
||||
|
||||
@end
|
@@ -1,96 +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 "MLOFileListViewController.h"
|
||||
#import "MLOFileManagerViewController_Impl.h"
|
||||
#import "MLOFileCacheManager.h"
|
||||
#import "MLOCachedFile.h"
|
||||
|
||||
@interface MLOFileListViewController ()
|
||||
@property MLOFileManagerViewController * fileManager;
|
||||
@property UITableView * list;
|
||||
@end
|
||||
|
||||
@implementation MLOFileListViewController
|
||||
|
||||
-(id)initWithFileManager:(MLOFileManagerViewController *)fileManager{
|
||||
self = [self initWithStyle:UITableViewStylePlain];
|
||||
|
||||
if(self){
|
||||
self.fileManager = fileManager;
|
||||
|
||||
self.list = [UITableView new];
|
||||
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
|
||||
[self reloadData];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)onRotate{
|
||||
|
||||
self.list.frame = [self.fileManager currentFullscreenFrame];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(void)reloadData{
|
||||
[self.list reloadData];
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return [self.fileManager.cache count];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return [self.fileManager.cache cellForTableView:tableView atIndexPath:indexPath];
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)hasFiles{
|
||||
return [self.fileManager.cache count] > 0;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
||||
[self.fileManager.cache deleteIndexPath:indexPath];
|
||||
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
||||
|
||||
if(![self hasFiles]){
|
||||
[self.fileManager reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
|
||||
[self.fileManager.cache sendFileAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
#pragma mark - Table view delegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[self.fileManager.cache openFileAtIndex:indexPath.row];
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
@end
|
@@ -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 "MLOViewController.h"
|
||||
|
||||
@class MLOAppViewController;
|
||||
@interface MLOFileManagerViewController : MLOViewController
|
||||
-(id) initWithAppViewController:(MLOAppViewController *) appViewController;
|
||||
-(void)show;
|
||||
-(void)didHideLibreOffice;
|
||||
-(void)hide;
|
||||
-(void)onRotate;
|
||||
-(void)openFilePath:(NSString *) filePath;
|
||||
@end
|
@@ -1,159 +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 "MLOFileManagerViewController_Impl.h"
|
||||
#import "MLOFileListViewController.h"
|
||||
#import "MLOResourceImage.h"
|
||||
#import "MLOAppViewController.h"
|
||||
#import "MLOAppDelegate.h"
|
||||
#import "MLOFileCacheManager.h"
|
||||
#import "NSObject+MLOUtils.h"
|
||||
|
||||
static const NSTimeInterval FADE_TIME=1.0f;
|
||||
|
||||
static const CGFloat EMPTY_LABEL_WIDTH = 500.0f,
|
||||
EMPTY_LABEL_HEIGHT =120.0f,
|
||||
EMPTY_FONT_SIZE = 30.0f;
|
||||
|
||||
@interface MLOFileManagerViewController ()
|
||||
@property MLOFileListViewController * list;
|
||||
@property UILabel * emptyLabel;
|
||||
@property BOOL isInit,isFirstRotation;
|
||||
@end
|
||||
|
||||
@implementation MLOFileManagerViewController
|
||||
|
||||
-(id) initWithAppViewController:(MLOAppViewController *) appViewController{
|
||||
self = [super init];
|
||||
if(self){
|
||||
|
||||
self.isInit = NO;
|
||||
self.isFirstRotation = YES;
|
||||
self.appViewController = appViewController;
|
||||
self.cache = [[MLOFileCacheManager alloc] initWithFileManager:self];
|
||||
self.list = [[MLOFileListViewController alloc] initWithFileManager:self];
|
||||
[self initEmptyLabel];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initEmptyLabel{
|
||||
self.emptyLabel = [[UILabel alloc]initWithFrame:CGRECT_ZERO];
|
||||
self.emptyLabel.text = @"No files to open.\r\nTry opening files from other apps.";
|
||||
self.emptyLabel.font = [UIFont systemFontOfSize:EMPTY_FONT_SIZE];
|
||||
self.emptyLabel.textAlignment =NSTextAlignmentCenter;
|
||||
self.emptyLabel.backgroundColor = [UIColor clearColor];
|
||||
self.emptyLabel.numberOfLines = 2;
|
||||
self.emptyLabel.alpha= 0.0f;
|
||||
}
|
||||
|
||||
-(void)reloadData{
|
||||
if([self updateSubviewsAndIsHasItems]){
|
||||
[self.list reloadData];
|
||||
}
|
||||
}
|
||||
-(void)show{
|
||||
|
||||
[[UIApplication sharedApplication]setStatusBarHidden:YES];
|
||||
|
||||
if(!self.isInit){
|
||||
self.isInit = YES;
|
||||
|
||||
[self.appViewController.view addSubview:self.view];
|
||||
[self.view addSubview:self.list.view];
|
||||
[self.view addSubview:self.emptyLabel];
|
||||
|
||||
[self fade:0.0f];
|
||||
}
|
||||
|
||||
[self reloadData];
|
||||
|
||||
[self onRotate];
|
||||
|
||||
[self animateFade:1.0f];
|
||||
}
|
||||
|
||||
-(void)didHideLibreOffice{
|
||||
self.isFirstRotation = YES;
|
||||
[self show];
|
||||
}
|
||||
|
||||
-(void)hide{
|
||||
[self animateFade:0.0f];
|
||||
}
|
||||
|
||||
-(void)onRotate{
|
||||
|
||||
CGRect superFrame = [self currentFullscreenFrame];
|
||||
|
||||
if(self.isFirstRotation){
|
||||
self.isFirstRotation = NO;
|
||||
self.view.frame = superFrame;
|
||||
}else{
|
||||
self.view.frame = CGRectMake(0,0, superFrame.size.height, superFrame.size.width);
|
||||
}
|
||||
|
||||
LOG_RECT(self.view.frame, @"MLOFileManagerViewController frame");
|
||||
|
||||
if([self updateSubviewsAndIsHasItems]){
|
||||
|
||||
[self.list onRotate];
|
||||
}
|
||||
}
|
||||
|
||||
-(BOOL)updateSubviewsAndIsHasItems{
|
||||
if([self.cache count]==0){
|
||||
|
||||
CGSize size =[self currentFullscreenFrame].size;
|
||||
|
||||
self.emptyLabel.frame = CGRectMake((size.width - EMPTY_LABEL_WIDTH)/2.0f,
|
||||
size.height -(EMPTY_LABEL_HEIGHT+ 50),
|
||||
EMPTY_LABEL_WIDTH,
|
||||
EMPTY_LABEL_HEIGHT);
|
||||
|
||||
self.emptyLabel.adjustsFontSizeToFitWidth=YES;
|
||||
|
||||
self.emptyLabel.alpha = 1.0f;
|
||||
self.list.view.alpha = 0.0f;
|
||||
|
||||
return NO;
|
||||
|
||||
}
|
||||
|
||||
self.emptyLabel.alpha = 0.0f;
|
||||
self.list.view.alpha = 1.0f;
|
||||
|
||||
return YES;
|
||||
|
||||
}
|
||||
|
||||
-(void)animateFade:(CGFloat) alphaTarget{
|
||||
|
||||
if(self.view.alpha!=alphaTarget){
|
||||
|
||||
[UIView animateWithDuration:FADE_TIME animations:^{
|
||||
|
||||
[self fade:alphaTarget];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)openFilePath:(NSString *)filePath{
|
||||
[self.cache openFilePath:filePath];
|
||||
}
|
||||
|
||||
-(void)fade:(CGFloat) alpha{
|
||||
self.view.alpha = alpha;
|
||||
}
|
||||
|
||||
|
||||
-(CGRect)currentFullscreenFrame{
|
||||
return [self.appViewController currentFullscreenFrame];
|
||||
}
|
||||
@end
|
@@ -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 "MLOFileManagerViewController.h"
|
||||
@class MLOFileCacheManager,MLOAppViewController,MLOFileListViewController;
|
||||
@interface MLOFileManagerViewController ()
|
||||
@property MLOAppViewController * appViewController;
|
||||
@property MLOFileCacheManager * cache;
|
||||
-(void)reloadData;
|
||||
-(CGRect)currentFullscreenFrame;
|
||||
@end
|
@@ -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 NSObject (MLOFileUtils)
|
||||
-(NSString *)cachedFilePath:(NSString *) lastPathComponent;
|
||||
@end
|
@@ -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 "NSObject+MLOFileUtils.h"
|
||||
|
||||
@implementation NSObject (MLOFileUtils)
|
||||
-(NSString *)cachedFilePath:(NSString *) lastPathComponent{
|
||||
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
|
||||
NSString *documentsDirectory = [paths objectAtIndex:0];
|
||||
|
||||
BOOL isDir;
|
||||
|
||||
NSFileManager * fileManager = [NSFileManager defaultManager];
|
||||
|
||||
if (! [fileManager fileExistsAtPath:documentsDirectory isDirectory:&isDir]) {
|
||||
|
||||
NSError * error;
|
||||
|
||||
BOOL success = [fileManager createDirectoryAtPath:documentsDirectory withIntermediateDirectories:NO attributes:nil error:&error];
|
||||
|
||||
if (!success || error) {
|
||||
NSLog(@"Error: %@", [error localizedDescription]);
|
||||
}
|
||||
}
|
||||
|
||||
return [documentsDirectory stringByAppendingPathComponent:lastPathComponent];
|
||||
}
|
||||
@end
|
@@ -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 <UIKit/UIKit.h>
|
||||
|
||||
#import "MLOAppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MLOAppDelegate class]));
|
||||
}
|
||||
}
|
@@ -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 */;
|
||||
}
|
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
@@ -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__) */
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
@@ -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__) */
|
@@ -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;
|
||||
}
|
@@ -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: */
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
||||
}
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
||||
|
@@ -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:
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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:
|
@@ -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:
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|