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 ...@@ -204,7 +204,7 @@ endif
ifeq ($(OS),IOS) ifeq ($(OS),IOS)
$(eval $(call gb_Helper_register_executables,NONE,\ $(eval $(call gb_Helper_register_executables,NONE,\
Viewer \ LibreOffice \
)) ))
endif endif
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # 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 # We distinguish between builds for the simulator and device by
# looking for the "iarmv7" or "i386" in the -arch option that is part # looking for the "iarmv7" or "i386" in the -arch option that is part
...@@ -37,29 +37,29 @@ ifneq ($(SCRIPT_OUTPUT_FILE_0),) ...@@ -37,29 +37,29 @@ ifneq ($(SCRIPT_OUTPUT_FILE_0),)
export CCACHE_CPP2=y export CCACHE_CPP2=y
ifneq ($(CURRENT_ARCH),$(xcode_arch)) 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 endif
ifneq ($(CONFIGURATION),$(xcode_config)) 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
endif endif
ifneq ($(SCRIPT_OUTPUT_FILE_0),) ifneq ($(SCRIPT_OUTPUT_FILE_0),)
ifeq ($(EXECUTABLE_NAME),Viewer) ifeq ($(EXECUTABLE_NAME),LibreOffice)
# When run from Xcode, we move the Viewer executable from solver into # When run from Xcode, we move the LibreOffice executable from solver into
# the Viewer.app directory that Xcode uses. We also set up/copy all # the LibreOffice.app directory that Xcode uses. We also set up/copy all
# the run-time configuration etc files that the app needs. # 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)) appdir=$(dir $(SCRIPT_OUTPUT_FILE_0))
buildid=$(shell git log -1 --format=%H) 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) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
mkdir -p $(appdir)/ure 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 # Copy rdb files
# #
...@@ -101,7 +101,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer) ...@@ -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 mv $(appdir)/share/registry/fcfg_langpack_en-US.xcd $(appdir)/share/registry/res
cp -R $(OUTDIR)/xml/registry/* $(appdir)/share/registry 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]' && \ echo '[Bootstrap]' && \
...@@ -130,7 +130,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer) ...@@ -130,7 +130,7 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer)
( \ ( \
echo '[Bootstrap]' && \ echo '[Bootstrap]' && \
echo 'InstallMode=<installmode>' && \ echo 'InstallMode=<installmode>' && \
echo 'ProductKey=LibreOffice Viewer $(PRODUCTVERSION)' && \ echo 'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \ echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
: ) > $(appdir)/program/bootstraprc : ) > $(appdir)/program/bootstraprc
# #
...@@ -154,15 +154,15 @@ else ...@@ -154,15 +154,15 @@ else
# copy or move the executable to. So do nothing. Except one trick: # copy or move the executable to. So do nothing. Except one trick:
# Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one # Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
# can then open it from there in Xcode. # 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 \ 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 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) $(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
# Here we just assume that Xcode's settings are default, or something # Here we just assume that Xcode's settings are default, or something
rm -rf experimental/Viewer/build rm -rf experimental/LibreOffice/build
endif endif
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # -*- 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 \ udkapi \
offapi \ offapi \
)) ))
$(eval $(call gb_Executable_use_externals,Viewer,\ $(eval $(call gb_Executable_use_externals,LibreOffice,\
boost_headers \ boost_headers \
iconv \ iconv \
zlib \ zlib \
)) ))
$(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\ $(eval $(call gb_Executable_use_system_darwin_frameworks,LibreOffice,\
Foundation \ Foundation \
CoreFoundation \ CoreFoundation \
CoreGraphics \ CoreGraphics \
...@@ -21,14 +21,15 @@ $(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\ ...@@ -21,14 +21,15 @@ $(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\
UIKit \ UIKit \
)) ))
$(eval $(call gb_Executable_add_objcxxobjects,Viewer,\ $(eval $(call gb_Executable_add_objcxxobjects,LibreOffice,\
ios/experimental/Viewer/Viewer/lo-viewer \ ios/experimental/LibreOffice/LibreOffice/lo \
ios/experimental/Viewer/Viewer/LOViewerAppDelegate \
ios/experimental/Viewer/Viewer/main \
)) ))
$(eval $(call gb_Executable_add_objcobjects,Viewer,\ $(eval $(call gb_Executable_add_objcobjects,LibreOffice,\
ios/experimental/Viewer/Viewer/LOViewerWindow \ 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 # The executables built for iOS link to all LO libs statically. The
...@@ -38,7 +39,7 @@ $(eval $(call gb_Executable_add_objcobjects,Viewer,\ ...@@ -38,7 +39,7 @@ $(eval $(call gb_Executable_add_objcobjects,Viewer,\
# list a few libraries that are high in the dependency forest to make # list a few libraries that are high in the dependency forest to make
# it likely that all necessary libraries are built before this # it likely that all necessary libraries are built before this
# executable is. # executable is.
$(eval $(call gb_Executable_use_libraries,Viewer,\ $(eval $(call gb_Executable_use_libraries,LibreOffice,\
msword \ msword \
sal \ sal \
sc \ sc \
...@@ -51,6 +52,6 @@ $(eval $(call gb_Executable_use_libraries,Viewer,\ ...@@ -51,6 +52,6 @@ $(eval $(call gb_Executable_use_libraries,Viewer,\
# rebuilt if any library has been rebuilt. Avoids need for "make # rebuilt if any library has been rebuilt. Avoids need for "make
# ios.clean". # 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: # vim: set ts=4 sw=4 et:
...@@ -11,8 +11,8 @@ $(eval $(call gb_Module_Module,ios)) ...@@ -11,8 +11,8 @@ $(eval $(call gb_Module_Module,ios))
ifeq ($(OS),IOS) ifeq ($(OS),IOS)
$(eval $(call gb_Module_add_targets,ios,\ $(eval $(call gb_Module_add_targets,ios,\
Executable_Viewer \ Executable_LibreOffice \
CustomTarget_Viewer_app \ CustomTarget_LibreOffice_app \
)) ))
endif endif
......
.DS_Store
build
project.xcworkspace
xcuserdata
...@@ -8,17 +8,20 @@ ...@@ -8,17 +8,20 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "LOViewerWindow.h" #import "View.h"
@interface LOViewerAppDelegate : UIResponder <UIApplicationDelegate> @interface AppDelegate : UIResponder <UIApplicationDelegate>
{ {
int nbytes; int nbytes;
char *pixelBuffer; char *pixelBuffer;
CGImageRef image; CGImageRef image;
} }
@property (strong, nonatomic) LOViewerWindow *window; @property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) View *view;
- (void) threadMainMethod: (id) argument; - (void) threadMainMethod: (id) argument;
@end @end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
...@@ -6,32 +6,43 @@ ...@@ -6,32 +6,43 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <stdlib.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#include <osl/detail/ios-bootstrap.h> #include <osl/detail/ios-bootstrap.h>
#import "LOViewerAppDelegate.h" #import "AppDelegate.h"
#import "LOViewerWindow.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 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
(void) application; (void) application;
(void) launchOptions; (void) launchOptions;
CGRect bounds = [[UIScreen mainScreen] applicationFrame]; CGRect bounds = [[UIScreen mainScreen] bounds];
self.window = [[LOViewerWindow alloc] initWithFrame: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; nbytes = bounds.size.width * bounds.size.height * 4;
...@@ -41,14 +52,11 @@ static UIWindow *theWindow; ...@@ -41,14 +52,11 @@ static UIWindow *theWindow;
CGDataProviderRef provider = CGDataProviderCreateWithData( NULL, pixelBuffer, nbytes, NULL); 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); 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.view.pixelBuffer = pixelBuffer;
self.window.pixelBuffer = pixelBuffer; self.view.image = image;
self.window.image = image;
lo_set_view_size(bounds.size.width, bounds.size.height); lo_set_view_size(bounds.size.width, bounds.size.height);
[self.window makeKeyAndVisible];
NSThread* thread = [[NSThread alloc] initWithTarget:self NSThread* thread = [[NSThread alloc] initWithTarget:self
selector:@selector(threadMainMethod:) selector:@selector(threadMainMethod:)
object:nil]; object:nil];
...@@ -70,45 +78,35 @@ static UIWindow *theWindow; ...@@ -70,45 +78,35 @@ static UIWindow *theWindow;
- (void)applicationWillResignActive:(UIApplication *)application - (void)applicationWillResignActive:(UIApplication *)application
{ {
(void) 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)applicationDidEnterBackground:(UIApplication *)application
{ {
(void) 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)applicationWillEnterForeground:(UIApplication *)application
{ {
(void) 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)applicationDidBecomeActive:(UIApplication *)application
{ {
(void) 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)applicationWillTerminate:(UIApplication *)application
{ {
(void) application; (void) application;
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} }
@end @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: // 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> #import <Availability.h>
......
...@@ -9,9 +9,14 @@ ...@@ -9,9 +9,14 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface LOViewerWindow : UIWindow @interface View : UIView
@property CGRect bounds;
@property char *pixelBuffer; @property char *pixelBuffer;
@property CGImageRef image; @property CGImageRef image;
- (void)drawRect:(CGRect)rect; - (void)drawRect:(CGRect)rect;
- (void)tapGesture:(UIGestureRecognizer *)gestureRecognizer;
@end @end
// vim:set shiftwidth=4 softtabstop=4 expandtab:
...@@ -6,21 +6,38 @@ ...@@ -6,21 +6,38 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "LOViewerWindow.h" #import "View.h"
#include <osl/detail/ios-bootstrap.h> #include <osl/detail/ios-bootstrap.h>
@implementation LOViewerWindow @implementation View
- (void)drawRect:(CGRect)rect - (void)drawRect:(CGRect)rect
{ {
(void) 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); 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(); CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, [self bounds], [self image]); 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 @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 @@ ...@@ -6,12 +6,15 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // 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/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef LO_VIEWER_H #ifdef __cplusplus
#define LO_VIEWER_H extern "C" {
#endif
void lo_initialize(void); void lo_initialize(void);
#endif // LO_VIEWER_H #ifdef __cplusplus
}
#endif
// vim:set shiftwidth=4 softtabstop=4 expandtab: // vim:set shiftwidth=4 softtabstop=4 expandtab:
...@@ -129,10 +129,14 @@ lo_get_libmap(void) ...@@ -129,10 +129,14 @@ lo_get_libmap(void)
return map; return map;
} }
extern "C"
void void
lo_initialize(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[] = { const char *argv[] = {
"placeholder-exe", "placeholder-exe",
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "LOViewerAppDelegate.h" #import "AppDelegate.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@autoreleasepool { @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 @@ ...@@ -12,6 +12,8 @@
#if defined(IOS) #if defined(IOS)
#include <CoreGraphics/CGGeometry.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -37,7 +39,7 @@ extern "C" { ...@@ -37,7 +39,7 @@ extern "C" {
/* 1) */ /* 1) */
void lo_damaged(); void lo_damaged(CGRect rect);
/* 2) */ /* 2) */
......
...@@ -47,12 +47,13 @@ public: ...@@ -47,12 +47,13 @@ public:
SalFrame *getFocusFrame() const; SalFrame *getFocusFrame() const;
void RedrawWindows(char *pPixelBuffer, void RedrawWindows( char *pPixelBuffer,
int nPBWidth, int nPBHeight, int nPBWidth, int nPBHeight,
int destX, int nDestY, int destX, int nDestY,
int nDestWidth, int nDestHeight); int nDestWidth, int nDestHeight);
void damaged(IosSalFrame *frame); void damaged( IosSalFrame *frame,
const basegfx::B2IBox& rDamageRect);
}; };
#endif // IOS_SALINST_H #endif // IOS_SALINST_H
......
...@@ -89,9 +89,10 @@ void IosSalInstance::RedrawWindows(char *pPixelBuffer, ...@@ -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 ) void IosSalInstance::GetWorkArea( Rectangle& rRect )
...@@ -188,14 +189,12 @@ public: ...@@ -188,14 +189,12 @@ public:
IosSalInstance::getInstance()->GetWorkArea( rRect ); IosSalInstance::getInstance()->GetWorkArea( rRect );
} }
virtual void damaged( const basegfx::B2IBox& rDamageRect) virtual void damaged( const basegfx::B2IBox& rDamageRect )
{ {
if (rDamageRect.getWidth() <= 0 || if (rDamageRect.isEmpty())
rDamageRect.getHeight() <= 0)
{
return; return;
}
IosSalInstance::getInstance()->damaged( this ); IosSalInstance::getInstance()->damaged( this, rDamageRect );
} }
virtual void UpdateSettings( AllSettings &rSettings ) 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