cppuhelper/source/shlib.cxx | 2 desktop/source/app/sofficemain.cxx | 6 + include/osl/detail/ios-bootstrap.h | 66 -------------- include/touch/touch.h | 49 +++++++--- ios/experimental/LibreOffice/LibreOffice/AppDelegate.m | 46 +++++++-- ios/experimental/LibreOffice/LibreOffice/View.h | 1 ios/experimental/LibreOffice/LibreOffice/View.m | 34 +++---- ios/experimental/LibreOffice/LibreOffice/ViewController.m | 2 ios/experimental/LibreOffice/LibreOffice/lo.mm | 3 sw/source/core/crsr/crsrsh.cxx | 24 ++++- vcl/android/androidinst.cxx | 10 +- vcl/ios/iosinst.cxx | 32 +++--- 12 files changed, 142 insertions(+), 133 deletions(-)
New commits: commit 12b1ca3236aa167c007c6c87e0d2f2d06c495821 Author: Tor Lillqvist <t...@collabora.com> Date: Sun Oct 13 23:17:19 2013 +0300 Hacking on iOS keyboard handling Change-Id: I0d842cc951cb5a3e7e990f835f541ccf1bd89df6 diff --git a/include/touch/touch.h b/include/touch/touch.h index ebe4b19..1f0d7ef 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -39,6 +39,7 @@ void touch_ui_damaged(int minX, int minY, int width, int height); void touch_ui_show_keyboard(); void touch_ui_hide_keyboard(); +bool touch_ui_keyboard_visible(); // 2) Those implmented in the lower layers to be called by the upper // layer, in cases where we don't want to include a bunch of the diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m index dddf3ac..c3ed9eb 100644 --- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m +++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m @@ -16,6 +16,7 @@ #import "lo.h" static View *theView; +static BOOL keyboardShows; @implementation AppDelegate @@ -78,6 +79,8 @@ static View *theView; NSThread* thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:nil]; + keyboardShows = NO; + [thread start]; return YES; @@ -158,6 +161,8 @@ static View *theView; NSLog(@"keyboardWillShow: frame:%dx%d@(%d,%d)", (int) frameEnd.size.width, (int) frameEnd.size.height, (int) frameEnd.origin.x, (int) frameEnd.origin.y); + + keyboardShows = YES; } - (void)keyboardDidHide:(NSNotification *)note @@ -166,6 +171,8 @@ static View *theView; NSLog(@"keyboardDidHide"); + keyboardShows = NO; + touch_lo_keyboard_did_hide(); } @@ -186,6 +193,15 @@ void touch_ui_damaged(int minX, int minY, int width, int height) void touch_ui_show_keyboard() { +#if 0 + // Horrible hack + static bool beenHere = false; + if (!beenHere) { + beenHere = true; + touch_lo_keyboard_did_hide(); + return; + } +#endif dispatch_async(dispatch_get_main_queue(), ^{ [theView->textView becomeFirstResponder]; }); @@ -198,4 +214,9 @@ void touch_ui_hide_keyboard() }); } +bool touch_ui_keyboard_visible() +{ + return keyboardShows; +} + // vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m index 3cd332b..de7b311 100644 --- a/ios/experimental/LibreOffice/LibreOffice/View.m +++ b/ios/experimental/LibreOffice/LibreOffice/View.m @@ -54,8 +54,6 @@ // NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y); touch_lo_tap(location.x, location.y); - - [self->textView becomeFirstResponder]; } else { // NSLog(@"tapGesture: %@", gestureRecognizer); } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 12f79af..83dfc08 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -61,6 +61,10 @@ #include <globals.hrc> #include <comcore.hrc> +#if defined(ANDROID) || defined(IOS) +#include <touch/touch.h> +#endif + using namespace com::sun::star; using namespace util; @@ -2030,6 +2034,9 @@ void SwCrsrShell::ShowCrsr() if( !m_bBasicHideCrsr ) { m_bSVCrsrVis = sal_True; +#if defined(ANDROID) || defined(IOS) + touch_ui_show_keyboard(); +#endif UpdateCrsr(); } } @@ -2042,6 +2049,9 @@ void SwCrsrShell::HideCrsr() // possibly reverse selected areas!! SET_CURR_SHELL( this ); m_pVisCrsr->Hide(); +#if defined(ANDROID) || defined(IOS) + touch_ui_hide_keyboard(); +#endif } } @@ -2510,7 +2520,12 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin ) m_bAllProtect = m_bVisPortChgd = m_bChgCallFlag = m_bInCMvVisportChgd = m_bGCAttr = m_bIgnoreReadonly = m_bSelTblCells = m_bBasicHideCrsr = m_bOverwriteCrsr = sal_False; - m_bCallChgLnk = m_bHasFocus = m_bSVCrsrVis = m_bAutoUpdateCells = sal_True; + m_bCallChgLnk = m_bHasFocus = m_bAutoUpdateCells = sal_True; +#if defined(ANDROID) || defined(IOS) + m_bSVCrsrVis = touch_ui_keyboard_visible(); +#else + m_bSVCrsrVis = sal_True; +#endif m_bSetCrsrInReadOnly = sal_True; m_pVisCrsr = new SwVisCrsr( this ); m_bMacroExecAllowed = rShell.IsMacroExecAllowed(); @@ -2542,7 +2557,12 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin, m_bAllProtect = m_bVisPortChgd = m_bChgCallFlag = m_bInCMvVisportChgd = m_bGCAttr = m_bIgnoreReadonly = m_bSelTblCells = m_bBasicHideCrsr = m_bOverwriteCrsr = sal_False; - m_bCallChgLnk = m_bHasFocus = m_bSVCrsrVis = m_bAutoUpdateCells = sal_True; + m_bCallChgLnk = m_bHasFocus = m_bAutoUpdateCells = sal_True; +#if defined(ANDROID) || defined(IOS) + m_bSVCrsrVis = touch_ui_keyboard_visible(); +#else + m_bSVCrsrVis = sal_True; +#endif m_bSetCrsrInReadOnly = sal_True; m_pVisCrsr = new SwVisCrsr( this ); diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 1ac4a83..c48fa32 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -542,13 +542,19 @@ Java_org_libreoffice_android_AppSupport_scroll(JNIEnv * /* env */, } extern "C" void -lo_show_keyboard() +touch_ui_show_keyboard() { } extern "C" void -lo_hide_keyboard() +touch_ui_hide_keyboard() { } +extern "C" bool +touch_ui_keyboard_visible() +{ + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit cbae2baa412437b624a1f01671ec16d9fdc358bb Author: Tor Lillqvist <t...@collabora.com> Date: Sun Oct 13 22:25:09 2013 +0300 Reduce logging Change-Id: I195a6a38f7cc597e6365ffd7f3e0432c73447e1a diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m index baab0a6..3cd332b 100644 --- a/ios/experimental/LibreOffice/LibreOffice/View.m +++ b/ios/experimental/LibreOffice/LibreOffice/View.m @@ -14,8 +14,8 @@ - (void)drawRect:(CGRect)rect { - NSLog(@"drawRect: %dx%d@(%d,%d)", (int) rect.size.width, (int) rect.size.height, (int) rect.origin.x, (int) rect.origin.y); - NSLog(@"statusBarOrientation: %ld", (long)[[UIApplication sharedApplication] statusBarOrientation]); + // NSLog(@"drawRect: %dx%d@(%d,%d)", (int) rect.size.width, (int) rect.size.height, (int) rect.origin.x, (int) rect.origin.y); + // NSLog(@"statusBarOrientation: %ld", (long)[[UIApplication sharedApplication] statusBarOrientation]); // NSDate *startDate = [NSDate date]; @@ -51,13 +51,13 @@ if ([gestureRecognizer state] == UIGestureRecognizerStateEnded) { CGPoint location = [gestureRecognizer locationInView: self]; - NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y); + // NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y); touch_lo_tap(location.x, location.y); [self->textView becomeFirstResponder]; } else { - NSLog(@"tapGesture: %@", gestureRecognizer); + // NSLog(@"tapGesture: %@", gestureRecognizer); } } @@ -71,7 +71,7 @@ int deltaX = translation.x - previousX; int deltaY = translation.y - previousY; - NSLog(@"panGesture: pan (delta): (%d,%d)", deltaX, deltaY); + // NSLog(@"panGesture: pan (delta): (%d,%d)", deltaX, deltaY); touch_lo_pan(deltaX, deltaY); } @@ -85,7 +85,7 @@ CGPoint location = [gestureRecognizer locationInView: self]; CGFloat scale = gestureRecognizer.scale; - NSLog(@"pinchGesture: pinch: (%f) cords (%d,%d)", (float)scale, (int)location.x, (int)location.y ); + // NSLog(@"pinchGesture: pinch: (%f) cords (%d,%d)", (float)scale, (int)location.x, (int)location.y ); touch_lo_zoom((int)location.x, (int)location.y, (float)scale); @@ -101,7 +101,7 @@ UIGestureRecognizerState state = gestureRecognizer.state; - NSLog(@"longPressGesture: state %d cords (%d,%d)",state ,(int)point.x,(int)point.y); + // NSLog(@"longPressGesture: state %d cords (%d,%d)",state ,(int)point.x,(int)point.y); if (state == UIGestureRecognizerStateEnded) { touch_lo_tap(point.x, point.y); commit e9f260b38076ce56f131914cfb5ece242eb1225c Author: Tor Lillqvist <t...@collabora.com> Date: Sun Oct 13 20:45:16 2013 +0300 Minor refactoring of iOS code Rename functions so that functions called by the UI layer for actions to happen in the LO layer and functions called by the LO layer for things to happen in the UI layer use different prefixes. Move declarations to the generic <touch/touch.h> and avoid iOS-specific types in the API. Change-Id: Ieb8979065e02a87c4a415c934163265f2790d011 diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index e9e021f..73f8809 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -34,7 +34,7 @@ #endif #ifdef IOS -#include <osl/detail/ios-bootstrap.h> +#include <osl/detail/component-mapping.h> #endif using namespace ::osl; diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 03d2eab..7678e5b 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -39,6 +39,10 @@ # define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__)) #endif +#ifdef IOS +#include <touch/touch.h> +#endif + int SVMain(); extern "C" int DESKTOP_DLLPUBLIC soffice_main() @@ -97,7 +101,7 @@ Java_org_libreoffice_android_AppSupport_runMain(JNIEnv* /* env */, #else extern "C" void -lo_runMain() +touch_lo_runMain() #endif { int nRet; diff --git a/include/osl/detail/ios-bootstrap.h b/include/osl/detail/ios-bootstrap.h deleted file mode 100644 index 0225c9a..0000000 --- a/include/osl/detail/ios-bootstrap.h +++ /dev/null @@ -1,66 +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 IOS_BOOSTRAP_H -#define IOS_BOOSTRAP_H - -#if defined(IOS) - -#include <premac.h> -#include <CoreGraphics/CoreGraphics.h> -#include <postmac.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#include <osl/detail/component-mapping.h> - -/* These functions are the interface between the upper GUI layers of a - * LibreOffice-based iOS app and the lower "core" layers, used in cases - * where the core parts need to call functions in the upper parts or - * vice versa. - * - * Thus there are two classes of functions here: - * - * 1) Those to be implemented in the upper layer and called by the - * lower layer - * - * 2) Those implmented in the lower layers to be called by the upper - * layer, in cases where we don't want to include a bunch of the - * "normal" LibreOffice C++ headers in an otherwise purely Objective-C - * CocoaTouch-based source file. Of course it depends on the case - * where that is wanted, and this all is work in progress. - */ - -/* 1) */ - -typedef enum { DOWN, MOVE, UP} LOMouseButtonState; - -void lo_damaged(CGRect rect); - -/* 2) */ - -void lo_runMain(); -void lo_set_view_size(int width, int height); -void lo_render_windows(CGContextRef context, CGRect rect); -void lo_tap(int x, int y); -void lo_pan(int deltaX, int deltaY); -void lo_zoom(int x, int y, float scale); -void lo_mouse_drag(int x, int y, LOMouseButtonState state); -void lo_keyboard_input(int c); - -#ifdef __cplusplus -} -#endif - -#endif // IOS -#endif // IOS_BOOTSTRAP_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/touch/touch.h b/include/touch/touch.h index 05ae335..ebe4b19 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -18,24 +18,48 @@ #if !HAVE_FEATURE_DESKTOP -// Functions to be implemented by the app-specifc upper or less -// app-specific but platform-specific medium layer on touch-based -// platforms. The same API is used on each such platform. There are -// called from low level LibreOffice code. Note that these are just -// declared here in this header in the "touch" module, the -// per-platform implementations are elsewhere. - #ifdef __cplusplus extern "C" { #endif -void lo_show_keyboard(); -void lo_hide_keyboard(); +// These functions are the interface between the upper GUI layers of a +// LibreOffice-based app on a touch platform app and the lower "core" +// layers, used in cases where the core parts need to call +// functionality in the upper parts or vice versa. +// +// Thus there are two classes of functions here: +// +// 1) Those to be implemented in the upper layer and called by the +// lower layer. Prefixed by touch_ui_. The same API is used on each +// such platform. There are called from low level LibreOffice +// code. Note that these are just declared here in a header for a +// "touch" module, the per-platform implementations are elsewhere. + +void touch_ui_damaged(int minX, int minY, int width, int height); + +void touch_ui_show_keyboard(); +void touch_ui_hide_keyboard(); + +// 2) Those implmented in the lower layers to be called by the upper +// layer, in cases where we don't want to include a bunch of the +// "normal" LibreOffice C++ headers in an otherwise purely Objective-C +// CocoaTouch-based source file. Of course it depends on the case +// where that is wanted, and this all is work in progress. Prefixed by +// touch_lo_. + +void touch_lo_keyboard_did_hide(); + +void touch_lo_runMain(); +void touch_lo_set_view_size(int width, int height); +void touch_lo_render_windows(void *context, int minX, int minY, int width, int height); +void touch_lo_tap(int x, int y); +void touch_lo_pan(int deltaX, int deltaY); +void touch_lo_zoom(int x, int y, float scale); +void touch_lo_keyboard_input(int c); -// Functions to be implemented in the medium platform-specific layer -// to be called from the app-specific UI layer. +typedef enum { DOWN, MOVE, UP} LOMouseButtonState; -void lo_keyboard_did_hide(); +void touch_lo_mouse_drag(int x, int y, LOMouseButtonState state); #ifdef __cplusplus } diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m index 7e3a0a9..dddf3ac 100644 --- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m +++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m @@ -8,7 +8,6 @@ #import <UIKit/UIKit.h> -#include <osl/detail/ios-bootstrap.h> #include <touch/touch.h> #import "AppDelegate.h" @@ -69,9 +68,9 @@ static View *theView; NSLog(@"statusBarOrientation: %ld", (long) [[UIApplication sharedApplication] statusBarOrientation]); if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) - lo_set_view_size(applicationFrame.size.height, applicationFrame.size.width); + touch_lo_set_view_size(applicationFrame.size.height, applicationFrame.size.width); else - lo_set_view_size(applicationFrame.size.width, applicationFrame.size.height); + touch_lo_set_view_size(applicationFrame.size.width, applicationFrame.size.height); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; @@ -90,7 +89,7 @@ static View *theView; @autoreleasepool { lo_initialize(); - lo_runMain(); + touch_lo_runMain(); } } @@ -100,7 +99,7 @@ static View *theView; assert(textView == theView->textView); for (NSUInteger i = 0; i < [text length]; i++) - lo_keyboard_input([text characterAtIndex: i]); + touch_lo_keyboard_input([text characterAtIndex: i]); return NO; } @@ -142,9 +141,9 @@ static View *theView; NSLog(@"statusBarOrientation: %ld", (long) [[UIApplication sharedApplication] statusBarOrientation]); if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) - lo_set_view_size(applicationFrame.size.height, applicationFrame.size.width); + touch_lo_set_view_size(applicationFrame.size.height, applicationFrame.size.width); else - lo_set_view_size(applicationFrame.size.width, applicationFrame.size.height); + touch_lo_set_view_size(applicationFrame.size.width, applicationFrame.size.height); } - (void)keyboardWillShow:(NSNotification *)note @@ -167,7 +166,7 @@ static View *theView; NSLog(@"keyboardDidHide"); - lo_keyboard_did_hide(); + touch_lo_keyboard_did_hide(); } @end @@ -176,23 +175,23 @@ static View *theView; // CocoaTouch activity to happen on the GUI thread. Use // dispatch_async() consistently. -void lo_damaged(CGRect rect) +void touch_ui_damaged(int minX, int minY, int width, int height) { - (void) rect; + CGRect rect = CGRectMake(minX, minY, width, height); dispatch_async(dispatch_get_main_queue(), ^{ [theView setNeedsDisplayInRect:rect]; }); - // NSLog(@"lo_damaged: %dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y); + // NSLog(@"lo_damaged: %dx%d@(%d,%d)", width, height, minX, minY); } -void lo_show_keyboard() +void touch_ui_show_keyboard() { dispatch_async(dispatch_get_main_queue(), ^{ [theView->textView becomeFirstResponder]; }); } -void lo_hide_keyboard() +void touch_ui_hide_keyboard() { dispatch_async(dispatch_get_main_queue(), ^{ [theView->textView resignFirstResponder]; diff --git a/ios/experimental/LibreOffice/LibreOffice/View.h b/ios/experimental/LibreOffice/LibreOffice/View.h index 7fd47d1..f036c48 100644 --- a/ios/experimental/LibreOffice/LibreOffice/View.h +++ b/ios/experimental/LibreOffice/LibreOffice/View.h @@ -19,7 +19,6 @@ - (void)panGesture:(UIPanGestureRecognizer *)gestureRecognizer; - (void)longPressGesture:(UILongPressGestureRecognizer *)gestureRecognizer; - @end // vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m index 99d57e9..baab0a6 100644 --- a/ios/experimental/LibreOffice/LibreOffice/View.m +++ b/ios/experimental/LibreOffice/LibreOffice/View.m @@ -8,7 +8,7 @@ #import "View.h" -#include <osl/detail/ios-bootstrap.h> +#include <touch/touch.h> @implementation View @@ -40,10 +40,10 @@ CGContextScaleCTM(context, 1, -1); break; } - lo_render_windows(context, rect); + touch_lo_render_windows(context, rect.origin.y, rect.origin.y, rect.size.width, rect.size.height); CGContextRestoreGState(context); - // NSLog(@"drawRect: lo_render_windows took %f s", [[NSDate date] timeIntervalSinceDate: startDate]); + // NSLog(@"drawRect: touch_lo_render_windows took %f s", [[NSDate date] timeIntervalSinceDate: startDate]); } - (void)tapGesture:(UITapGestureRecognizer *)gestureRecognizer @@ -53,7 +53,7 @@ NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y); - lo_tap(location.x, location.y); + touch_lo_tap(location.x, location.y); [self->textView becomeFirstResponder]; } else { @@ -73,7 +73,7 @@ NSLog(@"panGesture: pan (delta): (%d,%d)", deltaX, deltaY); - lo_pan(deltaX, deltaY); + touch_lo_pan(deltaX, deltaY); } previousX = translation.x; @@ -87,11 +87,11 @@ NSLog(@"pinchGesture: pinch: (%f) cords (%d,%d)", (float)scale, (int)location.x, (int)location.y ); - lo_zoom((int)location.x, (int)location.y, (float)scale); + touch_lo_zoom((int)location.x, (int)location.y, (float)scale); // to reset the gesture scaling if (gestureRecognizer.state==UIGestureRecognizerStateEnded) { - lo_zoom(1, 1, 0.0f); + touch_lo_zoom(1, 1, 0.0f); } } @@ -104,8 +104,8 @@ NSLog(@"longPressGesture: state %d cords (%d,%d)",state ,(int)point.x,(int)point.y); if (state == UIGestureRecognizerStateEnded) { - lo_tap(point.x, point.y); - lo_tap(point.x, point.y); + touch_lo_tap(point.x, point.y); + touch_lo_tap(point.x, point.y); } } diff --git a/ios/experimental/LibreOffice/LibreOffice/ViewController.m b/ios/experimental/LibreOffice/LibreOffice/ViewController.m index a7977af..a79c600 100644 --- a/ios/experimental/LibreOffice/LibreOffice/ViewController.m +++ b/ios/experimental/LibreOffice/LibreOffice/ViewController.m @@ -9,7 +9,7 @@ #import "ViewController.h" -#include <osl/detail/ios-bootstrap.h> +#include <touch/touch.h> #import "lo.h" diff --git a/ios/experimental/LibreOffice/LibreOffice/lo.mm b/ios/experimental/LibreOffice/LibreOffice/lo.mm index f65c532..d1c0f2d 100644 --- a/ios/experimental/LibreOffice/LibreOffice/lo.mm +++ b/ios/experimental/LibreOffice/LibreOffice/lo.mm @@ -12,8 +12,9 @@ #import <UIKit/UIKit.h> #include <postmac.h> -#include <osl/detail/ios-bootstrap.h> +#include <osl/detail/component-mapping.h> #include <osl/process.h> +#include <touch/touch.h> extern "C" { extern void * analysis_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index 3605288..7b4bcd2 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -21,14 +21,14 @@ #include <UIKit/UIKit.h> #include <postmac.h> -#include <osl/detail/ios-bootstrap.h> +#include <basebmp/scanlineformats.hxx> +#include <vcl/msgbox.hxx> +#include <touch/touch.h> + #include "ios/iosinst.hxx" #include "headless/svpdummies.hxx" #include "generic/gendata.hxx" -#include <basebmp/scanlineformats.hxx> -#include <vcl/msgbox.hxx> - // Horrible hack static int viewWidth = 1, viewHeight = 1; @@ -43,7 +43,7 @@ public: void IosSalInstance::damaged( IosSalFrame */* frame */, const basegfx::B2IBox& rDamageRect ) { - lo_damaged( CGRectMake( rDamageRect.getMinX(), rDamageRect.getMinY(), rDamageRect.getWidth(), rDamageRect.getHeight() )); + touch_ui_damaged( rDamageRect.getMinX(), rDamageRect.getMinY(), rDamageRect.getWidth(), rDamageRect.getHeight() ); } void IosSalInstance::GetWorkArea( Rectangle& rRect ) @@ -301,12 +301,12 @@ IMPL_LINK( IosSalInstance, DisplayConfigurationChanged, void*, ) (*it)->Show( sal_True, sal_False ); } - lo_damaged( CGRectMake( 0, 0, viewWidth, viewHeight ) ); + touch_ui_damaged( 0, 0, viewWidth, viewHeight ); return 0; } extern "C" -void lo_set_view_size(int width, int height) +void touch_lo_set_view_size(int width, int height) { int oldWidth = viewWidth; @@ -382,8 +382,9 @@ IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) } extern "C" -void lo_render_windows( CGContextRef context, CGRect rect ) +void touch_lo_render_windows(void *context, int minX, int minY, int width, int height) { + CGContextRef cgContext = (CGContextRef) context; int rc; IosSalInstance *pInstance = IosSalInstance::getInstance(); @@ -396,7 +397,8 @@ void lo_render_windows( CGContextRef context, CGRect rect ) return; } - IosSalInstance::RenderWindowsArg arg = { false, context, rect }; + CGRect rect = CGRectMake(minX, minY, width, height); + IosSalInstance::RenderWindowsArg arg = { false, cgContext, rect }; Application::PostUserEvent( LINK( pInstance, IosSalInstance, RenderWindows), &arg ); while (!arg.done) { @@ -409,7 +411,7 @@ void lo_render_windows( CGContextRef context, CGRect rect ) } extern "C" -void lo_tap(int x, int y) +void touch_lo_tap(int x, int y) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); if (pFocus) { @@ -426,7 +428,7 @@ void lo_tap(int x, int y) } extern "C" -void lo_mouse_drag(int x, int y, LOMouseButtonState state) +void touch_lo_mouse_drag(int x, int y, LOMouseButtonState state) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); @@ -454,7 +456,7 @@ void lo_mouse_drag(int x, int y, LOMouseButtonState state) } extern "C" -void lo_pan(int deltaX, int deltaY) +void touch_lo_pan(int deltaX, int deltaY) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); if (pFocus) { @@ -465,7 +467,7 @@ void lo_pan(int deltaX, int deltaY) } extern "C" -void lo_zoom(int x, int y, float scale) +void touch_lo_zoom(int x, int y, float scale) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); if (pFocus) { @@ -476,7 +478,7 @@ void lo_zoom(int x, int y, float scale) } extern "C" -void lo_keyboard_input(int c) +void touch_lo_keyboard_input(int c) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); if (pFocus) { @@ -487,7 +489,7 @@ void lo_keyboard_input(int c) } extern "C" -void lo_keyboard_did_hide() +void touch_lo_keyboard_did_hide() { // Tell LO it has lost "focus", which will cause it to stop // displaying any text insertion cursor etc _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits