From 4cc1bcbaedd483482240f0ffbf42e56dd6052612 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 24 Mar 2015 11:28:21 +0200 Subject: Kill dead API Has all been obsoleted by LibreOfficeKit. Only some MOBILE_* constant #defines are now left in touch.h, but probably those are used only by dead code. Change-Id: I646945c4408b4e6cd5510da535cfc12088dd391c --- android/Bootstrap/Makefile.shared | 4 +- android/experimental/LOAndroid3/dummies.cxx | 75 --------- android/experimental/desktop/dummies.cxx | 74 --------- include/touch/touch-impl.h | 37 ----- include/touch/touch.h | 245 ---------------------------- sw/inc/pch/precompiled_sw.hxx | 1 - sw/source/core/crsr/crsrsh.cxx | 4 - sw/source/core/crsr/viscrs.cxx | 11 -- sw/source/core/view/viewsh.cxx | 52 ------ sw/source/uibase/docvw/edtwin.cxx | 82 ---------- vcl/android/androidinst.cxx | 17 -- vcl/inc/ios/iosinst.hxx | 15 -- vcl/ios/iosinst.cxx | 211 ------------------------ vcl/source/window/dialog.cxx | 4 - 14 files changed, 2 insertions(+), 830 deletions(-) delete mode 100644 android/experimental/LOAndroid3/dummies.cxx delete mode 100644 android/experimental/desktop/dummies.cxx delete mode 100644 include/touch/touch-impl.h diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared index 5020773b40e2..93298e915002 100644 --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -98,9 +98,9 @@ WHOLELIBS = \ -Wl,--no-whole-archive -$(OBJLOCAL)/liblo-native-code.so : native-code.cxx dummies.cxx $(ALL_STATIC_LIBS) +$(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS) mkdir -p $(OBJLOCAL) - $(CXX) -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx dummies.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lgnustl_static -lGLESv2 -landroid -ljnigraphics -llog -lz + $(CXX) -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lgnustl_static -lGLESv2 -landroid -ljnigraphics -llog -lz $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so mkdir -p $(SODEST) diff --git a/android/experimental/LOAndroid3/dummies.cxx b/android/experimental/LOAndroid3/dummies.cxx deleted file mode 100644 index 5607ecfd72d6..000000000000 --- a/android/experimental/LOAndroid3/dummies.cxx +++ /dev/null @@ -1,75 +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/. - */ - -// Dummy implementations of the callback functions in the UI layer -// that the LO layer calls. As this experimental Android app doesn't -// handle any of that, these do nothing. - -#include - -#include - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_start(MLOSelectionKind kind, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount, - void *preview) -{ -} - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_resize_done(bool success, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount) -{ -} - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_none() -{ -} - - -static const char * -dialog_kind_to_string(MLODialogKind kind) -{ - switch (kind) { - case MLODialogMessage: - return "MSG"; - case MLODialogInformation: - return "INF"; - case MLODialogWarning: - return "WRN"; - case MLODialogError: - return "ERR"; - case MLODialogQuery: - return "QRY"; - default: - return "WTF"; - } -} - -extern "C" -__attribute__ ((visibility("default"))) -MLODialogResult -touch_ui_dialog_modal(MLODialogKind kind, const char *message) -{ - __android_log_print(ANDROID_LOG_INFO, "===> %s: %s", dialog_kind_to_string(kind), message); - return MLODialogOK; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/experimental/desktop/dummies.cxx b/android/experimental/desktop/dummies.cxx deleted file mode 100644 index f89009a317be..000000000000 --- a/android/experimental/desktop/dummies.cxx +++ /dev/null @@ -1,74 +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/. - */ - -// Dummy implementations of the callback functions in the UI layer -// that the LO layer calls. As this experimental Android app doesn't -// handle any of that, these do nothing. - -#include - -#include - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_start(MLOSelectionKind kind, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount, - void *preview) -{ -} - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_resize_done(bool success, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount) -{ -} - -extern "C" -__attribute__ ((visibility("default"))) -void -touch_ui_selection_none() -{ -} - -static const char * -dialog_kind_to_string(MLODialogKind kind) -{ - switch (kind) { - case MLODialogMessage: - return "MSG"; - case MLODialogInformation: - return "INF"; - case MLODialogWarning: - return "WRN"; - case MLODialogError: - return "ERR"; - case MLODialogQuery: - return "QRY"; - default: - return "WTF"; - } -} - -extern "C" -__attribute__ ((visibility("default"))) -MLODialogResult -touch_ui_dialog_modal(MLODialogKind kind, const char *message) -{ - __android_log_print(ANDROID_LOG_INFO, "===> %s: %s", dialog_kind_to_string(kind), message); - return MLODialogOK; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/touch/touch-impl.h b/include/touch/touch-impl.h deleted file mode 100644 index cbe59da1db49..000000000000 --- a/include/touch/touch-impl.h +++ /dev/null @@ -1,37 +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 INCLUDED_TOUCH_TOUCH_IMPL_H -#define INCLUDED_TOUCH_TOUCH_IMPL_H - -#ifdef __cplusplus -extern "C" { -#if 0 -} // To avoid an editor indenting all inside the extern "C" -#endif -#endif - -// "Implementation" of touch_lo_* functions, called on the LO thread through -// the PostUserEvent mechanism. Not called by UI thread code. - -void touch_lo_selection_start_move_impl(const void *documentHandle, - int x, - int y); - -void touch_lo_selection_end_move_impl(const void *documentHandle, - int x, - int y); - -#ifdef __cplusplus -} -#endif - -#endif // INCLUDED_TOUCH_TOUCH_IMPL_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/touch/touch.h b/include/touch/touch.h index 7771699d41cc..e20fe3fe5a3e 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -10,255 +10,10 @@ #ifndef INCLUDED_TOUCH_TOUCH_H #define INCLUDED_TOUCH_TOUCH_H -#include - #define MOBILE_MAX_ZOOM_IN 600 #define MOBILE_MAX_ZOOM_OUT 80 #define MOBILE_ZOOM_SCALE_MULTIPLIER 10000 -#if !HAVE_FEATURE_DESKTOP - -// Let's try this way: Use Quartz 2D types for iOS, and LO's basegfx -// types for others, when/if this API is used for others. But of -// course, it is quite likely that some degree of redesign is needed -// at such a stage anyway... - -#ifdef IOS -#include -#include -#include -#else -#include -#include -#include -#endif - -#ifdef __cplusplus -extern "C" { -#if 0 -} // To avoid an editor indenting all inside the extern "C" -#endif -#endif - -// 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(); -bool touch_ui_keyboard_visible(); - -// Dialogs, work in progress, no clear plan yet what to do - -typedef enum { - MLODialogMessage, - MLODialogInformation, - MLODialogWarning, - MLODialogError, - MLODialogQuery -} MLODialogKind; - -typedef enum { - MLODialogOK, - MLODialogCancel, - MLODialogNo, - MLODialogYes, - MLODialogRetry, - MLODialogIgnore, -} MLODialogResult; - -MLODialogResult touch_ui_dialog_modal(MLODialogKind kind, const char *message); - -typedef enum { - MLOSelectionNone, - MLOSelectionText, - MLOSelectionGraphic -} MLOSelectionKind; - -#ifdef IOS -typedef CGRect MLORect; -typedef CGFloat MLODpx; -typedef CGPoint MLODpxPoint; -typedef CGSize MLODpxSize; - -#else - -// Very much work in progress, just something to make this compile -typedef basegfx::B2DRange MLORect; -typedef float MLODpx; -typedef basegfx::B2DTuple MLODpxPoint; -typedef basegfx::B1DRange MLODpxSize; - -#endif - -// MLORip - tens of TWIPs, of questionable usefuless - -typedef long long MLORip; - -static const MLORip LO_TWIPS_TO_MLO_RIP_RATIO = 1L; - -struct MLORipSize -{ - MLORip width; - MLORip height; -}; -typedef struct MLORipSize MLORipSize; - -struct MLORipPoint -{ - MLORip x; - MLORip y; -}; -typedef struct MLORipPoint MLORipPoint; - -static inline MLODpx -MLODpxByRip(MLORip rip) -{ - return (MLODpx) (rip / LO_TWIPS_TO_MLO_RIP_RATIO); -} - -static inline MLORip -MLORipByDpx(MLODpx dpx) -{ - return (MLORip) (dpx * LO_TWIPS_TO_MLO_RIP_RATIO); -} - -static inline MLODpxPoint -MLODpxPointByDpxes(MLODpx x, MLODpx y) -{ -#ifdef IOS - return CGPointMake(x, y); -#else - return basegfx::B2DTuple(x, y); -#endif -} - -#ifdef IOS - -static inline MLODpxSize -MLODpxSizeByDpxes(MLODpx width, MLODpx height) -{ - return CGSizeMake(width, height); -} - -static inline MLORipSize -MLORipSizeByRips(MLORip width, MLORip height) -{ - MLORipSize ripSize; ripSize.width = width; ripSize.height = height; return ripSize; -} - -static inline MLORipPoint -MLORipPointByRips(MLORip x, MLORip y) -{ - MLORipPoint point; point.x = x; point.y = y; return point; -} - -static inline MLORipSize -MLORipSizeByDpxSize(MLODpxSize dpxSize) -{ - MLORipSize ripSize; - ripSize.width = MLORipByDpx(dpxSize.width); - ripSize.height = MLORipByDpx(dpxSize.height); - return ripSize; -} - -static inline MLODpxSize -MLODpxSizeByRips(MLORip width, MLORip height) -{ - CGFloat fWidth = MLODpxByRip(width); - CGFloat fHeight = MLODpxByRip(height); - return CGSizeMake(fWidth, fHeight); -} - -static inline MLODpxSize -MLODpxSizeByRipSize(MLORipSize ripSize) -{ - return MLODpxSizeByRips(ripSize.width, ripSize.height); -} - -MLORipPoint MLORipPointByDpxPoint(MLODpxPoint mloDpxPoint); - -MLODpxPoint MLODpxPointByMLORipPoint(MLORipPoint mloRipPoint); - -#endif - -// selection - -void touch_ui_selection_start(MLOSelectionKind kind, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount, - void *preview); - -void touch_ui_selection_resize_done(bool success, - const void *documentHandle, - MLORect *rectangles, - int rectangleCount); - -void touch_ui_selection_none(); - -// 2) Those implemented 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_. All these are called on the UI thread and except for -// those so marked schedule work to be done asynchronously on the LO -// thread. - -typedef enum { DOWN, MOVE, UP} MLOMouseButtonState; -typedef enum { NONE, SHIFT, META } MLOModifiers; -typedef int MLOModifierMask; - -void touch_lo_keyboard_did_hide(); - -void touch_lo_set_view_size(int width, int height); -void touch_lo_tap(int x, int y); -void touch_lo_mouse(int x, int y, MLOMouseButtonState state, MLOModifierMask modifiers); -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); - -void touch_lo_copy_buffer(const void * source, size_t sourceWidth, size_t sourceHeight, size_t sourceBytesPerRow, void * target, size_t targetWidth, size_t targetHeight); -MLODpxSize touch_lo_get_content_size(); -void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state); - -// Move the start of the selection to (x,y) -void touch_lo_selection_start_move(const void *documentHandle, - int x, - int y); - -// Move the end of the selection to (x,y) -void touch_lo_selection_end_move(const void *documentHandle, - int x, - int y); - -void touch_lo_selection_attempt_resize(const void *documentHandle, - MLORect *selectedRectangles, - int numberOfRectangles); - -// Special case: This is the function that is called in the newly -// created LO thread to run the LO code. -void touch_lo_runMain(); - - -#ifdef __cplusplus -} -#endif - -#endif // HAVE_FEATURE_DESKTOP - #endif // INCLUDED_TOUCH_TOUCH_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 3755950c665e..44aa8cc86805 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -1038,7 +1038,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ef020fdd5f09..19b78610dad8 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -64,10 +64,6 @@ #include #include -#if defined(IOS) -#include -#endif - using namespace com::sun::star; using namespace util; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 3c62a4ad48ce..a26cd78fa2a7 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -53,7 +53,6 @@ #include -#include #include #include @@ -385,16 +384,6 @@ void SwSelPaintRects::Show() } } -#if !HAVE_FEATURE_DESKTOP - -extern "C" void touch_lo_selection_attempt_resize(const void * /* documentHandle */, - MLORect * /* selectedRectangles */, - int /* numberOfRectangles */) -{ -} - -#endif - void SwSelPaintRects::HighlightInputFld() { std::vector< basegfx::B2DRange > aInputFldRanges; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index b5920a19977a..cf37dbe0ae2b 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -19,8 +19,6 @@ #include -#include - #include #include #include @@ -1833,56 +1831,6 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex setTiledRendering(bTiledRendering); } -#if !HAVE_FEATURE_DESKTOP -extern "C" -MLODpxSize touch_lo_get_content_size() -{ -#ifdef IOS - SwWrtShell *pViewShell; - // FIXME: make sure this is not called before we have a document... - while (!(pViewShell = GetActiveWrtShell())) - { - sleep(1); - } - - if (pViewShell) - { - static const MLORip WIDTH_ADDITION = 6L * DOCUMENTBORDER; - static const MLORip HEIGHT_ADDITION = 2L * DOCUMENTBORDER; - Size documentSize =pViewShell->GetView().GetDocSz(); - return MLODpxSizeByRips(((MLORip)documentSize.Width()) + WIDTH_ADDITION, - ((MLORip)documentSize.Height()) + HEIGHT_ADDITION); - } - return MLODpxSizeByDpxes(0,0); -#else - return MLODpxSize(); -#endif -} - -extern "C" -MLORipPoint MLORipPointByDpxPoint(MLODpxPoint mloDpxPoint) -{ -#ifdef IOS - //MLODpxSize contentSize = touch_lo_get_content_size(); - MLORip x = MLORipByDpx(mloDpxPoint.x /*- (contentSize.width/2.0f)*/); - MLORip y = MLORipByDpx(mloDpxPoint.y); - return MLORipPointByRips(x,y); -#else - (void) mloDpxPoint; - return MLORipPoint(); -#endif -} - -extern "C" -MLODpxPoint MLODpxPointByRipPoint(MLORipPoint mloRipPoint) -{ - //MLODpxSize contentSize = touch_lo_get_content_size(); - MLODpx x = MLODpxByRip(mloRipPoint.x)/* + (contentSize.width/2.0f)*/; - MLODpx y = MLODpxByRip(mloRipPoint.y); - return MLODpxPointByDpxes(x,y); -} -#endif - void SwViewShell::SetBrowseBorder( const Size& rNew ) { if( rNew != maBrowseBorder ) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 6356b9883f1b..b02b8afdb83e 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -68,7 +68,6 @@ #include #include -#include #include #include @@ -2703,87 +2702,6 @@ static bool lcl_urlOverBackground(SwWrtShell& rSh, const Point& rDocPos) return rSh.GetContentAtPos(rDocPos, aSwContentAtPos) && pSelectableObj->GetLayer() == rSh.GetDoc()->getIDocumentDrawModelAccess().GetHellId(); } -#if !HAVE_FEATURE_DESKTOP - -// As such these two functions could be more or less anywhere, I have -// them now in this source file because the act of moving a selection -// end point is somewhat the same as what happens when one -// shift-clicks on either side of an existing selection. - -void touch_lo_selection_start_move_impl(const void *documentHandle, - int x, - int y) -{ - SwWrtShell *pWrtShell = reinterpret_cast(const_cast(documentHandle)); - - if (!pWrtShell) - return; - - const OutputDevice *pOut = pWrtShell->GetWin(); - if (!pOut) - pOut = pWrtShell->GetOut(); - - const Point aDocPos( pOut->PixelToLogic( Point(x, y) ) ); - - // Don't allow moving the start of the selection beyond the end - // (point) of the selection. - - SwRect startCharRect; - pWrtShell->GetCharRectAt(startCharRect, pWrtShell->GetCrsr()->GetPoint()); - const Point startCharPos = startCharRect.Center(); - - if (startCharPos.Y() < aDocPos.Y() || - (startCharPos.Y() == aDocPos.Y() && startCharPos.X() - startCharRect.Width() <= aDocPos.X())) - return; - - pWrtShell->ChgCurrPam( aDocPos ); - - // Keep mark normally at the start and point at the end, - // just exchange for the duration of moving the start. - pWrtShell->GetCrsr()->Exchange(); - { - SwMvContext aMvContext( pWrtShell ); - pWrtShell->SwCrsrShell::SetCrsr( aDocPos ); - } - pWrtShell->GetCrsr()->Exchange(); -} - -void touch_lo_selection_end_move_impl(const void *documentHandle, - int x, - int y) -{ - SwWrtShell *pWrtShell = reinterpret_cast(const_cast(documentHandle)); - - if (!pWrtShell) - return; - - const OutputDevice *pOut = pWrtShell->GetWin(); - if (!pOut) - pOut = pWrtShell->GetOut(); - - const Point aDocPos( pOut->PixelToLogic( Point(x, y) ) ); - - // Don't allow moving the end of the selection beyond the start - // (mark) of the selection. - - SwRect endCharRect; - pWrtShell->GetCharRectAt(endCharRect, pWrtShell->GetCrsr()->GetMark()); - const Point endCharPos = endCharRect.Center(); - - if (endCharPos.Y() > aDocPos.Y() || - (endCharPos.Y() == aDocPos.Y() && endCharPos.X() + endCharRect.Width() >= aDocPos.X())) - return; - - pWrtShell->ChgCurrPam( aDocPos ); - - { - SwMvContext aMvContext( pWrtShell ); - pWrtShell->SwCrsrShell::SetCrsr( aDocPos ); - } -} - -#endif - void SwEditWin::MoveCursor( SwWrtShell &rSh, const Point& rDocPos, const bool bOnlyText, bool bLockView ) { diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 42c9816e02cc..5b766d5686e7 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #define LOGTAG "LibreOffice/androidinst" @@ -543,20 +542,4 @@ Java_org_libreoffice_android_AppSupport_scroll(JNIEnv * /* env */, LOGW("No focused frame to emit event on"); } -extern "C" void -touch_ui_show_keyboard() -{ -} - -extern "C" void -touch_ui_hide_keyboard() -{ -} - -extern "C" bool -touch_ui_keyboard_visible() -{ - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/iosinst.hxx b/vcl/inc/ios/iosinst.hxx index e165f139f72c..757cde45a041 100644 --- a/vcl/inc/ios/iosinst.hxx +++ b/vcl/inc/ios/iosinst.hxx @@ -44,21 +44,6 @@ public: SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); SalFrame *getFocusFrame() const; - - // Functions scheduled to be run as "user events" in the LO thread - DECL_LINK( DisplayConfigurationChanged, void* ); - - typedef struct { - const void *documentHandle; - int x, y; - } SelectionStartMoveArg; - DECL_LINK( SelectionStartMove, SelectionStartMoveArg* ); - - typedef struct { - const void *documentHandle; - int x, y; - } SelectionEndMoveArg; - DECL_LINK( SelectionEndMove, SelectionEndMoveArg* ); }; #endif // INCLUDED_VCL_INC_IOS_IOSINST_HXX diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index 2b1c26e17359..8356e8e8feba 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -22,8 +22,6 @@ #include #include -#include -#include #include "ios/iosinst.hxx" #include "headless/svpdummies.hxx" @@ -236,213 +234,4 @@ int IosSalSystem::ShowNativeDialog( const OUString& rTitle, return 0; } -IMPL_LINK( IosSalInstance, DisplayConfigurationChanged, void*, ) -{ - for( std::list< SalFrame* >::const_iterator it = getFrames().begin(); - it != getFrames().end(); - ++it ) { - (*it)->Show( false, false ); - (*it)->CallCallback( SALEVENT_SETTINGSCHANGED, 0 ); - (*it)->SetPosSize(0, 0, viewWidth, viewHeight, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT); - (*it)->Show( true, false ); - } - - return 0; -} - -extern "C" -void touch_lo_set_view_size(int width, int height) -{ - int oldWidth = viewWidth; - - viewWidth = width; - viewHeight = height; - - if (oldWidth > 1) { - // Inform about change in display size (well, just orientation - // presumably). - IosSalInstance *pInstance = IosSalInstance::getInstance(); - - if ( pInstance == NULL ) - return; - - Application::PostUserEvent( LINK( pInstance, IosSalInstance, DisplayConfigurationChanged ), NULL ); - } -} - -extern "C" -void -touch_lo_copy_buffer(const void * source, size_t sourceWidth, size_t sourceHeight, size_t sourceBytesPerRow, void * target, size_t targetWidth, size_t targetHeight){ - - CGDataProviderRef provider =CGDataProviderCreateWithData(NULL, - source, - sourceHeight * sourceBytesPerRow, - NULL ); - CGImage *sourceImage = CGImageCreate(sourceWidth, - sourceHeight, - 8, - 32, - sourceBytesPerRow, - CGColorSpaceCreateDeviceRGB(), - kCGImageAlphaNoneSkipLast, - provider, - NULL, - false, - kCGRenderingIntentDefault ); - CGContextRef context =(CGContextRef) target; - CGRect targetRect = CGRectMake( 0, 0, targetWidth, targetHeight ); - CGContextDrawImage( context, targetRect, sourceImage ); - CGImageRelease(sourceImage); - CGDataProviderRelease(provider); -} - -extern "C" -void touch_lo_tap(int x, int y) -{ - touch_lo_mouse(x, y, DOWN, NONE); - touch_lo_mouse(x, y, UP, NONE); -} - -extern "C" -void touch_lo_mouse(int x, int y, MLOMouseButtonState state, MLOModifierMask modifiers) -{ - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - - if (pFocus) { - MouseEvent aEvent; - sal_uLong nEvent; - sal_uInt16 nModifiers = 0; - - if (modifiers & SHIFT) - nModifiers |= KEY_SHIFT; - - if (modifiers & META) - nModifiers |= KEY_MOD1; - - switch (state) { - case DOWN: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT, nModifiers); - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONDOWN; - break; - case MOVE: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLEMOVE, MOUSE_LEFT, nModifiers); - nEvent = VCLEVENT_WINDOW_MOUSEMOVE; - break; - case UP: - aEvent = MouseEvent(Point(x, y), 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT, nModifiers); - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONUP; - break; - default: - assert(false); - } - Application::PostMouseEvent(nEvent, pFocus->GetWindow(), &aEvent); - } -} - -extern "C" -void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state) -{ - touch_lo_mouse(x, y, state, NONE); -} - -extern "C" -void touch_lo_pan(int deltaX, int deltaY) -{ - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - SAL_INFO( "vcl.ios", "pan delta: " << "(" << deltaX << "," << deltaY << ") "); - ScrollEvent aEvent( deltaX, deltaY ); - Application::PostScrollEvent(VCLEVENT_WINDOW_SCROLL, pFocus->GetWindow(), &aEvent); - } -} - -extern "C" -void touch_lo_zoom(int x, int y, float scale) -{ - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - SAL_INFO( "vcl.ios", "pinch: " << "(" << scale << ") "); - ZoomEvent aEvent( Point(x,y), scale); - Application::PostZoomEvent(VCLEVENT_WINDOW_ZOOM, pFocus->GetWindow(), &aEvent); - } -} - -extern "C" -void touch_lo_keyboard_input(int c) -{ - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - KeyEvent aEvent(c, c, 0); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pFocus->GetWindow(), &aEvent); - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pFocus->GetWindow(), &aEvent); - } -} - -extern "C" -void touch_lo_keyboard_did_hide() -{ - // Tell LO it has lost "focus", which will cause it to stop - // displaying any text insertion cursor etc - - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - MouseEvent aEvent; - - aEvent = MouseEvent(Point(0, 0), 0, MouseEventModifiers::LEAVEWINDOW, MOUSE_LEFT); - Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEMOVE, pFocus->GetWindow(), &aEvent); - } -} - -IMPL_LINK( IosSalInstance, SelectionStartMove, SelectionStartMoveArg*, pArg ) -{ - touch_lo_selection_start_move_impl(pArg->documentHandle, pArg->x, pArg->y); - - delete pArg; - - return 0; -} - -extern "C" -void touch_lo_selection_start_move(const void *documentHandle, - int x, - int y) -{ - IosSalInstance *pInstance = IosSalInstance::getInstance(); - - if ( pInstance == NULL ) - return; - - IosSalInstance::SelectionStartMoveArg *pArg = new IosSalInstance::SelectionStartMoveArg; - pArg->documentHandle = documentHandle; - pArg->x = x; - pArg->y = y; - Application::PostUserEvent( LINK( pInstance, IosSalInstance, SelectionStartMove), pArg ); -} - -IMPL_LINK( IosSalInstance, SelectionEndMove, SelectionEndMoveArg*, pArg ) -{ - touch_lo_selection_end_move_impl(pArg->documentHandle, pArg->x, pArg->y); - - delete pArg; - - return 0; -} - -extern "C" -void touch_lo_selection_end_move(const void *documentHandle, - int x, - int y) -{ - IosSalInstance *pInstance = IosSalInstance::getInstance(); - - if ( pInstance == NULL ) - return; - - IosSalInstance::SelectionEndMoveArg *pArg = new IosSalInstance::SelectionEndMoveArg; - pArg->documentHandle = documentHandle; - pArg->x = x; - pArg->y = y; - Application::PostUserEvent( LINK( pInstance, IosSalInstance, SelectionEndMove), pArg ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index b2d413928bf4..1e9f53a86df3 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -49,10 +49,6 @@ #include -#if !HAVE_FEATURE_DESKTOP -#include -#endif - static OString ImplGetDialogText( Dialog* pDialog ) { OStringBuffer aErrorStr(OUStringToOString( -- cgit