2002-04-27 20:26:10 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* 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
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
#include "mozilla/ModuleUtils.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 "nsTransferable.h"
|
|
|
|
#include "nsHTMLFormatConverter.h"
|
2008-08-10 09:25:30 +04:00
|
|
|
#ifdef MOZ_X11
|
|
|
|
#include "nsClipboardHelper.h"
|
2002-05-22 02:47:56 +04:00
|
|
|
#include "nsClipboard.h"
|
2002-08-10 20:18:44 +04:00
|
|
|
#include "nsDragService.h"
|
2008-08-10 09:25:30 +04:00
|
|
|
#endif
|
2015-06-08 11:41:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
#include "nsApplicationChooser.h"
|
|
|
|
#endif
|
2013-06-22 17:39:43 +04:00
|
|
|
#include "nsColorPicker.h"
|
2004-07-21 19:44:00 +04:00
|
|
|
#include "nsFilePicker.h"
|
2002-09-24 05:37:14 +04:00
|
|
|
#include "nsSound.h"
|
2001-12-07 08:23:56 +03:00
|
|
|
#include "nsBidiKeyboard.h"
|
2006-01-12 00:56:25 +03:00
|
|
|
#include "nsScreenManagerGtk.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
|
|
|
|
|
|
|
#ifdef NS_PRINTING
|
2006-02-10 23:44:48 +03:00
|
|
|
#include "nsPrintOptionsGTK.h"
|
|
|
|
#include "nsPrintSession.h"
|
|
|
|
#include "nsDeviceContextSpecG.h"
|
2008-07-02 20:35:31 +04:00
|
|
|
#endif
|
|
|
|
|
2011-05-27 12:15:20 +04:00
|
|
|
#include "mozilla/Preferences.h"
|
|
|
|
|
2006-06-16 22:38:39 +04:00
|
|
|
#include "nsImageToPixbuf.h"
|
2008-01-21 06:47:25 +03:00
|
|
|
#include "nsPrintDialogGTK.h"
|
2006-01-12 00:56:25 +03:00
|
|
|
|
2009-09-17 21:13:45 +04:00
|
|
|
#if defined(MOZ_X11)
|
2008-07-26 01:34:30 +04:00
|
|
|
#include "nsIdleServiceGTK.h"
|
2011-05-04 00:07:17 +04:00
|
|
|
#include "GfxInfoX11.h"
|
2008-07-26 01:34:30 +04:00
|
|
|
#endif
|
|
|
|
|
2005-08-23 06:11:54 +04:00
|
|
|
#include "nsNativeThemeGTK.h"
|
2001-10-14 23:02:05 +04:00
|
|
|
|
2004-08-08 15:09:51 +04:00
|
|
|
#include "nsIComponentRegistrar.h"
|
|
|
|
#include "nsComponentManagerUtils.h"
|
2013-10-08 03:15:59 +04:00
|
|
|
#include "mozilla/gfx/2D.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
|
|
|
|
2004-08-08 15:09:51 +04:00
|
|
|
/* from nsFilePicker.js */
|
|
|
|
#define XULFILEPICKER_CID \
|
|
|
|
{ 0x54ae32f8, 0x1dd2, 0x11b2, \
|
|
|
|
{ 0xa2, 0x09, 0xdf, 0x7c, 0x50, 0x53, 0x70, 0xf8} }
|
|
|
|
static NS_DEFINE_CID(kXULFilePickerCID, XULFILEPICKER_CID);
|
|
|
|
|
2001-10-14 23:02:05 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
|
2001-12-07 08:23:56 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildWindow)
|
2002-05-22 02:47:56 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
|
2001-12-07 08:23:56 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
|
2002-05-22 02:47:56 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
|
2008-08-10 09:25:30 +04:00
|
|
|
#ifdef MOZ_X11
|
2012-06-29 12:32:21 +04:00
|
|
|
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceGTK, nsIdleServiceGTK::GetInstance)
|
2008-08-10 09:25:30 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
|
2002-05-22 02:47:56 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsClipboard, Init)
|
2002-08-10 20:18:44 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
|
2008-08-10 09:25:30 +04:00
|
|
|
#endif
|
2002-09-24 05:37:14 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
|
2006-01-12 00:56:25 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerGtk)
|
2008-09-18 01:15:52 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageToPixbuf)
|
|
|
|
|
|
|
|
|
|
|
|
// from nsWindow.cpp
|
2011-09-29 10:19:26 +04:00
|
|
|
extern bool gDisableNativeTheme;
|
2008-09-18 01:15:52 +04:00
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
static nsresult
|
2008-09-18 01:15:52 +04:00
|
|
|
nsNativeThemeGTKConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
nsNativeThemeGTK * inst;
|
|
|
|
|
|
|
|
if (gDisableNativeTheme)
|
|
|
|
return NS_ERROR_NO_INTERFACE;
|
|
|
|
|
2013-10-08 22:47:37 +04:00
|
|
|
*aResult = nullptr;
|
|
|
|
if (nullptr != aOuter) {
|
2008-09-18 01:15:52 +04:00
|
|
|
rv = NS_ERROR_NO_AGGREGATION;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2010-07-05 13:42:18 +04:00
|
|
|
inst = new nsNativeThemeGTK();
|
2013-10-08 22:47:37 +04:00
|
|
|
if (nullptr == inst) {
|
2008-09-18 01:15:52 +04:00
|
|
|
rv = NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
NS_ADDREF(inst);
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
NS_RELEASE(inst);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
2008-07-26 01:34:30 +04:00
|
|
|
|
2009-09-17 21:13:45 +04:00
|
|
|
#if defined(MOZ_X11)
|
2011-05-04 00:07:17 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
// This constructor should really be shared with all platforms.
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init)
|
|
|
|
}
|
|
|
|
}
|
2008-07-26 01:34:30 +04:00
|
|
|
#endif
|
2008-07-02 20:35:31 +04:00
|
|
|
|
|
|
|
#ifdef NS_PRINTING
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecGTK)
|
2006-02-10 23:44:48 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsGTK, Init)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorGTK)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init)
|
2008-01-21 06:47:25 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceGTK, Init)
|
2008-07-02 20:35:31 +04:00
|
|
|
#endif
|
2001-10-14 23:02:05 +04:00
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
static nsresult
|
2004-08-08 15:09:51 +04:00
|
|
|
nsFilePickerConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
|
|
|
{
|
2012-07-30 18:20:58 +04:00
|
|
|
*aResult = nullptr;
|
|
|
|
if (aOuter != nullptr) {
|
2004-08-08 15:09:51 +04:00
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool allowPlatformPicker =
|
|
|
|
Preferences::GetBool("ui.allow_platform_file_picker", true);
|
2011-05-27 12:15:20 +04:00
|
|
|
|
2004-08-08 15:09:51 +04:00
|
|
|
nsCOMPtr<nsIFilePicker> picker;
|
2013-05-30 16:10:02 +04:00
|
|
|
if (allowPlatformPicker) {
|
2006-04-12 04:49:46 +04:00
|
|
|
picker = new nsFilePicker;
|
2004-08-08 15:09:51 +04:00
|
|
|
} else {
|
|
|
|
picker = do_CreateInstance(kXULFilePickerCID);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!picker) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return picker->QueryInterface(aIID, aResult);
|
|
|
|
}
|
|
|
|
|
2015-06-08 11:41:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
static nsresult
|
|
|
|
nsApplicationChooserConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
|
|
|
{
|
|
|
|
*aResult = nullptr;
|
|
|
|
if (aOuter != nullptr) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsCOMPtr<nsIApplicationChooser> chooser = new nsApplicationChooser;
|
|
|
|
|
|
|
|
if (!chooser) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return chooser->QueryInterface(aIID, aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-06-22 17:39:43 +04:00
|
|
|
static nsresult
|
|
|
|
nsColorPickerConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|
|
|
void **aResult)
|
|
|
|
{
|
|
|
|
*aResult = nullptr;
|
|
|
|
if (aOuter != nullptr) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIColorPicker> picker = new nsColorPicker;
|
|
|
|
|
|
|
|
if (!picker) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return picker->QueryInterface(aIID, aResult);
|
|
|
|
}
|
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CHILD_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
|
2013-06-22 17:39:43 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
|
2010-06-11 20:47:31 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
|
2015-06-08 11:41:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
NS_DEFINE_NAMED_CID(NS_APPLICATIONCHOOSER_CID);
|
|
|
|
#endif
|
2010-06-11 20:47:31 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_SOUND_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
|
|
|
|
#ifdef MOZ_X11
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
|
|
|
|
#endif
|
|
|
|
NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_BIDIKEYBOARD_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_THEMERENDERER_CID);
|
|
|
|
#ifdef NS_PRINTING
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PRINTER_ENUMERATOR_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID);
|
2016-07-22 11:56:13 +03:00
|
|
|
#endif
|
2010-06-11 20:47:31 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_IMAGE_TO_PIXBUF_CID);
|
|
|
|
#if defined(MOZ_X11)
|
|
|
|
NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
|
2011-05-04 00:07:17 +04:00
|
|
|
NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
|
2010-06-11 20:47:31 +04:00
|
|
|
#endif
|
2009-08-29 19:40:22 +04:00
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
|
|
|
|
static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor },
|
|
|
|
{ &kNS_CHILD_CID, false, nullptr, nsChildWindowConstructor },
|
2016-08-23 08:57:36 +03:00
|
|
|
{ &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor, Module::ALLOW_IN_GPU_PROCESS },
|
2014-02-10 04:13:01 +04:00
|
|
|
{ &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerConstructor, Module::MAIN_PROCESS_ONLY },
|
|
|
|
{ &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerConstructor, Module::MAIN_PROCESS_ONLY },
|
2015-06-08 11:41:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
{ &kNS_APPLICATIONCHOOSER_CID, false, nullptr, nsApplicationChooserConstructor, Module::MAIN_PROCESS_ONLY },
|
|
|
|
#endif
|
2014-02-10 04:13:01 +04:00
|
|
|
{ &kNS_SOUND_CID, false, nullptr, nsSoundConstructor, Module::MAIN_PROCESS_ONLY },
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
|
2008-08-07 00:48:55 +04:00
|
|
|
#ifdef MOZ_X11
|
2014-02-10 04:13:01 +04:00
|
|
|
{ &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor, Module::MAIN_PROCESS_ONLY },
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
|
2014-02-10 04:13:01 +04:00
|
|
|
{ &kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceConstructor, Module::MAIN_PROCESS_ONLY },
|
2008-08-07 00:48:55 +04:00
|
|
|
#endif
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
|
|
|
|
{ &kNS_BIDIKEYBOARD_CID, false, nullptr, nsBidiKeyboardConstructor },
|
2014-07-14 21:22:26 +04:00
|
|
|
{ &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerGtkConstructor,
|
|
|
|
Module::MAIN_PROCESS_ONLY },
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_THEMERENDERER_CID, false, nullptr, nsNativeThemeGTKConstructor },
|
2008-07-02 20:35:31 +04:00
|
|
|
#ifdef NS_PRINTING
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsGTKConstructor },
|
2014-10-28 18:59:08 +03:00
|
|
|
{ &kNS_PRINTER_ENUMERATOR_CID, false, nullptr, nsPrinterEnumeratorGTKConstructor },
|
|
|
|
{ &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor },
|
|
|
|
{ &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecGTKConstructor },
|
|
|
|
{ &kNS_PRINTDIALOGSERVICE_CID, false, nullptr, nsPrintDialogServiceGTKConstructor },
|
2014-02-10 04:13:01 +04:00
|
|
|
#endif
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_IMAGE_TO_PIXBUF_CID, false, nullptr, nsImageToPixbufConstructor },
|
2009-09-17 21:13:45 +04:00
|
|
|
#if defined(MOZ_X11)
|
2013-10-08 22:47:37 +04:00
|
|
|
{ &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceGTKConstructor },
|
|
|
|
{ &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor },
|
2010-06-11 20:47:31 +04:00
|
|
|
#endif
|
2013-10-08 22:47:37 +04:00
|
|
|
{ nullptr }
|
2010-06-11 20:47:31 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
|
|
|
|
{ "@mozilla.org/widget/window/gtk;1", &kNS_WINDOW_CID },
|
|
|
|
{ "@mozilla.org/widgets/child_window/gtk;1", &kNS_CHILD_CID },
|
2016-08-23 08:57:36 +03:00
|
|
|
{ "@mozilla.org/widget/appshell/gtk;1", &kNS_APPSHELL_CID, Module::ALLOW_IN_GPU_PROCESS },
|
2014-02-10 04:13:01 +04:00
|
|
|
{ "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::MAIN_PROCESS_ONLY },
|
|
|
|
{ "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::MAIN_PROCESS_ONLY },
|
2015-06-08 11:41:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
{ "@mozilla.org/applicationchooser;1", &kNS_APPLICATIONCHOOSER_CID, Module::MAIN_PROCESS_ONLY },
|
|
|
|
#endif
|
2014-02-10 04:13:01 +04:00
|
|
|
{ "@mozilla.org/sound;1", &kNS_SOUND_CID, Module::MAIN_PROCESS_ONLY },
|
2010-06-11 20:47:31 +04:00
|
|
|
{ "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
|
|
|
|
#ifdef MOZ_X11
|
2014-02-10 04:13:01 +04:00
|
|
|
{ "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::MAIN_PROCESS_ONLY },
|
2010-06-11 20:47:31 +04:00
|
|
|
{ "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
|
2014-02-10 04:13:01 +04:00
|
|
|
{ "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID, Module::MAIN_PROCESS_ONLY },
|
2010-06-11 20:47:31 +04:00
|
|
|
#endif
|
|
|
|
{ "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
|
2016-03-22 07:13:09 +03:00
|
|
|
{ "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID,
|
|
|
|
Module::MAIN_PROCESS_ONLY },
|
2014-07-14 21:22:26 +04:00
|
|
|
{ "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
|
|
|
|
Module::MAIN_PROCESS_ONLY },
|
2010-06-11 20:47:31 +04:00
|
|
|
{ "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
|
|
|
|
#ifdef NS_PRINTING
|
|
|
|
{ "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
|
2014-10-28 18:59:08 +03:00
|
|
|
{ "@mozilla.org/gfx/printerenumerator;1", &kNS_PRINTER_ENUMERATOR_CID },
|
|
|
|
{ "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID },
|
|
|
|
{ "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID },
|
|
|
|
{ NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID },
|
2014-02-10 04:13:01 +04:00
|
|
|
#endif
|
2010-06-11 20:47:31 +04:00
|
|
|
{ "@mozilla.org/widget/image-to-gdk-pixbuf;1", &kNS_IMAGE_TO_PIXBUF_CID },
|
|
|
|
#if defined(MOZ_X11)
|
|
|
|
{ "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
|
2011-05-04 00:07:17 +04:00
|
|
|
{ "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
|
2008-08-10 09:25:30 +04:00
|
|
|
#endif
|
2013-10-08 22:47:37 +04:00
|
|
|
{ nullptr }
|
2001-10-14 23:02:05 +04:00
|
|
|
};
|
|
|
|
|
2008-10-10 19:04:34 +04:00
|
|
|
static void
|
2010-06-11 20:47:31 +04:00
|
|
|
nsWidgetGtk2ModuleDtor()
|
2001-10-14 23:02:05 +04:00
|
|
|
{
|
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();
|
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
|
|
|
}
|
|
|
|
|
2010-06-11 20:47:31 +04:00
|
|
|
static const mozilla::Module kWidgetModule = {
|
|
|
|
mozilla::Module::kVersion,
|
|
|
|
kWidgetCIDs,
|
|
|
|
kWidgetContracts,
|
2013-10-08 22:47:37 +04:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2010-06-11 20:47:31 +04:00
|
|
|
nsAppShellInit,
|
2016-08-23 08:57:36 +03:00
|
|
|
nsWidgetGtk2ModuleDtor,
|
|
|
|
Module::ALLOW_IN_GPU_PROCESS
|
2010-06-11 20:47:31 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
NSMODULE_DEFN(nsWidgetGtk2Module) = &kWidgetModule;
|