[Libreoffice-commits] core.git: 3 commits - ios/experimental sw/source touch/inc touch/Package_inc.mk vcl/android

Tor Lillqvist tml at iki.fi
Fri Apr 12 05:23:14 PDT 2013


 ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj |   30 ++++++--
 ios/experimental/LibreOffice/LibreOffice/AppDelegate.m             |   15 ++++
 ios/experimental/LibreOffice/LibreOffice/View.h                    |    2 
 ios/experimental/LibreOffice/LibreOffice/View.m                    |   23 ++++++
 sw/source/core/crsr/crsrsh.cxx                                     |   10 ++
 touch/Package_inc.mk                                               |    1 
 touch/inc/touch/touch.h                                            |   37 ++++++++++
 vcl/android/androidinst.cxx                                        |   20 ++++-
 8 files changed, 128 insertions(+), 10 deletions(-)

New commits:
commit a6e1f214c9c8c338da7cd216884e45e234e64669
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Apr 12 15:06:03 2013 +0300

    Start implementing on-demand keyboard display for non-DESKTOP
    
    Change-Id: I9321dcf9d863cb59eee9b2a012d887a17cb1b454

diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
index 2f74d48..3a70fa3 100644
--- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
+++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
@@ -9,6 +9,7 @@
 #import <UIKit/UIKit.h>
 
 #include <osl/detail/ios-bootstrap.h>
+#include <touch/touch.h>
 
 #import "AppDelegate.h"
 #import "ViewController.h"
@@ -100,4 +101,18 @@ void lo_damaged(CGRect rect)
     // NSLog(@"lo_damaged: %dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y);
 }
 
+void lo_show_keyboard()
+{
+    dispatch_async(dispatch_get_main_queue(), ^{
+            [theView becomeFirstResponder];
+        });
+}
+
+void lo_hide_keyboard()
+{
+    dispatch_async(dispatch_get_main_queue(), ^{
+            [theView resignFirstResponder];
+        });
+}
+
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/experimental/LibreOffice/LibreOffice/View.h b/ios/experimental/LibreOffice/LibreOffice/View.h
index c128806..a50b8f3 100644
--- a/ios/experimental/LibreOffice/LibreOffice/View.h
+++ b/ios/experimental/LibreOffice/LibreOffice/View.h
@@ -9,7 +9,7 @@
 
 #import <UIKit/UIKit.h>
 
- at interface View : UIView
+ at interface View : UIView <UIKeyInput>
 
 - (void)drawRect:(CGRect)rect;
 - (void)tapGesture:(UIGestureRecognizer *)gestureRecognizer;
diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m
index abc057e..43edc2f 100644
--- a/ios/experimental/LibreOffice/LibreOffice/View.m
+++ b/ios/experimental/LibreOffice/LibreOffice/View.m
@@ -38,6 +38,29 @@
         NSLog(@"tapGesture: %@", gestureRecognizer);
 }
 
+- (void)insertText:(NSString *)text
+{
+    (void) text;
+    // Do something with the typed character
+}
+
+- (void)deleteBackward
+{
+    // Handle the delete key
+}
+
+- (BOOL)hasText
+{
+    // Return whether there's any text present
+    return YES;
+}
+
+- (BOOL)canBecomeFirstResponder
+{
+    return YES;
+}
+
+
 @end
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index d5999cd..fe0e61f 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -17,6 +17,8 @@
  *   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>
@@ -62,6 +64,8 @@
 
 #include <comcore.hrc>
 
+#include <touch/touch.h>
+
 using namespace com::sun::star;
 using namespace util;
 
@@ -2000,6 +2004,9 @@ void SwCrsrShell::ShowCrsr()
     {
         m_bSVCrsrVis = sal_True;
         UpdateCrsr();
+#if !HAVE_FEATURE_DESKTOP
+        lo_show_keyboard();
+#endif
     }
 }
 
@@ -2012,6 +2019,9 @@ void SwCrsrShell::HideCrsr()
         // possibly reverse selected areas!!
         SET_CURR_SHELL( this );
         m_pVisCrsr->Hide();
+#if !HAVE_FEATURE_DESKTOP
+        lo_hide_keyboard();
+#endif
     }
 }
 
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index cd0390b..563769c 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -26,16 +26,20 @@
  * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
  * instead of those above.
  */
-#include <android/androidinst.hxx>
-#include <headless/svpdummies.hxx>
-#include <generic/gendata.hxx>
+
 #include <jni.h>
+
 #include <android/log.h>
 #include <android/looper.h>
 #include <android/bitmap.h>
+
+#include <android/androidinst.hxx>
+#include <headless/svpdummies.hxx>
+#include <generic/gendata.hxx>
 #include <osl/detail/android-bootstrap.h>
 #include <rtl/strbuf.hxx>
 #include <basebmp/scanlineformats.hxx>
+#include <touch/touch.h>
 
 #define LOGTAG "LibreOffice/androidinst"
 #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__))
