JNI: Mark tech preview API as such
Retrofit the QT_TECH_PREVIEW_API macro into the JNI classes and helper constructs that are not yet documented, and which can only become publicly documented once the full JNI type system with the type registration infrastructure is documented. We can remove the tagging in dev once we have documentation and are ready to move this functionality out of TP, presumably for Qt 6.8. Pick-to: 6.7 Change-Id: I235e57b8e57c2d04be72b4c842131d99a5f83d9e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
parent
020a224a79
commit
5b41046813
@ -18,7 +18,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
template <typename T> class QJniArray;
|
||||
template <typename T>
|
||||
struct QJniArrayIterator
|
||||
struct QT_TECH_PREVIEW_API QJniArrayIterator
|
||||
{
|
||||
QJniArrayIterator() = default;
|
||||
|
||||
@ -86,7 +86,7 @@ private:
|
||||
{}
|
||||
};
|
||||
|
||||
class QJniArrayBase
|
||||
class QT_TECH_PREVIEW_API QJniArrayBase
|
||||
{
|
||||
// for SFINAE'ing out the fromContainer named constructor
|
||||
template <typename Container, typename = void> struct CanConvertHelper : std::false_type {};
|
||||
@ -193,7 +193,7 @@ private:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class QJniArray : public QJniArrayBase
|
||||
class QT_TECH_PREVIEW_API QJniArray : public QJniArrayBase
|
||||
{
|
||||
friend struct QJniArrayIterator<T>;
|
||||
public:
|
||||
|
@ -69,6 +69,7 @@ public:
|
||||
, std::enable_if_t<QtJniTypes::isObjectType<Class>(), bool> = true
|
||||
#endif
|
||||
>
|
||||
QT_TECH_PREVIEW_API
|
||||
bool registerNativeMethods(std::initializer_list<JNINativeMethod> methods)
|
||||
{
|
||||
return registerNativeMethods(QtJniTypes::Traits<Class>::className().data(), methods);
|
||||
|
@ -670,7 +670,7 @@ inline bool operator!=(const QJniObject &obj1, const QJniObject &obj2)
|
||||
}
|
||||
|
||||
namespace QtJniTypes {
|
||||
struct JObjectBase
|
||||
struct QT_TECH_PREVIEW_API JObjectBase
|
||||
{
|
||||
operator QJniObject() const { return m_object; }
|
||||
|
||||
@ -695,7 +695,7 @@ protected:
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
class JObject : public JObjectBase
|
||||
class QT_TECH_PREVIEW_API JObject : public JObjectBase
|
||||
{
|
||||
public:
|
||||
using Class = Type;
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_DECLARE_JNI_TYPE_HELPER(Type) \
|
||||
namespace QtJniTypes { \
|
||||
struct Type : JObject<Type> \
|
||||
@ -19,7 +20,7 @@ struct Type : JObject<Type> \
|
||||
}; \
|
||||
} \
|
||||
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_DECLARE_JNI_TYPE(Type, Signature) \
|
||||
Q_DECLARE_JNI_TYPE_HELPER(Type) \
|
||||
template<> \
|
||||
@ -35,6 +36,7 @@ struct QtJniTypes::Traits<QtJniTypes::Type> { \
|
||||
} \
|
||||
}; \
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_DECLARE_JNI_CLASS(Type, Signature) \
|
||||
Q_DECLARE_JNI_TYPE_HELPER(Type) \
|
||||
template<> \
|
||||
@ -176,7 +178,7 @@ va_##Method(JNIEnv *env, jclass thiz, ...)
|
||||
}, argTuple); \
|
||||
} \
|
||||
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_DECLARE_JNI_NATIVE_METHOD(...) \
|
||||
QT_OVERLOADED_MACRO(QT_DECLARE_JNI_NATIVE_METHOD, __VA_ARGS__) \
|
||||
|
||||
@ -194,8 +196,10 @@ static const JNINativeMethod Method##_method = { \
|
||||
#define QT_DECLARE_JNI_NATIVE_METHOD_1(Method) \
|
||||
QT_DECLARE_JNI_NATIVE_METHOD_2(Method, Method) \
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_JNI_NATIVE_METHOD(Method) QtJniMethods::Method##_method
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(...) \
|
||||
QT_OVERLOADED_MACRO(QT_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE, __VA_ARGS__) \
|
||||
|
||||
@ -209,6 +213,7 @@ static const JNINativeMethod Method##_method = { \
|
||||
#define QT_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE_1(Method) \
|
||||
QT_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE_2(Method, Method) \
|
||||
|
||||
// QT_TECH_PREVIEW_API
|
||||
#define Q_JNI_NATIVE_SCOPED_METHOD(Method, Scope) Scope::Method##_method
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
x
Reference in New Issue
Block a user