1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* Copyright 2012 Mozilla Foundation and Mozilla contributors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "base/basictypes.h"
19 #include "mozilla/ModuleUtils.h"
22 #include "nsWidgetsCID.h"
23 #include "nsAppShell.h"
26 #include "nsLookAndFeel.h"
27 #include "nsAppShellSingleton.h"
28 #include "nsScreenManagerQt.h"
29 #include "nsIdleServiceQt.h"
30 #include "nsTransferable.h"
31 #include "nsBidiKeyboard.h"
33 #include "nsHTMLFormatConverter.h"
34 #include "nsXULAppAPI.h"
37 #include "nsDeviceContextSpecQt.h"
38 #include "nsPrintSession.h"
39 #include "nsPrintOptionsQt.h"
40 #include "nsPrintDialogQt.h"
43 #include "nsClipboard.h"
44 #include "nsClipboardHelper.h"
47 #include "GfxInfoX11.h"
50 using namespace mozilla::widget
;
52 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow
)
53 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard
)
54 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerQt
)
55 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter
)
56 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceQt
, nsIdleServiceQt::GetInstance
)
57 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable
)
58 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard
)
59 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper
)
61 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecQt
)
62 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsQt
, Init
)
63 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorQt
)
64 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession
, Init
)
65 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceQt
, Init
)
71 // This constructor should really be shared with all platforms.
72 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo
, Init
)
78 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID
);
79 NS_DEFINE_NAMED_CID(NS_BIDIKEYBOARD_CID
);
80 NS_DEFINE_NAMED_CID(NS_WINDOW_CID
);
81 NS_DEFINE_NAMED_CID(NS_CHILD_CID
);
82 NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID
);
83 NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID
);
84 NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID
);
85 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID
);
86 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID
);
87 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID
);
89 NS_DEFINE_NAMED_CID(NS_GFXINFO_CID
);
92 NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID
);
93 NS_DEFINE_NAMED_CID(NS_PRINTER_ENUMERATOR_CID
);
94 NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID
);
95 NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID
);
96 NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID
);
99 static const mozilla::Module::CIDEntry kWidgetCIDs
[] = {
100 { &kNS_APPSHELL_CID
, false, nullptr, nsAppShellConstructor
},
101 { &kNS_BIDIKEYBOARD_CID
, false, nullptr, nsBidiKeyboardConstructor
},
102 { &kNS_CHILD_CID
, false, nullptr, nsWindowConstructor
},
103 { &kNS_CLIPBOARD_CID
, false, nullptr, nsClipboardConstructor
},
104 { &kNS_CLIPBOARDHELPER_CID
, false, nullptr, nsClipboardHelperConstructor
},
105 { &kNS_HTMLFORMATCONVERTER_CID
, false, nullptr, nsHTMLFormatConverterConstructor
},
106 { &kNS_IDLE_SERVICE_CID
, false, nullptr, nsIdleServiceQtConstructor
},
107 { &kNS_SCREENMANAGER_CID
, false, nullptr, nsScreenManagerQtConstructor
},
108 { &kNS_TRANSFERABLE_CID
, false, nullptr, nsTransferableConstructor
},
109 { &kNS_WINDOW_CID
, false, nullptr, nsWindowConstructor
},
111 { &kNS_GFXINFO_CID
, false, nullptr, mozilla::widget::GfxInfoConstructor
},
114 { &kNS_DEVICE_CONTEXT_SPEC_CID
, false, nullptr, nsDeviceContextSpecQtConstructor
},
115 { &kNS_PRINTDIALOGSERVICE_CID
, false, nullptr, nsPrintDialogServiceQtConstructor
},
116 { &kNS_PRINTER_ENUMERATOR_CID
, false, nullptr, nsPrinterEnumeratorQtConstructor
},
117 { &kNS_PRINTSESSION_CID
, false, nullptr, nsPrintSessionConstructor
},
118 { &kNS_PRINTSETTINGSSERVICE_CID
, false, nullptr, nsPrintOptionsQtConstructor
},
123 static const mozilla::Module::ContractIDEntry kWidgetContracts
[] = {
124 { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID
},
125 { "@mozilla.org/widget/appshell/qt;1", &kNS_APPSHELL_CID
},
126 { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID
},
127 { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID
},
128 { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID
},
129 { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID
},
130 { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID
},
131 { "@mozilla.org/widgets/child_window/qt;1", &kNS_CHILD_CID
},
132 { "@mozilla.org/widgets/window/qt;1", &kNS_WINDOW_CID
},
133 { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID
},
135 { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID
},
138 { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID
},
139 { "@mozilla.org/gfx/printerenumerator;1", &kNS_PRINTER_ENUMERATOR_CID
},
140 { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID
},
141 { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID
},
142 { NS_PRINTDIALOGSERVICE_CONTRACTID
, &kNS_PRINTDIALOGSERVICE_CID
},
148 nsWidgetQtModuleDtor()
150 nsLookAndFeel::Shutdown();
151 nsAppShellShutdown();
154 static const mozilla::Module kWidgetModule
= {
155 mozilla::Module::kVersion
,
164 NSMODULE_DEFN(nsWidgetQtModule
) = &kWidgetModule
;