2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2002-04-27 20:26:10 +04:00
|
|
|
/* vim:expandtab:shiftwidth=4:tabstop=4:
|
|
|
|
*/
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2001-10-14 23:02:05 +04:00
|
|
|
|
2019-01-25 04:27:24 +03:00
|
|
|
#include "nsWidgetFactory.h"
|
|
|
|
|
|
|
|
#include "mozilla/Components.h"
|
2015-02-19 09:50:19 +03:00
|
|
|
#include "mozilla/WidgetUtils.h"
|
2014-03-14 17:13:32 +04:00
|
|
|
#include "NativeKeyBindings.h"
|
2001-10-14 23:02:05 +04:00
|
|
|
#include "nsWidgetsCID.h"
|
|
|
|
#include "nsAppShell.h"
|
2006-05-10 21:30:15 +04:00
|
|
|
#include "nsAppShellSingleton.h"
|
2001-12-13 07:42:22 +03:00
|
|
|
#include "nsBaseWidget.h"
|
2015-06-26 18:28:00 +03:00
|
|
|
#include "nsGtkKeyUtils.h"
|
2001-12-10 20:37:36 +03:00
|
|
|
#include "nsLookAndFeel.h"
|
2001-12-13 07:42:22 +03:00
|
|
|
#include "nsWindow.h"
|
2002-05-22 02:47:56 +04:00
|
|
|
#include "nsHTMLFormatConverter.h"
|
2017-08-04 01:08:16 +03:00
|
|
|
#include "HeadlessClipboard.h"
|
2018-07-13 12:12:53 +03:00
|
|
|
#include "IMContextWrapper.h"
|
2008-08-10 09:25:30 +04:00
|
|
|
#ifdef MOZ_X11
|
2002-05-22 02:47:56 +04:00
|
|
|
# include "nsClipboard.h"
|
2015-06-08 11:41:00 +03:00
|
|
|
#endif
|
2018-03-08 19:43:00 +03:00
|
|
|
#include "TaskbarProgress.h"
|
2004-07-21 19:44:00 +04:00
|
|
|
#include "nsFilePicker.h"
|
2002-09-24 05:37:14 +04:00
|
|
|
#include "nsSound.h"
|
2011-10-25 19:05:32 +04:00
|
|
|
#include "nsGTKToolkit.h"
|
2014-06-18 08:11:00 +04:00
|
|
|
#include "WakeLockListener.h"
|
2008-07-02 20:35:31 +04:00
|
|
|
|
2013-10-08 03:15:59 +04:00
|
|
|
#include "mozilla/gfx/2D.h"
|
2017-03-09 14:29:44 +03:00
|
|
|
#include "mozilla/widget/ScreenManager.h"
|
2004-08-08 15:09:51 +04:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2011-05-27 12:15:20 +04:00
|
|
|
using namespace mozilla;
|
2014-03-14 17:13:32 +04:00
|
|
|
using namespace mozilla::widget;
|
2011-05-27 12:15:20 +04:00
|
|
|
|
2008-08-10 09:25:30 +04:00
|
|
|
#ifdef MOZ_X11
|
2019-01-25 04:27:24 +03:00
|
|
|
NS_IMPL_COMPONENT_FACTORY(nsIClipboard) {
|
2017-08-04 01:08:16 +03:00
|
|
|
nsCOMPtr<nsIClipboard> inst;
|
|
|
|
if (gfxPlatform::IsHeadless()) {
|
|
|
|
inst = new HeadlessClipboard();
|
|
|
|
} else {
|
2019-01-25 04:27:24 +03:00
|
|
|
auto clipboard = MakeRefPtr<nsClipboard>();
|
|
|
|
if (NS_FAILED(clipboard->Init())) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
inst = clipboard.forget();
|
2017-08-04 01:08:16 +03:00
|
|
|
}
|
|
|
|
|
2019-01-25 04:27:24 +03:00
|
|
|
return inst.forget().downcast<nsISupports>();
|
2017-08-04 01:08:16 +03:00
|
|
|
}
|
2010-06-11 20:47:31 +04:00
|
|
|
#endif
|
2009-08-29 19:40:22 +04:00
|
|
|
|
2019-01-25 04:27:24 +03:00
|
|
|
nsresult nsWidgetGtk2ModuleCtor() { return nsAppShellInit(); }
|
2010-06-11 20:47:31 +04:00
|
|
|
|
2019-01-25 04:27:24 +03:00
|
|
|
void nsWidgetGtk2ModuleDtor() {
|
2015-02-19 09:50:19 +03:00
|
|
|
// Shutdown all XP level widget classes.
|
|
|
|
WidgetUtils::Shutdown();
|
|
|
|
|
2014-03-14 17:13:32 +04:00
|
|
|
NativeKeyBindings::Shutdown();
|
2011-09-09 06:27:11 +04:00
|
|
|
nsLookAndFeel::Shutdown();
|
2004-10-21 10:19:00 +04:00
|
|
|
nsFilePicker::Shutdown();
|
2007-04-16 02:22:58 +04:00
|
|
|
nsSound::Shutdown();
|
2003-07-02 23:27:38 +04:00
|
|
|
nsWindow::ReleaseGlobals();
|
2018-07-13 12:12:53 +03:00
|
|
|
IMContextWrapper::Shutdown();
|
2015-06-26 18:28:00 +03:00
|
|
|
KeymapWrapper::Shutdown();
|
2011-10-25 19:05:32 +04:00
|
|
|
nsGTKToolkit::Shutdown();
|
2010-06-11 20:47:31 +04:00
|
|
|
nsAppShellShutdown();
|
2014-06-18 08:11:00 +04:00
|
|
|
#ifdef MOZ_ENABLE_DBUS
|
|
|
|
WakeLockListener::Shutdown();
|
|
|
|
#endif
|
2001-10-14 23:02:05 +04:00
|
|
|
}
|