@@ -554,4 +558,14 @@ Java_org_libreoffice_experimental_desktop_Desktop_scroll(JNIEnv * /* env */,
         LOGW("No focused frame to emit event on");
 }
 
+extern "C" void
+lo_show_keyboard()
+{
+}
+
+extern "C" void
+lo_hide_keyboard()
+{
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 80004068611191107c0f44cc5d3b29181b1ad157
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Apr 12 15:03:59 2013 +0300

    Add one more file for easy breakpointing and re-structure list a bit
    
    Change-Id: If37b5e646562357c4c6c9ce0a3821d92bbfc07f9

diff --git a/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj b/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
index 2e94d03..925e076 100644
--- a/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
+++ b/ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj
@@ -76,6 +76,7 @@
 		BEBF3E3C17002D4C00C454AC /* frame.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = frame.cxx; path = ../../../../framework/source/services/frame.cxx; sourceTree = "<group>"; };
 		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>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -194,8 +195,7 @@
 		BE5A225F1664F87600CF01C9 /* LibreOffice */ = {
 			isa = PBXGroup;
 			children = (
-				BE5A22681664F87600CF01C9 /* AppDelegate.h */,
-				BE5A22691664F87600CF01C9 /* AppDelegate.m */,
+				BECB749817182B8B001BEB85 /* LibreOffice */,
 				BE5C525A170EB9D000F33F89 /* bridges */,
 				BE2F0A1017077B560060FE0D /* basebmp */,
 				BE2F0A0B17077A0F0060FE0D /* cppuhelper */,
@@ -203,12 +203,9 @@
 				BE56CD651704A08E00CA5B15 /* lo.h */,
 				BE56CD661704A08E00CA5B15 /* lo.mm */,
 				BE2F0A0F17077B060060FE0D /* sfx2 */,
+				BECB749717182B5F001BEB85 /* sw */,
 				BE2F0A11170780620060FE0D /* unoidl */,
 				BE2F0A0D17077A950060FE0D /* vcl */,
-				BE08805B16FDB784000CED5C /* View.h */,
-				BE08805C16FDB784000CED5C /* View.m */,
-				BE7B7AFF170438D0002341F4 /* ViewController.h */,
-				BE7B7B00170438D0002341F4 /* ViewController.m */,
 				BE69AD3716958CA0001BE1CD /* Resources */,
 				BE5A22601664F87600CF01C9 /* Supporting Files */,
 			);
@@ -265,6 +262,27 @@
 			name = coretext;
 			sourceTree = "<group>";
 		};
+		BECB749717182B5F001BEB85 /* sw */ = {
+			isa = PBXGroup;
+			children = (
+				BECB749617181C92001BEB85 /* crsrsh.cxx */,
+			);
+			name = sw;
+			sourceTree = "<group>";
+		};
+		BECB749817182B8B001BEB85 /* LibreOffice */ = {
+			isa = PBXGroup;
+			children = (
+				BE5A22681664F87600CF01C9 /* AppDelegate.h */,
+				BE5A22691664F87600CF01C9 /* AppDelegate.m */,
+				BE08805B16FDB784000CED5C /* View.h */,
+				BE08805C16FDB784000CED5C /* View.m */,
+				BE7B7AFF170438D0002341F4 /* ViewController.h */,
+				BE7B7B00170438D0002341F4 /* ViewController.m */,
+			);
+			name = LibreOffice;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
commit 3f4a63c9dda93fe95f44a51f28c89057343a8369
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Apr 12 15:02:00 2013 +0300

    Add new <touch/touch.h> header
    
    Change-Id: I25016b17356e0b3732f324f4edb748660cd110fd

diff --git a/touch/Package_inc.mk b/touch/Package_inc.mk
index c7c393d..d55ab5d 100644
--- a/touch/Package_inc.mk
+++ b/touch/Package_inc.mk
@@ -8,6 +8,7 @@
 
 $(eval $(call gb_Package_Package,touch_inc,$(SRCDIR)/touch/inc))
 
+$(eval $(call gb_Package_add_file,touch_inc,inc/touch/touch.h,touch/touch.h))
 $(eval $(call gb_Package_add_file,touch_inc,inc/touch/libotouch.hxx,touch/libotouch.hxx))
 
 # vim: set noet sw=4 ts=4:
diff --git a/touch/inc/touch/touch.h b/touch/inc/touch/touch.h
new file mode 100644
index 0000000..87fe985
--- /dev/null
+++ b/touch/inc/touch/touch.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright 2013 LibreOffice contributors.
+ *
+ * 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_H
+#define INCLUDED_TOUCH_TOUCH_H
+
+#include <config_features.h>
+
+#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.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void lo_show_keyboard();
+void lo_hide_keyboard();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // HAVE_FEATURE_DESKTOP
+
+#endif // INCLUDED_TOUCH_TOUCH_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list