diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-01-14 12:38:04 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-01-27 17:23:04 +0200 |
commit | 4e60681c879a54cf5b34862a30e27c492ed36363 (patch) | |
tree | 01c7d46ae34a6596fa235eea915846b66e7e8670 /src/plugins/platforms/android/androidjniinput.cpp | |
parent | 407ce5c0afd905b38a7d82980a76ed834fc971eb (diff) |
Make QJniObject and QJniEnvironment public API
As part of Qt 6 restructring for the extras modules, this change exposes
the Jni APIs which are very important for Android platform. This patch
adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based
from private QtCore and QtAndroidExtras.
The Jni interface is cross-platform which justifies the name, but
currently, this API is used mainly for Android, and the naming comes
generic without Android keyword to avoid any future limitation on
supporting other platforms.
[ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and
QJniExceptionCleaner APIs.
Task-number: QTBUG-89482
Fixes: QTBUG-89633
Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/androidjniinput.cpp')
-rw-r--r-- | src/plugins/platforms/android/androidjniinput.cpp | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 5e4d271fcc..a72682dd23 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -49,7 +49,6 @@ #include <QPointer> #include <QGuiApplication> -#include <QDebug> #include <QtMath> QT_BEGIN_NAMESPACE @@ -71,27 +70,26 @@ namespace QtAndroidInput #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug() << ">>> UPDATESELECTION" << selStart << selEnd << candidatesStart << candidatesEnd; #endif - QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), - "updateSelection", - "(IIII)V", - selStart, - selEnd, - candidatesStart, - candidatesEnd); + QJniObject::callStaticMethod<void>(applicationClass(), + "updateSelection", + "(IIII)V", + selStart, + selEnd, + candidatesStart, + candidatesEnd); } void showSoftwareKeyboard(int left, int top, int width, int height, int inputHints, int enterKeyType) { - QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), - "showSoftwareKeyboard", - "(IIIIII)V", - left, - top, - width, - height, - inputHints, - enterKeyType - ); + QJniObject::callStaticMethod<void>(applicationClass(), + "showSoftwareKeyboard", + "(IIIIII)V", + left, + top, + width, + height, + inputHints, + enterKeyType); #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug() << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints << enterKeyType; #endif @@ -99,7 +97,7 @@ namespace QtAndroidInput void resetSoftwareKeyboard() { - QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "resetSoftwareKeyboard"); + QJniObject::callStaticMethod<void>(applicationClass(), "resetSoftwareKeyboard"); #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug("@@@ RESETSOFTWAREKEYBOARD"); #endif @@ -107,7 +105,7 @@ namespace QtAndroidInput void hideSoftwareKeyboard() { - QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "hideSoftwareKeyboard"); + QJniObject::callStaticMethod<void>(applicationClass(), "hideSoftwareKeyboard"); #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug("@@@ HIDESOFTWAREKEYBOARD"); #endif @@ -125,10 +123,10 @@ namespace QtAndroidInput void updateHandles(int mode, QPoint editMenuPos, uint32_t editButtons, QPoint cursor, QPoint anchor, bool rtl) { - QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "updateHandles", "(IIIIIIIIZ)V", - mode, editMenuPos.x(), editMenuPos.y(), editButtons, - cursor.x(), cursor.y(), - anchor.x(), anchor.y(), rtl); + QJniObject::callStaticMethod<void>(applicationClass(), "updateHandles", "(IIIIIIIIZ)V", + mode, editMenuPos.x(), editMenuPos.y(), editButtons, + cursor.x(), cursor.y(), + anchor.x(), anchor.y(), rtl); } static void mouseDown(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) |