Android: Fix namespace usage
This change makes it possible to set a Qt namespace for Android builds. Change-Id: I79f4ae8200223f36f97e2849aae49e45b8850d23 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
parent
3251429813
commit
8f96ce3733
@ -153,6 +153,8 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/)
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QList<QByteArray> QSslSocketPrivate::fetchSslCertificateData()
|
||||
{
|
||||
QList<QByteArray> certificateData;
|
||||
@ -177,3 +179,5 @@ QList<QByteArray> QSslSocketPrivate::fetchSslCertificateData()
|
||||
|
||||
return certificateData;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -55,6 +55,8 @@ static const char m_qtTag[] = "Qt A11Y";
|
||||
static const char m_classErrorMsg[] = "Can't find class \"%s\"";
|
||||
static const char m_methodErrorMsg[] = "Can't find method \"%s%s\"";
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtAndroidAccessibility
|
||||
{
|
||||
static jmethodID m_addActionMethodID = 0;
|
||||
@ -290,3 +292,5 @@ if (!clazz) { \
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -42,10 +42,15 @@
|
||||
#ifndef ANDROIDJNIACCESSIBILITY_H
|
||||
#define ANDROIDJNIACCESSIBILITY_H
|
||||
#include <jni.h>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtAndroidAccessibility
|
||||
{
|
||||
bool registerNatives(JNIEnv *env);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDJNIINPUT_H
|
||||
|
@ -42,6 +42,8 @@
|
||||
#include "androidjniclipboard.h"
|
||||
#include "androidjnimain.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QtAndroid;
|
||||
namespace QtAndroidClipboard
|
||||
{
|
||||
@ -118,3 +120,5 @@ namespace QtAndroidClipboard
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -45,6 +45,8 @@
|
||||
#include <jni.h>
|
||||
#include <QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformClipboard;
|
||||
namespace QtAndroidClipboard
|
||||
{
|
||||
@ -58,4 +60,6 @@ namespace QtAndroidClipboard
|
||||
bool registerNatives(JNIEnv *env);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDJNICLIPBOARD_H
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QtAndroid;
|
||||
|
||||
namespace QtAndroidInput
|
||||
@ -758,3 +760,5 @@ namespace QtAndroidInput
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -42,6 +42,9 @@
|
||||
#ifndef ANDROIDJNIINPUT_H
|
||||
#define ANDROIDJNIINPUT_H
|
||||
#include <jni.h>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtAndroidInput
|
||||
{
|
||||
@ -56,4 +59,6 @@ namespace QtAndroidInput
|
||||
bool registerNatives(JNIEnv *env);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDJNIINPUT_H
|
||||
|
@ -76,6 +76,8 @@
|
||||
|
||||
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static JavaVM *m_javaVM = NULL;
|
||||
static jclass m_applicationClass = NULL;
|
||||
static jobject m_classLoaderObject = NULL;
|
||||
@ -748,8 +750,11 @@ static int registerNatives(JNIEnv *env)
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/)
|
||||
{
|
||||
QT_USE_NAMESPACE
|
||||
typedef union {
|
||||
JNIEnv *nativeEnvironment;
|
||||
void *venv;
|
||||
|
@ -50,6 +50,8 @@
|
||||
|
||||
#include <QImage>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QRect;
|
||||
class QPoint;
|
||||
class QThread;
|
||||
@ -119,4 +121,7 @@ namespace QtAndroid
|
||||
|
||||
QString deviceName();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROID_APP_H
|
||||
|
@ -50,6 +50,8 @@
|
||||
#include <QQueue>
|
||||
#include <QWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QtAndroid;
|
||||
|
||||
namespace QtAndroidMenu
|
||||
@ -428,3 +430,5 @@ namespace QtAndroidMenu
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -43,6 +43,9 @@
|
||||
#define ANDROIDJNIMENU_H
|
||||
|
||||
#include <jni.h>
|
||||
#include <qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformMenuBar;
|
||||
class QAndroidPlatformMenu;
|
||||
@ -66,4 +69,6 @@ namespace QtAndroidMenu
|
||||
bool registerNatives(JNIEnv *env);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDJNIMENU_H
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <QMutex>
|
||||
#include <jni.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class AndroidSurfaceClient
|
||||
{
|
||||
public:
|
||||
@ -55,4 +57,6 @@ protected:
|
||||
QMutex m_surfaceMutex;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDSURFACECLIENT_H
|
||||
|
@ -45,6 +45,8 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QVector>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
typedef QVector<QString> FilesList;
|
||||
|
||||
struct AndroidAssetDir
|
||||
@ -394,3 +396,5 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
#include <android/asset_manager.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
struct AndroidAssetDir;
|
||||
class AndroidAssetsFileEngineHandler: public QAbstractFileEngineHandler
|
||||
{
|
||||
@ -67,4 +69,6 @@ private:
|
||||
mutable bool m_hasTriedPrepopulatingCache;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDASSETSFILEENGINEHANDLER_H
|
||||
|
@ -47,6 +47,8 @@
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformtheme.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtAndroidDialogHelpers {
|
||||
static jclass g_messageDialogHelperClass = 0;
|
||||
|
||||
@ -172,3 +174,5 @@ bool registerNatives(JNIEnv *env)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include <QEventLoop>
|
||||
#include <private/qjni_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtAndroidDialogHelpers {
|
||||
|
||||
class QAndroidPlatformMessageDialogHelper: public QPlatformMessageDialogHelper
|
||||
@ -74,4 +76,6 @@ bool registerNatives(JNIEnv *env);
|
||||
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMDIALOGHELPERS_H
|
||||
|
@ -43,6 +43,8 @@
|
||||
|
||||
#include "qandroidplatformfontdatabase.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QString QAndroidPlatformFontDatabase::fontDir() const
|
||||
{
|
||||
return QLatin1String("/system/fonts");
|
||||
@ -87,3 +89,5 @@ QStringList QAndroidPlatformFontDatabase::fallbacksForFamily(const QString &fami
|
||||
|
||||
return QString(qgetenv("QT_ANDROID_FONTS")).split(";") + m_fallbacks[script];
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -44,6 +44,8 @@
|
||||
|
||||
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformFontDatabase: public QBasicFontDatabase
|
||||
{
|
||||
public:
|
||||
@ -58,4 +60,6 @@ private:
|
||||
QHash<QChar::Script, QStringList> m_fallbacks;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMFONTDATABASE_H
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include "qandroidplatformmenuitem.h"
|
||||
#include "androidjnimenu.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QAndroidPlatformMenu::QAndroidPlatformMenu()
|
||||
{
|
||||
m_tag = reinterpret_cast<quintptr>(this); // QMenu will overwrite this later, but we need a unique ID for QtQuick
|
||||
@ -175,3 +177,5 @@ QMutex *QAndroidPlatformMenu::menuItemsMutex()
|
||||
{
|
||||
return &m_menuItemsMutex;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include <qvector.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformMenuItem;
|
||||
class QAndroidPlatformMenu: public QPlatformMenu
|
||||
{
|
||||
@ -89,4 +91,6 @@ private:
|
||||
QMutex m_menuItemsMutex;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMMENU_H
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "qandroidplatformmenu.h"
|
||||
#include "androidjnimenu.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QAndroidPlatformMenuBar::QAndroidPlatformMenuBar()
|
||||
{
|
||||
@ -109,3 +110,5 @@ QMutex *QAndroidPlatformMenuBar::menusListMutex()
|
||||
{
|
||||
return &m_menusListMutex;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include <qvector.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformMenu;
|
||||
class QAndroidPlatformMenuBar: public QPlatformMenuBar
|
||||
{
|
||||
@ -71,4 +73,6 @@ private:
|
||||
QMutex m_menusListMutex;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMMENUBAR_H
|
||||
|
@ -42,6 +42,8 @@
|
||||
#include "qandroidplatformmenuitem.h"
|
||||
#include "qandroidplatformmenu.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QAndroidPlatformMenuItem::QAndroidPlatformMenuItem()
|
||||
{
|
||||
m_tag = reinterpret_cast<quintptr>(this); // QMenu will overwrite this later, but we need a unique ID for QtQuick
|
||||
@ -178,3 +180,5 @@ bool QAndroidPlatformMenuItem::isEnabled() const
|
||||
{
|
||||
return m_isEnabled;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -43,6 +43,8 @@
|
||||
#define QANDROIDPLATFORMMENUITEM_H
|
||||
#include <qpa/qplatformmenu.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformMenu;
|
||||
|
||||
class QAndroidPlatformMenuItem: public QPlatformMenuItem
|
||||
@ -96,4 +98,6 @@ private:
|
||||
bool m_isEnabled;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMMENUITEM_H
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QAndroidPlatformServices::QAndroidPlatformServices()
|
||||
{
|
||||
QtAndroid::AttachedJNIEnv env;
|
||||
@ -77,3 +79,5 @@ QByteArray QAndroidPlatformServices::desktopEnvironment() const
|
||||
{
|
||||
return QByteArray("Android");
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include "androidjnimain.h"
|
||||
#include <jni.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformServices: public QPlatformServices
|
||||
{
|
||||
public:
|
||||
@ -58,4 +60,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // ANDROIDPLATFORMDESKTOPSERVICE_H
|
||||
|
@ -50,6 +50,8 @@
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qandroidplatformintegration.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QAndroidPlatformTheme::QAndroidPlatformTheme(QAndroidPlatformNativeInterface *androidPlatformNativeInterface)
|
||||
{
|
||||
m_androidPlatformNativeInterface = androidPlatformNativeInterface;
|
||||
@ -240,3 +242,5 @@ QPlatformDialogHelper *QAndroidPlatformTheme::createPlatformDialogHelper(QPlatfo
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -45,6 +45,8 @@
|
||||
#include <qpa/qplatformtheme.h>
|
||||
#include <QtGui/qpalette.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformNativeInterface;
|
||||
class QAndroidPlatformTheme: public QPlatformTheme
|
||||
{
|
||||
@ -66,4 +68,6 @@ private:
|
||||
QPalette m_defaultPalette;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANDROIDPLATFORMTHEME_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user