Kaydet (Commit) e36e86ee authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Refactor the iOS Viewer app and rename it to "LibreOffice"

No, it isn't any closer to being "ready" despite the name, but still,
using the current approach, it clearly isn't restricted to be just a
viewer.

Also drop the verbose LOViewer prefix from class and file names in it.

Change-Id: Ib4e8a31d6fa1b35169ee98cf2aa8f0f22957164c
üst bd9c9140
......@@ -204,7 +204,7 @@ endif
ifeq ($(OS),IOS)
$(eval $(call gb_Helper_register_executables,NONE,\
Viewer \
LibreOffice \
))
endif
......
......@@ -6,7 +6,7 @@
# 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/Viewer_app))
$(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
......@@ -37,29 +37,29 @@ ifneq ($(SCRIPT_OUTPUT_FILE_0),)
export CCACHE_CPP2=y
ifneq ($(CURRENT_ARCH),$(xcode_arch))
$(error Xcode platform (device or simulator) does not match that of this build tree)
$(error Xcode platform ($(CURRENT_ARCH)) does not match that of this build tree ($(xcode_arch)))
endif
ifneq ($(CONFIGURATION),$(xcode_config))
$(error Xcode configuration (release or debug) does not match that of this build tree)
$(error Xcode configuration ($(CONFIGURATION)) does not match that of this build tree ($(xcode_config)))
endif
endif
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
ifeq ($(EXECUTABLE_NAME),Viewer)
# When run from Xcode, we move the Viewer executable from solver into
# the Viewer.app directory that Xcode uses. We also set up/copy all
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/Viewer_app) : $(SCRIPT_OUTPUT_FILE_0)
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(SCRIPT_OUTPUT_FILE_0)
appdir=$(dir $(SCRIPT_OUTPUT_FILE_0))
buildid=$(shell git log -1 --format=%H)
$(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
$(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,Viewer) $(SCRIPT_OUTPUT_FILE_0)
mv $(call gb_Executable_get_target,LibreOffice) $(SCRIPT_OUTPUT_FILE_0)
#
# Copy rdb files
#
......@@ -101,7 +101,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
mv $(appdir)/share/registry/fcfg_langpack_en-US.xcd $(appdir)/share/registry/res
cp -R $(OUTDIR)/xml/registry/* $(appdir)/share/registry
#
# Set up rc, the "inifile". See getIniFileName_Impl().
# Set up rc, the "inifile". See getIniFileName_Impl().
#
( \
echo '[Bootstrap]' && \
......@@ -130,7 +130,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
( \
echo '[Bootstrap]' && \
echo 'InstallMode=<installmode>' && \
echo 'ProductKey=LibreOffice Viewer $(PRODUCTVERSION)' && \
echo 'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
: ) > $(appdir)/program/bootstraprc
#
......@@ -154,15 +154,15 @@ else
# 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/Viewer_app) : $(gb_Helper_PHONY)
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(gb_Helper_PHONY)
if test $(SRCDIR) != $(BUILDDIR); then \
(cd $(SRCDIR) && tar cf - ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj) | (cd $(BUILDDIR) && tar xf -); \
(cd $(SRCDIR) && tar cf - ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj) | (cd $(BUILDDIR) && tar xf -); \
fi
$(call gb_CustomTarget_get_clean_target,ios/Viewer_app) :
$(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/Viewer/build
rm -rf experimental/LibreOffice/build
endif
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
$(eval $(call gb_Executable_Executable,Viewer))
$(eval $(call gb_Executable_Executable,LibreOffice))
$(eval $(call gb_Executable_use_api,Viewer,\
$(eval $(call gb_Executable_use_api,LibreOffice,\
udkapi \
offapi \
))
$(eval $(call gb_Executable_use_externals,Viewer,\
$(eval $(call gb_Executable_use_externals,LibreOffice,\
boost_headers \
iconv \
zlib \
))
$(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\
$(eval $(call gb_Executable_use_system_darwin_frameworks,LibreOffice,\
Foundation \
CoreFoundation \
CoreGraphics \
......@@ -21,14 +21,15 @@ $(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\
UIKit \
))
$(eval $(call gb_Executable_add_objcxxobjects,Viewer,\
ios/experimental/Viewer/Viewer/lo-viewer \
ios/experimental/Viewer/Viewer/LOViewerAppDelegate \
ios/experimental/Viewer/Viewer/main \
$(eval $(call gb_Executable_add_objcxxobjects,LibreOffice,\
ios/experimental/LibreOffice/LibreOffice/lo \
))
$(eval $(call gb_Executable_add_objcobjects,Viewer,\
ios/experimental/Viewer/Viewer/LOViewerWindow \
$(eval $(call gb_Executable_add_objcobjects,LibreOffice,\
ios/experimental/LibreOffice/LibreOffice/AppDelegate \
ios/experimental/LibreOffice/LibreOffice/main \
ios/experimental/LibreOffice/LibreOffice/View \
ios/experimental/LibreOffice/LibreOffice/ViewController \
))
# The executables built for iOS link to all LO libs statically. The
......@@ -38,7 +39,7 @@ $(eval $(call gb_Executable_add_objcobjects,Viewer,\
# list a few libraries that are high in the dependency forest to make
# it likely that all necessary libraries are built before this
# executable is.
$(eval $(call gb_Executable_use_libraries,Viewer,\
$(eval $(call gb_Executable_use_libraries,LibreOffice,\
msword \
sal \
sc \
......@@ -51,6 +52,6 @@ $(eval $(call gb_Executable_use_libraries,Viewer,\
# rebuilt if any library has been rebuilt. Avoids need for "make
# ios.clean".
$(call gb_LinkTarget_get_target,Executable/Viewer) : $(wildcard $(OUTDIR)/lib/lib*.a)
$(call gb_LinkTarget_get_target,Executable/LibreOffice) : $(wildcard $(OUTDIR)/lib/lib*.a)
# vim: set ts=4 sw=4 et:
......@@ -11,8 +11,8 @@ $(eval $(call gb_Module_Module,ios))
ifeq ($(OS),IOS)
$(eval $(call gb_Module_add_targets,ios,\
Executable_Viewer \
CustomTarget_Viewer_app \
Executable_LibreOffice \
CustomTarget_LibreOffice_app \
))
endif
......
.DS_Store
build
project.xcworkspace
xcuserdata
......@@ -18,20 +18,22 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
BE08805B16FDB784000CED5C /* LOViewerWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LOViewerWindow.h; sourceTree = "<group>"; };
BE08805C16FDB784000CED5C /* LOViewerWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LOViewerWindow.m; sourceTree = "<group>"; };
BE08805B16FDB784000CED5C /* View.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = View.h; sourceTree = "<group>"; };
BE08805C16FDB784000CED5C /* View.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = View.m; sourceTree = "<group>"; };
BE4EEE9916FF724200D475B2 /* bitmapdevice.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bitmapdevice.cxx; path = ../../../../basebmp/source/bitmapdevice.cxx; sourceTree = "<group>"; };
BE4EEE9A16FF80B100D475B2 /* virdev.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = virdev.cxx; path = ../../../../vcl/source/gdi/virdev.cxx; sourceTree = "<group>"; };
BE5A22551664F87600CF01C9 /* Viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Viewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
BE56CD651704A08E00CA5B15 /* lo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lo.h; sourceTree = "<group>"; };
BE56CD661704A08E00CA5B15 /* lo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = lo.mm; sourceTree = "<group>"; };
BE5A22551664F87600CF01C9 /* LibreOffice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LibreOffice.app; sourceTree = BUILT_PRODUCTS_DIR; };
BE5A22591664F87600CF01C9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
BE5A225B1664F87600CF01C9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
BE5A225D1664F87600CF01C9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
BE5A22611664F87600CF01C9 /* Viewer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Viewer-Info.plist"; sourceTree = "<group>"; };
BE5A22611664F87600CF01C9 /* LibreOffice-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LibreOffice-Info.plist"; sourceTree = "<group>"; };
BE5A22631664F87600CF01C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
BE5A22651664F87600CF01C9 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
BE5A22671664F87600CF01C9 /* Viewer-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Viewer-Prefix.pch"; sourceTree = "<group>"; };
BE5A22681664F87600CF01C9 /* LOViewerAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LOViewerAppDelegate.h; sourceTree = "<group>"; };
BE5A22691664F87600CF01C9 /* LOViewerAppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LOViewerAppDelegate.mm; sourceTree = "<group>"; };
BE5A22651664F87600CF01C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
BE5A22671664F87600CF01C9 /* LibreOffice-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LibreOffice-Prefix.pch"; sourceTree = "<group>"; };
BE5A22681664F87600CF01C9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
BE5A22691664F87600CF01C9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
BE5A226B1664F87600CF01C9 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
BE5A226D1664F87600CF01C9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
BE5A226F1664F87600CF01C9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
......@@ -40,6 +42,8 @@
BE69AD8A1695954D001BE1CD /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
BE69AD8B1695954D001BE1CD /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
BE69AD8C1695954D001BE1CD /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
BE7B7AFF170438D0002341F4 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
BE7B7B00170438D0002341F4 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
BE9086F616FF02B2004400A1 /* headlessinst.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = headlessinst.cxx; path = ../../../../vcl/headless/headlessinst.cxx; sourceTree = "<group>"; };
BE9086F716FF02B2004400A1 /* svpbmp.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = svpbmp.cxx; path = ../../../../vcl/headless/svpbmp.cxx; sourceTree = "<group>"; };
BE9086F816FF02B2004400A1 /* svpdata.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = svpdata.cxx; path = ../../../../vcl/headless/svpdata.cxx; sourceTree = "<group>"; };
......@@ -72,7 +76,7 @@
BE5A224A1664F87600CF01C9 = {
isa = PBXGroup;
children = (
BE5A225F1664F87600CF01C9 /* Viewer */,
BE5A225F1664F87600CF01C9 /* LibreOffice */,
BE5A22581664F87600CF01C9 /* Frameworks */,
BE5A22561664F87600CF01C9 /* Products */,
);
......@@ -81,7 +85,7 @@
BE5A22561664F87600CF01C9 /* Products */ = {
isa = PBXGroup;
children = (
BE5A22551664F87600CF01C9 /* Viewer.app */,
BE5A22551664F87600CF01C9 /* LibreOffice.app */,
);
name = Products;
sourceTree = "<group>";
......@@ -97,17 +101,21 @@
name = Frameworks;
sourceTree = "<group>";
};
BE5A225F1664F87600CF01C9 /* Viewer */ = {
BE5A225F1664F87600CF01C9 /* LibreOffice */ = {
isa = PBXGroup;
children = (
BE4EEE9916FF724200D475B2 /* bitmapdevice.cxx */,
BEBF3E3C17002D4C00C454AC /* frame.cxx */,
BEBF3E3E17005E6B00C454AC /* frmload.cxx */,
BE9086F616FF02B2004400A1 /* headlessinst.cxx */,
BE5A22681664F87600CF01C9 /* LOViewerAppDelegate.h */,
BE5A22691664F87600CF01C9 /* LOViewerAppDelegate.mm */,
BE08805B16FDB784000CED5C /* LOViewerWindow.h */,
BE08805C16FDB784000CED5C /* LOViewerWindow.m */,
BE5A22681664F87600CF01C9 /* AppDelegate.h */,
BE5A22691664F87600CF01C9 /* AppDelegate.m */,
BE56CD651704A08E00CA5B15 /* lo.h */,
BE56CD661704A08E00CA5B15 /* lo.mm */,
BE7B7AFF170438D0002341F4 /* ViewController.h */,
BE7B7B00170438D0002341F4 /* ViewController.m */,
BE08805B16FDB784000CED5C /* View.h */,
BE08805C16FDB784000CED5C /* View.m */,
BEBF3E3A17002D0200C454AC /* svapp.cxx */,
BEBF3E3B17002D0200C454AC /* svmain.cxx */,
BE9086F716FF02B2004400A1 /* svpbmp.cxx */,
......@@ -125,16 +133,16 @@
BE69AD3716958CA0001BE1CD /* Resources */,
BE5A22601664F87600CF01C9 /* Supporting Files */,
);
path = Viewer;
path = LibreOffice;
sourceTree = "<group>";
};
BE5A22601664F87600CF01C9 /* Supporting Files */ = {
isa = PBXGroup;
children = (
BE5A22611664F87600CF01C9 /* Viewer-Info.plist */,
BE5A22611664F87600CF01C9 /* LibreOffice-Info.plist */,
BE5A22621664F87600CF01C9 /* InfoPlist.strings */,
BE5A22651664F87600CF01C9 /* main.mm */,
BE5A22671664F87600CF01C9 /* Viewer-Prefix.pch */,
BE5A22651664F87600CF01C9 /* main.m */,
BE5A22671664F87600CF01C9 /* LibreOffice-Prefix.pch */,
BE5A226B1664F87600CF01C9 /* Default.png */,
BE5A226D1664F87600CF01C9 /* Default@2x.png */,
BE5A226F1664F87600CF01C9 /* Default-568h@2x.png */,
......@@ -156,9 +164,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
BE5A22541664F87600CF01C9 /* Viewer */ = {
BE5A22541664F87600CF01C9 /* LibreOffice */ = {
isa = PBXNativeTarget;
buildConfigurationList = BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "Viewer" */;
buildConfigurationList = BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "LibreOffice" */;
buildPhases = (
BE8B879916933FCD00F61E9F /* ShellScript */,
BE5A22531664F87600CF01C9 /* Resources */,
......@@ -168,9 +176,9 @@
);
dependencies = (
);
name = Viewer;
productName = Viewer;
productReference = BE5A22551664F87600CF01C9 /* Viewer.app */;
name = LibreOffice;
productName = LibreOffice;
productReference = BE5A22551664F87600CF01C9 /* LibreOffice.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
......@@ -179,11 +187,10 @@
BE5A224C1664F87600CF01C9 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = LOViewer;
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Tor Lillqvist";
};
buildConfigurationList = BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "Viewer" */;
buildConfigurationList = BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "LibreOffice" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
......@@ -195,7 +202,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
BE5A22541664F87600CF01C9 /* Viewer */,
BE5A22541664F87600CF01C9 /* LibreOffice */,
);
};
/* End PBXProject section */
......@@ -293,8 +300,8 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Viewer/Viewer-Prefix.pch";
INFOPLIST_FILE = "Viewer/Viewer-Info.plist";
GCC_PREFIX_HEADER = "LibreOffice/LibreOffice-Prefix.pch";
INFOPLIST_FILE = "LibreOffice/LibreOffice-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "../../../workdir/$(LO_INPATH)/LinkTarget/Library";
PRODUCT_NAME = "$(TARGET_NAME)";
......@@ -306,8 +313,8 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Viewer/Viewer-Prefix.pch";
INFOPLIST_FILE = "Viewer/Viewer-Info.plist";
GCC_PREFIX_HEADER = "LibreOffice/LibreOffice-Prefix.pch";
INFOPLIST_FILE = "LibreOffice/LibreOffice-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "../../../workdir/$(LO_INPATH)/LinkTarget/Library";
PRODUCT_NAME = "$(TARGET_NAME)";
......@@ -318,7 +325,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "Viewer" */ = {
BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "LibreOffice" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE5A22861664F87600CF01C9 /* Debug */,
......@@ -327,7 +334,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "Viewer" */ = {
BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "LibreOffice" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE5A22891664F87600CF01C9 /* Debug */,
......
......@@ -8,17 +8,20 @@
#import <UIKit/UIKit.h>
#import "LOViewerWindow.h"
#import "View.h"
@interface LOViewerAppDelegate : UIResponder <UIApplicationDelegate>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
int nbytes;
char *pixelBuffer;
CGImageRef image;
}
@property (strong, nonatomic) LOViewerWindow *window;
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) View *view;
- (void) threadMainMethod: (id) argument;
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -6,32 +6,43 @@
// 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 <stdlib.h>
#import <UIKit/UIKit.h>
#include <osl/detail/ios-bootstrap.h>
#import "LOViewerAppDelegate.h"
#import "LOViewerWindow.h"
#import "AppDelegate.h"
#import "ViewController.h"
#include "lo-viewer.h"
#import "lo.h"
static UIWindow *theWindow;
static UIView *theView;
@implementation LOViewerAppDelegate
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
(void) application;
(void) launchOptions;
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
self.window = [[LOViewerWindow alloc] initWithFrame:bounds];
CGRect bounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:bounds];
self.window.backgroundColor = [UIColor whiteColor];
theWindow = self.window;
ViewController *vc = [[ViewController alloc] init];
self.window.rootViewController = vc;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
CGRect r = [self.window frame];
r.origin = CGPointMake(0, 0);
self.view = [[View alloc] initWithFrame: r];
vc.view = self.view;
theView = self.view;
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self.view action:@selector(tapGesture:)];
[self.window addGestureRecognizer: tapRecognizer];
nbytes = bounds.size.width * bounds.size.height * 4;
......@@ -41,14 +52,11 @@ static UIWindow *theWindow;
CGDataProviderRef provider = CGDataProviderCreateWithData( NULL, pixelBuffer, nbytes, NULL);
image = CGImageCreate(bounds.size.width, bounds.size.height, 8, 32, bounds.size.width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipLast, provider, NULL, false, kCGRenderingIntentDefault);
self.window.bounds = bounds;
self.window.pixelBuffer = pixelBuffer;
self.window.image = image;
self.view.pixelBuffer = pixelBuffer;
self.view.image = image;
lo_set_view_size(bounds.size.width, bounds.size.height);
[self.window makeKeyAndVisible];
NSThread* thread = [[NSThread alloc] initWithTarget:self
selector:@selector(threadMainMethod:)
object:nil];
......@@ -70,45 +78,35 @@ static UIWindow *theWindow;
- (void)applicationWillResignActive:(UIApplication *)application
{
(void) 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
(void) 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.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
(void) 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
(void) 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
{
(void) application;
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
extern "C" void lo_damaged()
void lo_damaged(CGRect rect)
{
[theWindow performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:YES];
(void) rect;
[theView performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:NO];
// NSLog(@"lo_damaged: %dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y);
}
// vim:set shiftwidth=4 softtabstop=4 expandtab:
//
// Prefix header for all source files of the 'Viewer' target in the 'Viewer' project
// Prefix header for all source files of the 'LibreOffice' target in the 'LibreOffice' project
//
#import <Availability.h>
......
......@@ -9,9 +9,14 @@
#import <UIKit/UIKit.h>
@interface LOViewerWindow : UIWindow
@property CGRect bounds;
@interface View : UIView
@property char *pixelBuffer;
@property CGImageRef image;
- (void)drawRect:(CGRect)rect;
- (void)tapGesture:(UIGestureRecognizer *)gestureRecognizer;
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -6,21 +6,38 @@
// 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 "LOViewerWindow.h"
#import "View.h"
#include <osl/detail/ios-bootstrap.h>
@implementation LOViewerWindow
@implementation View
- (void)drawRect:(CGRect)rect
{
(void) rect;
// NSLog(@"drawRect: %fx%f@(%f,%f)", rect.size.width, rect.size.height, rect.origin.x, rect.origin.y);
NSDate *a = [NSDate date];
lo_render_windows([self pixelBuffer], [self bounds].size.width, [self bounds].size.height);
NSLog(@"drawRect: lo_render_windows took %f s", [[NSDate date] timeIntervalSinceDate: a]);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, [self bounds], [self image]);
}
- (void) tapGesture:(UIGestureRecognizer *)gestureRecognizer
{
if ([gestureRecognizer state] == UIGestureRecognizerStateEnded) {
CGPoint location = [gestureRecognizer locationInView: self];
NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y);
lo_tap(location.x, location.y);
} else
NSLog(@"tapGesture: %@", gestureRecognizer);
}
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
// -*- 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 "ViewController.h"
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect rect = [self.view bounds];
NSLog(@"viewDidLoad: bounds=%dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y);
rect = [self.view frame];
NSLog(@" frame=%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:
......@@ -6,12 +6,15 @@
// 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 LO_VIEWER_H
#define LO_VIEWER_H
#ifdef __cplusplus
extern "C" {
#endif
void lo_initialize(void);
#endif // LO_VIEWER_H
#ifdef __cplusplus
}
#endif
// vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -129,10 +129,14 @@ lo_get_libmap(void)
return map;
}
extern "C"
void
lo_initialize(void)
{
setenv("SAL_LOG", "+WARN+INFO", 1);
if (UIDeviceOrientationIsPortrait([[UIDevice currentDevice] orientation]))
setenv("SAL_LOG", "+WARN+INFO.vcl.headless+INFO.vcl.ios", 1);
else
setenv("SAL_LOG", "-WARN-INFO", 1);
const char *argv[] = {
"placeholder-exe",
......
......@@ -8,12 +8,12 @@
#import <UIKit/UIKit.h>
#import "LOViewerAppDelegate.h"
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([LOViewerAppDelegate class]));
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
......
.DS_Store
build
Viewer.xcodeproj/project.xcworkspace
Viewer.xcodeproj/xcuserdata
......@@ -12,6 +12,8 @@
#if defined(IOS)
#include <CoreGraphics/CGGeometry.h>
#ifdef __cplusplus
extern "C" {
#endif
......@@ -37,7 +39,7 @@ extern "C" {
/* 1) */
void lo_damaged();
void lo_damaged(CGRect rect);
/* 2) */
......
......@@ -47,12 +47,13 @@ public:
SalFrame *getFocusFrame() const;
void RedrawWindows(char *pPixelBuffer,
int nPBWidth, int nPBHeight,
int destX, int nDestY,
int nDestWidth, int nDestHeight);
void RedrawWindows( char *pPixelBuffer,
int nPBWidth, int nPBHeight,
int destX, int nDestY,
int nDestWidth, int nDestHeight);
void damaged(IosSalFrame *frame);
void damaged( IosSalFrame *frame,
const basegfx::B2IBox& rDamageRect);
};
#endif // IOS_SALINST_H
......
......@@ -89,9 +89,10 @@ void IosSalInstance::RedrawWindows(char *pPixelBuffer,
}
}
void IosSalInstance::damaged(IosSalFrame */* frame */)
void IosSalInstance::damaged( IosSalFrame */* frame */,
const basegfx::B2IBox& rDamageRect )
{
lo_damaged();
lo_damaged( CGRectMake( rDamageRect.getMinX(), rDamageRect.getMinY(), rDamageRect.getWidth(), rDamageRect.getHeight() ));
}
void IosSalInstance::GetWorkArea( Rectangle& rRect )
......@@ -188,14 +189,12 @@ public:
IosSalInstance::getInstance()->GetWorkArea( rRect );
}
virtual void damaged( const basegfx::B2IBox& rDamageRect)
virtual void damaged( const basegfx::B2IBox& rDamageRect )
{
if (rDamageRect.getWidth() <= 0 ||
rDamageRect.getHeight() <= 0)
{
if (rDamageRect.isEmpty())
return;
}
IosSalInstance::getInstance()->damaged( this );
IosSalInstance::getInstance()->damaged( this, rDamageRect );
}
virtual void UpdateSettings( AllSettings &rSettings )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment