зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1285554 - Remove remnants of widget/qt. r=dougt,mshal.
Because bug 1282866 removed Qt support but missed a bunch of things. * * * Bug 1285554 - more --HG-- extra : rebase_source : c48d2485f1fdf1c961e08d91651bbca41e3a1a53
This commit is contained in:
Родитель
0fa260063e
Коммит
a913f99107
|
@ -75,7 +75,7 @@
|
|||
accesskey="&emailPageCmd.accesskey;"
|
||||
command="Browser:SendLink"/>
|
||||
<menuseparator/>
|
||||
#if !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_QT)
|
||||
#if !defined(MOZ_WIDGET_GTK)
|
||||
<menuitem id="menu_printSetup"
|
||||
label="&printSetupCmd.label;"
|
||||
accesskey="&printSetupCmd.accesskey;"
|
||||
|
|
|
@ -273,7 +273,7 @@ toolbar[customizing] > .overflow-button {
|
|||
}
|
||||
%endif
|
||||
|
||||
%if !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_QT)
|
||||
%if !defined(MOZ_WIDGET_GTK)
|
||||
#TabsToolbar > .private-browsing-indicator {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
|
|
|
@ -563,7 +563,7 @@
|
|||
#ifdef MENUBAR_CAN_AUTOHIDE
|
||||
toolbarname="&menubarCmd.label;"
|
||||
accesskey="&menubarCmd.accesskey;"
|
||||
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
autohide="true"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -592,7 +592,7 @@
|
|||
context="toolbar-context-menu"
|
||||
collapsed="true">
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
<hbox id="private-browsing-indicator"
|
||||
skipintoolbarset="true"/>
|
||||
#endif
|
||||
|
@ -642,7 +642,7 @@
|
|||
</menupopup>
|
||||
</toolbarbutton>
|
||||
|
||||
#if !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_QT)
|
||||
#if !defined(MOZ_WIDGET_GTK)
|
||||
<hbox class="private-browsing-indicator" skipintoolbarset="true"/>
|
||||
#endif
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
|
|
|
@ -8,7 +8,7 @@ toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
|
|||
|
||||
if toolkit == 'cocoa':
|
||||
DIRS += ['osx']
|
||||
elif toolkit in ('gtk2', 'gtk3', 'qt'):
|
||||
elif toolkit in ('gtk2', 'gtk3'):
|
||||
DIRS += ['linux']
|
||||
else:
|
||||
DIRS += ['windows']
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
.geo-icon {
|
||||
%ifdef XP_MACOSX
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-osx);
|
||||
%elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
%elif defined(MOZ_WIDGET_GTK)
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-linux);
|
||||
%else
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-windows);
|
||||
|
@ -101,7 +101,7 @@
|
|||
.geo-icon.blocked {
|
||||
%ifdef XP_MACOSX
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-osx-blocked);
|
||||
%elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
%elif defined(MOZ_WIDGET_GTK)
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-linux-blocked);
|
||||
%else
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-windows-blocked);
|
||||
|
@ -111,7 +111,7 @@
|
|||
.popup-notification-icon[popupid="geolocation"] {
|
||||
%ifdef XP_MACOSX
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-osx);
|
||||
%elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
%elif defined(MOZ_WIDGET_GTK)
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-linux-detailed);
|
||||
%else
|
||||
list-style-image: url(chrome://browser/skin/permissions.svg#geo-windows-detailed);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
%filter substitution
|
||||
%ifdef XP_MACOSX
|
||||
%include ../osx/shared.inc
|
||||
%elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
%elif defined(MOZ_WIDGET_GTK)
|
||||
%include ../linux/linuxShared.inc
|
||||
%else
|
||||
%include ../windows/windowsShared.inc
|
||||
|
|
До Ширина: | Высота: | Размер: 1.3 KiB После Ширина: | Высота: | Размер: 1.3 KiB |
|
@ -311,6 +311,7 @@ PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
|
|||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
|
||||
typedef void (*GObjectDisposeFn)(GObject*);
|
||||
typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
|
||||
typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
* 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/. */
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include <QString>
|
||||
#include <QtCore/QLocale>
|
||||
#endif
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsILocale.h"
|
||||
#include "nsILocaleService.h"
|
||||
|
@ -122,12 +117,8 @@ nsLocaleService::nsLocaleService(void)
|
|||
RefPtr<nsLocale> resultLocale(new nsLocale());
|
||||
NS_ENSURE_TRUE_VOID(resultLocale);
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
const char* lang = QLocale::system().name().toUtf8();
|
||||
#else
|
||||
// Get system configuration
|
||||
const char* lang = getenv("LANG");
|
||||
#endif
|
||||
|
||||
nsAutoString xpLocale, platformLocale;
|
||||
nsAutoString category, category_platform;
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
#if defined(MOZ_WIDGET_GTK)
|
||||
#include "base/message_pump_glib.h"
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include "base/message_pump_qt.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef ANDROID
|
||||
#include "base/message_pump_android.h"
|
||||
|
|
|
@ -2054,7 +2054,7 @@ nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont)
|
|||
|
||||
bool usePlatformFontList = true;
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
usePlatformFontList = gfxPlatformGtk::UseFcFontList();
|
||||
usePlatformFontList = gfxPlatformGtk::UseFcFontList();
|
||||
#endif
|
||||
|
||||
// xxx - until the Linux platform font list is always used, use full
|
||||
|
|
|
@ -131,11 +131,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
|||
'freetype',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
|
||||
OS_LIBS += CONFIG['XLIBS']
|
||||
OS_LIBS += CONFIG['TK_LIBS']
|
||||
OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
|
||||
|
||||
if CONFIG['OS_TARGET'] in ('Linux', 'DragonFly', 'FreeBSD', 'NetBSD',
|
||||
'OpenBSD'):
|
||||
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
|
||||
|
|
|
@ -1763,7 +1763,6 @@ if test -n "$MOZ_X11"; then
|
|||
AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
|
||||
[MISSING_X="$MISSING_X -lXext"], $XLIBS)
|
||||
|
||||
if test "$MOZ_WIDGET_TOOLKIT" != qt; then
|
||||
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
|
||||
unset ac_cv_lib_Xt_XtFree
|
||||
AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
|
||||
|
@ -1771,7 +1770,6 @@ if test -n "$MOZ_X11"; then
|
|||
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
|
||||
[MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
|
||||
])
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Check for XShm
|
||||
|
@ -5968,9 +5966,6 @@ if test "$MOZ_TREE_CAIRO"; then
|
|||
fi
|
||||
|
||||
case "$MOZ_WIDGET_TOOLKIT" in
|
||||
qt)
|
||||
QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
|
||||
;;
|
||||
cocoa | uikit)
|
||||
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
|
||||
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_XUL'] and \
|
||||
CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android', 'qt', 'cocoa', 'windows'):
|
||||
CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android', 'cocoa', 'windows'):
|
||||
XPIDL_MODULE = 'filepicker'
|
||||
XPIDL_SOURCES += [
|
||||
'nsIFileView.idl',
|
||||
|
|
|
@ -18,10 +18,6 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
|||
SOURCES += [
|
||||
'nsGTKRemoteService.cpp',
|
||||
]
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
|
||||
SOURCES += [
|
||||
'nsQtRemoteService.cpp',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
|
|
|
@ -1,142 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:expandtab:shiftwidth=2:tabstop=8:
|
||||
*/
|
||||
/* 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/. */
|
||||
#include <QWindow>
|
||||
#include "nsQtRemoteService.h"
|
||||
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
#include "mozilla/X11Util.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIAppShellService.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
/**
|
||||
Helper class which is used to receive notification about property changes
|
||||
*/
|
||||
class MozQRemoteEventHandlerWidget: public QWindow {
|
||||
public:
|
||||
/**
|
||||
Constructor
|
||||
@param aRemoteService remote service, which is notified about atom change
|
||||
*/
|
||||
MozQRemoteEventHandlerWidget(nsQtRemoteService &aRemoteService);
|
||||
virtual ~MozQRemoteEventHandlerWidget() {}
|
||||
|
||||
protected:
|
||||
/**
|
||||
Event filter, which receives all XEvents
|
||||
@return false which continues event handling
|
||||
*/
|
||||
bool x11Event(XEvent *);
|
||||
|
||||
private:
|
||||
/**
|
||||
Service which is notified about property change
|
||||
*/
|
||||
nsQtRemoteService &mRemoteService;
|
||||
};
|
||||
|
||||
MozQRemoteEventHandlerWidget::MozQRemoteEventHandlerWidget(nsQtRemoteService &aRemoteService)
|
||||
:mRemoteService(aRemoteService)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
MozQRemoteEventHandlerWidget::x11Event(XEvent *aEvt)
|
||||
{
|
||||
if (aEvt->type == PropertyNotify && aEvt->xproperty.state == PropertyNewValue)
|
||||
mRemoteService.PropertyNotifyEvent(aEvt);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsQtRemoteService,
|
||||
nsIRemoteService,
|
||||
nsIObserver)
|
||||
|
||||
nsQtRemoteService::nsQtRemoteService():
|
||||
mServerWindow(0)
|
||||
{
|
||||
}
|
||||
|
||||
nsQtRemoteService::~nsQtRemoteService()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsQtRemoteService::Startup(const char* aAppName, const char* aProfileName)
|
||||
{
|
||||
if (mServerWindow) return NS_ERROR_ALREADY_INITIALIZED;
|
||||
NS_ASSERTION(aAppName, "Don't pass a null appname!");
|
||||
|
||||
XRemoteBaseStartup(aAppName,aProfileName);
|
||||
|
||||
//Create window, which is not shown.
|
||||
mServerWindow = new MozQRemoteEventHandlerWidget(*this);
|
||||
|
||||
HandleCommandsFor(mServerWindow->winId());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsQtRemoteService::RegisterWindow(nsIDOMWindow* aWindow)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsQtRemoteService::Shutdown()
|
||||
{
|
||||
if (!mServerWindow)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
delete mServerWindow;
|
||||
mServerWindow = nullptr;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsQtRemoteService::PropertyNotifyEvent(XEvent *aEvt)
|
||||
{
|
||||
HandleNewProperty(aEvt->xproperty.window,
|
||||
mozilla::DefaultXDisplay(),
|
||||
aEvt->xproperty.time,
|
||||
aEvt->xproperty.atom,
|
||||
0);
|
||||
}
|
||||
|
||||
void
|
||||
nsQtRemoteService::SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
|
||||
uint32_t aTimestamp)
|
||||
{
|
||||
}
|
||||
|
||||
// {C0773E90-5799-4eff-AD03-3EBCD85624AC}
|
||||
#define NS_REMOTESERVICE_CID \
|
||||
{ 0xc0773e90, 0x5799, 0x4eff, { 0xad, 0x3, 0x3e, 0xbc, 0xd8, 0x56, 0x24, 0xac } }
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsQtRemoteService)
|
||||
NS_DEFINE_NAMED_CID(NS_REMOTESERVICE_CID);
|
||||
|
||||
static const mozilla::Module::CIDEntry kRemoteCIDs[] = {
|
||||
{ &kNS_REMOTESERVICE_CID, false, nullptr, nsQtRemoteServiceConstructor },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module::ContractIDEntry kRemoteContracts[] = {
|
||||
{ "@mozilla.org/toolkit/remote-service;1", &kNS_REMOTESERVICE_CID },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module kRemoteModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kRemoteCIDs,
|
||||
kRemoteContracts
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(RemoteServiceModule) = &kRemoteModule;
|
|
@ -1,37 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
||||
*/
|
||||
/* 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 __nsQtRemoteService_h__
|
||||
#define __nsQtRemoteService_h__
|
||||
|
||||
#include "nsXRemoteService.h"
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
class RemoteEventHandlerWidget;
|
||||
|
||||
class nsQtRemoteService : public nsXRemoteService
|
||||
{
|
||||
public:
|
||||
// We will be a static singleton, so don't use the ordinary methods.
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIREMOTESERVICE
|
||||
|
||||
nsQtRemoteService();
|
||||
|
||||
private:
|
||||
virtual ~nsQtRemoteService();
|
||||
|
||||
virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
|
||||
uint32_t aTimestamp) override;
|
||||
|
||||
void PropertyNotifyEvent(XEvent *evt);
|
||||
friend class MozQRemoteEventHandlerWidget;
|
||||
|
||||
QWindow *mServerWindow;
|
||||
};
|
||||
|
||||
#endif // __nsQtRemoteService_h__
|
|
@ -150,8 +150,6 @@ this.AppConstants = Object.freeze({
|
|||
platform:
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
"linux",
|
||||
#elif MOZ_WIDGET_QT
|
||||
"linux",
|
||||
#elif XP_WIN
|
||||
"win",
|
||||
#elif XP_MACOSX
|
||||
|
|
|
@ -39,7 +39,7 @@ if CONFIG['MOZ_MAINTENANCE_SERVICE']:
|
|||
|
||||
DIRS += ['xre']
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'qt'):
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
||||
DIRS += ['system/unixproxy']
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
DIRS += ['system/osxproxy']
|
||||
|
|
|
@ -21,7 +21,7 @@ app = CONFIG['MOZ_BUILD_APP']
|
|||
|
||||
if toolkit == 'cocoa':
|
||||
DIRS += ['osx']
|
||||
elif toolkit in ('gtk2', 'gtk3', 'qt'):
|
||||
elif toolkit in ('gtk2', 'gtk3'):
|
||||
DIRS += ['linux']
|
||||
elif app == 'mobile/android':
|
||||
DIRS += ['mobile']
|
||||
|
|
|
@ -44,13 +44,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
|
|||
'nsNativeAppSupportDefault.cpp',
|
||||
'UIKitDirProvider.mm',
|
||||
]
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
|
||||
EXPORTS += ['nsQAppInstance.h']
|
||||
SOURCES += [
|
||||
'!moc_nsNativeAppSupportQt.cpp',
|
||||
'nsNativeAppSupportQt.cpp',
|
||||
'nsQAppInstance.cpp',
|
||||
]
|
||||
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
||||
UNIFIED_SOURCES += [
|
||||
'nsNativeAppSupportUnix.cpp',
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
* 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/. */
|
||||
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
#include <QGuiApplication>
|
||||
#include <QStringList>
|
||||
#include "nsQAppInstance.h"
|
||||
#endif // MOZ_WIDGET_QT
|
||||
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||
|
@ -237,11 +231,6 @@ bool gIsGtest = false;
|
|||
|
||||
nsString gAbsoluteArgv0Path;
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
static int gQtOnlyArgc;
|
||||
static char **gQtOnlyArgv;
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
#include <glib.h>
|
||||
#if defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING)
|
||||
|
@ -1724,14 +1713,8 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative,
|
|||
#endif
|
||||
|
||||
if (aBlankCommandLine) {
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
// Remove only arguments not given to Qt
|
||||
gRestartArgc = gQtOnlyArgc;
|
||||
gRestartArgv = gQtOnlyArgv;
|
||||
#else
|
||||
gRestartArgc = 1;
|
||||
gRestartArgv[gRestartArgc] = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
SaveToEnv("MOZ_LAUNCHED_CHILD=1");
|
||||
|
@ -3581,25 +3564,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
nsQAppInstance::AddRef(gArgc, gArgv, true);
|
||||
|
||||
QStringList nonQtArguments = qApp->arguments();
|
||||
gQtOnlyArgc = 1;
|
||||
gQtOnlyArgv = (char**) malloc(sizeof(char*)
|
||||
* (gRestartArgc - nonQtArguments.size() + 2));
|
||||
|
||||
// copy binary path
|
||||
gQtOnlyArgv[0] = gRestartArgv[0];
|
||||
|
||||
for (int i = 1; i < gRestartArgc; ++i) {
|
||||
if (!nonQtArguments.contains(gRestartArgv[i])) {
|
||||
// copy arguments used by Qt for later
|
||||
gQtOnlyArgv[gQtOnlyArgc++] = gRestartArgv[i];
|
||||
}
|
||||
}
|
||||
gQtOnlyArgv[gQtOnlyArgc] = nullptr;
|
||||
#endif
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
// setup for private colormap. Ideally we'd like to do this
|
||||
// in nsAppShell::Create, but we need to get in before gtk
|
||||
|
@ -4404,10 +4368,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
|||
mProfileLock->Unlock();
|
||||
gProfileLock = nullptr;
|
||||
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
nsQAppInstance::Release();
|
||||
#endif
|
||||
|
||||
// Restart the app after XPCOM has been shut down cleanly.
|
||||
if (appInitiatedRestart) {
|
||||
RestoreStateForAppInitiatedRestart();
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
#include "nsQAppInstance.h"
|
||||
#endif
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsXULAppAPI.h"
|
||||
|
@ -496,10 +492,6 @@ XRE_InitChildProcess(int aArgc,
|
|||
g_set_prgname(aArgv[0]);
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
nsQAppInstance::AddRef();
|
||||
#endif
|
||||
|
||||
#ifdef OS_POSIX
|
||||
if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
|
||||
PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
|
||||
|
|
|
@ -1,118 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <QTimer>
|
||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||
#include "nsNativeAppSupportQt.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||
void
|
||||
nsNativeAppSupportQt::activityChanged(MeeGo::QmActivity::Activity activity)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (!os)
|
||||
return;
|
||||
|
||||
if (MeeGo::QmActivity::Inactive == activity) {
|
||||
os->NotifyObservers(nullptr, "system-idle", nullptr);
|
||||
} else {
|
||||
os->NotifyObservers(nullptr, "system-active", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsNativeAppSupportQt::displayStateChanged(MeeGo::QmDisplayState::DisplayState state)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (!os)
|
||||
return;
|
||||
|
||||
switch (state) {
|
||||
case MeeGo::QmDisplayState::On:
|
||||
os->NotifyObservers(nullptr, "system-display-on", nullptr);
|
||||
break;
|
||||
case MeeGo::QmDisplayState::Off:
|
||||
os->NotifyObservers(nullptr, "system-display-off", nullptr);
|
||||
break;
|
||||
case MeeGo::QmDisplayState::Dimmed:
|
||||
os->NotifyObservers(nullptr, "system-display-dimmed", nullptr);
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("Unknown display state");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void nsNativeAppSupportQt::deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode mode)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (!os)
|
||||
return;
|
||||
|
||||
switch (mode) {
|
||||
case MeeGo::QmDeviceMode::DeviceMode::Normal:
|
||||
os->NotifyObservers(nullptr, "profile-change-net-restore", nullptr);
|
||||
break;
|
||||
case MeeGo::QmDeviceMode::DeviceMode::Flight:
|
||||
os->NotifyObservers(nullptr, "profile-change-net-teardown", nullptr);
|
||||
break;
|
||||
case MeeGo::QmDeviceMode::DeviceMode::Error:
|
||||
default:
|
||||
NS_WARNING("Unknown DeviceMode");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void nsNativeAppSupportQt::RefreshStates()
|
||||
{
|
||||
activityChanged(mActivity.get());
|
||||
displayStateChanged(mDisplayState.get());
|
||||
deviceModeChanged(mDeviceMode.getMode());
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeAppSupportQt::Start(bool* aRetVal)
|
||||
{
|
||||
NS_ASSERTION(gAppData, "gAppData must not be null.");
|
||||
|
||||
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||
connect(&mActivity, SIGNAL(activityChanged(MeeGo::QmActivity::Activity)), this, SLOT(activityChanged(MeeGo::QmActivity::Activity)));
|
||||
connect(&mDeviceMode, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this, SLOT(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
|
||||
connect(&mDisplayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(displayStateChanged(MeeGo::QmDisplayState::DisplayState)));
|
||||
// Init states withing next event loop iteration
|
||||
QTimer::singleShot(0, this, SLOT(RefreshStates()));
|
||||
#endif
|
||||
|
||||
*aRetVal = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeAppSupportQt::Stop(bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
*aResult = true;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_CreateNativeAppSupport(nsINativeAppSupport** aResult)
|
||||
{
|
||||
nsNativeAppSupportBase* native = new nsNativeAppSupportQt();
|
||||
if (!native)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
*aResult = native;
|
||||
NS_ADDREF(*aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <QObject>
|
||||
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||
#include "qmdevicemode.h"
|
||||
#include "qmdisplaystate.h"
|
||||
#include "qmactivity.h"
|
||||
#endif
|
||||
#include "nsNativeAppSupportBase.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsNativeAppSupportQt : public QObject, public nsNativeAppSupportBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NS_IMETHOD Start(bool* aRetVal);
|
||||
NS_IMETHOD Stop(bool* aResult);
|
||||
|
||||
#ifdef MOZ_ENABLE_QMSYSTEM2
|
||||
public Q_SLOTS:
|
||||
void activityChanged(MeeGo::QmActivity::Activity activity);
|
||||
void deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode mode);
|
||||
void displayStateChanged(MeeGo::QmDisplayState::DisplayState state);
|
||||
void RefreshStates();
|
||||
|
||||
private:
|
||||
MeeGo::QmDeviceMode mDeviceMode;
|
||||
MeeGo::QmDisplayState mDisplayState;
|
||||
MeeGo::QmActivity mActivity;
|
||||
#endif
|
||||
};
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include "nsQAppInstance.h"
|
||||
#include <QGuiApplication>
|
||||
#include "prenv.h"
|
||||
#include "nsXPCOMPrivate.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
QGuiApplication *nsQAppInstance::sQAppInstance = nullptr;
|
||||
int nsQAppInstance::sQAppRefCount = 0;
|
||||
|
||||
void nsQAppInstance::AddRef(int& aArgc, char** aArgv, bool aDefaultProcess) {
|
||||
if (qApp)
|
||||
return;
|
||||
if (!sQAppInstance) {
|
||||
mozilla::SetICUMemoryFunctions();
|
||||
sQAppInstance = new QGuiApplication(aArgc, aArgv);
|
||||
}
|
||||
sQAppRefCount++;
|
||||
}
|
||||
|
||||
void nsQAppInstance::Release(void) {
|
||||
if (sQAppInstance && !--sQAppRefCount) {
|
||||
delete sQAppInstance;
|
||||
sQAppInstance = nullptr;
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 et sw=2 tw=80: */
|
||||
/* 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 nsQAppInstance_h
|
||||
#define nsQAppInstance_h
|
||||
|
||||
// declared in nsAppRunner.cpp
|
||||
extern int gArgc;
|
||||
extern char **gArgv;
|
||||
|
||||
class QGuiApplication;
|
||||
class nsQAppInstance
|
||||
{
|
||||
public:
|
||||
static void AddRef(int& aArgc = gArgc,
|
||||
char** aArgv = gArgv,
|
||||
bool aDefaultProcess = false);
|
||||
static void Release(void);
|
||||
|
||||
private:
|
||||
static QGuiApplication *sQAppInstance;
|
||||
static int sQAppRefCount;
|
||||
};
|
||||
|
||||
#endif /* nsQAppInstance_h */
|
|
@ -144,16 +144,6 @@ X11Error(Display *display, XErrorEvent *event) {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
// We should not abort here if MOZ_X_SYNC is not set
|
||||
// until http://bugreports.qt.nokia.com/browse/QTBUG-4042
|
||||
// not fixed, just print error value
|
||||
if (!PR_GetEnv("MOZ_X_SYNC")) {
|
||||
fprintf(stderr, "XError: %s\n", notes.get());
|
||||
return 0; // temporary workaround for bug 161472
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_RUNTIMEABORT(notes.get());
|
||||
return 0; // not reached
|
||||
}
|
||||
|
|
|
@ -22,13 +22,6 @@
|
|||
#include "PseudoStack.h"
|
||||
#include "ProfilerBacktrace.h"
|
||||
|
||||
/* QT has a #define for the word "slots" and jsfriendapi.h has a struct with
|
||||
* this variable name, causing compilation problems. Alleviate this for now by
|
||||
* removing this #define */
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#undef slots
|
||||
#endif
|
||||
|
||||
// Make sure that we can use std::min here without the Windows headers messing with us.
|
||||
#ifdef min
|
||||
#undef min
|
||||
|
|
|
@ -92,14 +92,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
|||
'android/nsExternalURLHandlerService.cpp',
|
||||
'android/nsMIMEInfoAndroid.cpp',
|
||||
]
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
|
||||
SOURCES += [
|
||||
'unix/nsMIMEInfoQt.cpp',
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'unix/nsGNOMERegistry.cpp',
|
||||
'unix/nsMIMEInfoUnix.cpp',
|
||||
]
|
||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
UNIFIED_SOURCES += [
|
||||
'win/nsMIMEInfoWin.cpp',
|
||||
|
@ -142,6 +134,6 @@ if CONFIG['MOZ_ENABLE_DBUS']:
|
|||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||
CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
||||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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/. */
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#endif
|
||||
|
||||
#include "nsMIMEInfoQt.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
nsresult
|
||||
nsMIMEInfoQt::LoadUriInternal(nsIURI * aURI)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
nsAutoCString spec;
|
||||
aURI->GetAsciiSpec(spec);
|
||||
if (QDesktopServices::openUrl(QUrl(spec.get()))) {
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 nsMIMEInfoQt_h_
|
||||
#define nsMIMEInfoQt_h_
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsIURI;
|
||||
|
||||
class nsMIMEInfoQt
|
||||
{
|
||||
public:
|
||||
static nsresult LoadUriInternal(nsIURI * aURI);
|
||||
};
|
||||
|
||||
#endif // nsMIMEInfoQt_h_
|
|
@ -4,13 +4,6 @@
|
|||
* 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/. */
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#if (MOZ_ENABLE_CONTENTACTION)
|
||||
#include <contentaction/contentaction.h>
|
||||
#include "nsContentHandlerApp.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "nsMIMEInfoUnix.h"
|
||||
#include "nsGNOMERegistry.h"
|
||||
#include "nsIGIOService.h"
|
||||
|
@ -20,22 +13,11 @@
|
|||
#ifdef MOZ_ENABLE_DBUS
|
||||
#include "nsDBusHandlerApp.h"
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
#include "nsMIMEInfoQt.h"
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
|
||||
{
|
||||
nsresult rv = nsGNOMERegistry::LoadURL(aURI);
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = nsMIMEInfoQt::LoadUriInternal(aURI);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
return nsGNOMERegistry::LoadURL(aURI);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define CODE_MAP_MAC(aCPPCodeName, aNativeKey) \
|
||||
NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
|
||||
CODE_NAME_INDEX_##aCPPCodeName)
|
||||
#elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
#elif defined(MOZ_WIDGET_GTK)
|
||||
#undef CODE_MAP_X11
|
||||
// aNativeKey is hardware_keycode of GDKEvent or nativeScanCode of QKeyEvent.
|
||||
#define CODE_MAP_X11(aCPPCodeName, aNativeKey) \
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче