[Libreoffice-commits] core.git: 5 commits - ios/experimental sw/source touch/inc vcl/ios

Tor Lillqvist tml at iki.fi
Sat Apr 13 10:59:47 PDT 2013


 ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj |    8 +++
 ios/experimental/LibreOffice/LibreOffice/AppDelegate.m             |   25 ++++++++++
 sw/source/core/crsr/crsrsh.cxx                                     |   12 ----
 touch/inc/touch/touch.h                                            |   15 ++++--
 vcl/ios/iosinst.cxx                                                |   15 ++++++
 5 files changed, 59 insertions(+), 16 deletions(-)

New commits:
commit 860d6a1995253c758bc9431049d26d9c80f8be37
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Apr 13 13:00:14 2013 +0300

    Nah, SwCrsrShell::{Show,Hide}Crsr() are the wrong places to show/hide keyboard
    
    At least I think so. Something more complicated is needed, or at least
    lots more experimentation.
    
    Change-Id: If511697de12ca8576720d67c80113c579eb66741

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index e6bf8c5..c32250c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <config_features.h>
-
 #include <com/sun/star/util/SearchOptions.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
 #include <hintids.hxx>
@@ -64,10 +62,6 @@
 
 #include <comcore.hrc>
 
-#if !HAVE_FEATURE_DESKTOP
-#include <touch/touch.h>
-#endif
-
 using namespace com::sun::star;
 using namespace util;
 
@@ -2006,9 +2000,6 @@ void SwCrsrShell::ShowCrsr()
     {
         m_bSVCrsrVis = sal_True;
         UpdateCrsr();
-#if !HAVE_FEATURE_DESKTOP
-        lo_show_keyboard();
-#endif
     }
 }
 
@@ -2021,9 +2012,6 @@ void SwCrsrShell::HideCrsr()
         // possibly reverse selected areas!!
         SET_CURR_SHELL( this );
         m_pVisCrsr->Hide();
-#if !HAVE_FEATURE_DESKTOP
-        lo_hide_keyboard();
-#endif
     }
 }
 
commit 410ad97b30691e88bbac4d2fa66e2eecf9bfc060
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Apr 13 12:08:24 2013 +0200

    Listen for keyboard show and hide notifications
    
    Only react to hide notification for now, call lo_keyboard_did_hide()
    
    Change-Id: I2f429039d2a84269783d103ad635ff4c407c4a15

diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
index 3a70fa3..223ccf5 100644
--- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
+++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
@@ -47,6 +47,9 @@ static UIView *theView;
 
     lo_set_view_size(bounds.size.width, bounds.size.height);
 
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
+
     NSThread* thread = [[NSThread alloc] initWithTarget:self
                                                selector:@selector(threadMainMethod:)
                                                  object:nil];
@@ -90,6 +93,28 @@ static UIView *theView;
     (void) application;
 }
 
+- (void)keyboardWillShow:(NSNotification *)note
+{
+    NSDictionary *info = [note userInfo];
+    CGRect frameBegin;
+    CGRect frameEnd;
+
+    [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&frameBegin];
+    [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&frameEnd];
+}
+
+- (void)keyboardDidHide:(NSNotification *)note
+{
+    NSDictionary *info = [note userInfo];
+    CGRect frameBegin;
+    CGRect frameEnd;
+
+    [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&frameBegin];
+    [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&frameEnd];
+
+    lo_keyboard_did_hide();
+}
+
 @end
 
 void lo_damaged(CGRect rect)
commit 2cca07806251c2085661f4639acfdf085c1984fe
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Apr 13 13:04:50 2013 +0300

    Add experimental lo_keyboard_did_hide() implementation
    
    Change-Id: I24a7449848710c0e09a4bf0da0d906d30a59f0bd

diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index a0893af..ebf44ac 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -369,4 +369,19 @@ void lo_tap(int x, int y)
     }
 }
 
+extern "C"
+void 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, MOUSE_LEAVEWINDOW, MOUSE_LEFT);
+        Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEMOVE, pFocus->GetWindow(), &aEvent);
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ab49b49f04a3dd9d3a530193798983d540c031d4
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Apr 13 13:03:40 2013 +0300

    Add lo_keyboard_did_hide() and improve comment
    
    Change-Id: I20ae40fa03079d69f7ce9e71fa4ef6264e8d84a4

diff --git a/touch/inc/touch/touch.h b/touch/inc/touch/touch.h
index 87fe985..8fa2dd1 100644
--- a/touch/inc/touch/touch.h
+++ b/touch/inc/touch/touch.h
@@ -14,10 +14,12 @@
 
 #if !HAVE_FEATURE_DESKTOP
 
-// Functions to be implemented by the upper/medium layers on
-// non-desktop touch-based platforms, with the same API on each such
-// platform. Note that these are just declared here in this header in
-// the "touch" module, the per-platform implementations are elsewhere.
+// 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" {
@@ -26,6 +28,11 @@ extern "C" {
 void lo_show_keyboard();
 void lo_hide_keyboard();
 
+// Functions to be implemented in the medium platform-specific layer
+// to be called from the app-specific UI layer.
+
+void lo_keyboard_did_hide();
+
 #ifdef __cplusplus
 }
 #endif
commit 7f93d63ae26a8b2fbf0b9044a5c4e5abba4f86fd
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sat Apr 13 13:01:44 2013 +0300

    Add some more files for easy breakpointing
    
    Change-Id: Ib68928d7213a7dbba830b20c882ba53c6f3deb4c

diff --git a/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj b/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
index 925e076..eb1d1f3 100644
--- a/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
+++ b/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
@@ -77,6 +77,10 @@
 		BEBF3E3D17002D6900C454AC /* window.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = window.cxx; path = ../../../../vcl/source/window/window.cxx; sourceTree = "<group>"; };
 		BEBF3E3E17005E6B00C454AC /* frmload.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = frmload.cxx; path = ../../../../sfx2/source/view/frmload.cxx; sourceTree = "<group>"; };
 		BECB749617181C92001BEB85 /* crsrsh.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crsrsh.cxx; path = ../../../../sw/source/core/crsr/crsrsh.cxx; sourceTree = "<group>"; };
+		BECB749917185F48001BEB85 /* view.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view.cxx; path = ../../../../sw/source/ui/uiview/view.cxx; sourceTree = "<group>"; };
+		BECB749A17185F48001BEB85 /* view0.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view0.cxx; path = ../../../../sw/source/ui/uiview/view0.cxx; sourceTree = "<group>"; };
+		BECB749B17185F48001BEB85 /* view1.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view1.cxx; path = ../../../../sw/source/ui/uiview/view1.cxx; sourceTree = "<group>"; };
+		BECB749C17185F48001BEB85 /* view2.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view2.cxx; path = ../../../../sw/source/ui/uiview/view2.cxx; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -266,6 +270,10 @@
 			isa = PBXGroup;
 			children = (
 				BECB749617181C92001BEB85 /* crsrsh.cxx */,
+				BECB749917185F48001BEB85 /* view.cxx */,
+				BECB749A17185F48001BEB85 /* view0.cxx */,
+				BECB749B17185F48001BEB85 /* view1.cxx */,
+				BECB749C17185F48001BEB85 /* view2.cxx */,
 			);
 			name = sw;
 			sourceTree = "<group>";


More information about the Libreoffice-commits mailing list