Back to index

lightning-sunbird  0.9+nobinonly
nsWidgetFactory.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Dan Rosen <dr@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsIFactory.h"
00040 #include "nsISupports.h"
00041 #include "nsIComponentManager.h"
00042 #include "nsIGenericFactory.h"
00043 
00044 #include "nsWidgetsCID.h"
00045 
00046 #include "nsToolkit.h"
00047 #include "nsWindow.h"
00048 #include "nsMacWindow.h"
00049 #include "nsAppShell.h"
00050 #include "nsFilePicker.h"
00051 #include "nsNativeScrollbar.h"
00052 
00053 #include "nsMenuBarX.h"
00054 #include "nsMenuX.h"
00055 #include "nsMenuItemX.h"
00056 
00057 #include "nsClipboard.h"
00058 #include "nsClipboardHelper.h"
00059 #include "nsTransferable.h"
00060 #include "nsHTMLFormatConverter.h"
00061 #include "nsDragService.h"
00062 #include "nsDragHelperService.h"
00063 #include "nsLookAndFeel.h"
00064 #include "nsSound.h"
00065 #include "nsBidiKeyboard.h"
00066 
00067 #if USE_NATIVE_VERSION
00068 
00069 #include "nsIButton.h"
00070 #include "nsITextWidget.h"
00071 
00072 #include "nsButton.h"
00073 #include "nsCheckButton.h"
00074 #include "nsTextWidget.h"
00075 #include "nsLabel.h"
00076 
00077 #endif
00078 
00079 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacWindow)
00080 NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
00081 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
00082 #if USE_NATIVE_VERSION
00083 NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton)
00084 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCheckButton)
00085 NS_GENERIC_FACTORY_CONSTRUCTOR(nsComboBox)
00086 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRadioButton)
00087 NS_GENERIC_FACTORY_CONSTRUCTOR(nsListBox)
00088 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextAreaWidget)
00089 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel)
00090 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextWidget)     // used by Viewer?
00091 #endif
00092 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell)
00093 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
00094 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
00095 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuBarX)
00096 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuX)
00097 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuItemX)
00098 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
00099 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
00100 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
00101 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
00102 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
00103 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
00104 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragHelperService)
00105 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeScrollbar)
00106 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
00107 
00108 static const nsModuleComponentInfo gComponents[] =
00109 {
00110 #if USE_NATIVE_VERSION
00111        {      "Text Field",
00112               NS_TEXTFIELD_CID,
00113               "@mozilla.org/widgets/textwidget/mac;1",
00114               nsTextWidgetConstructor },
00115        {      "Label",
00116               NS_LABEL_CID,
00117               "@mozilla.org/widget/label/mac;1",
00118               nsLabelConstructor },
00119        {      "Button",
00120               NS_BUTTON_CID,
00121               "@mozilla.org/widgets/button/mac;1",
00122               nsButtonConstructor },
00123 #endif
00124        {      "nsWindow",
00125               NS_WINDOW_CID,
00126               "@mozilla.org/widgets/window/mac;1",
00127               nsMacWindowConstructor },
00128        {      "Popup nsWindow",
00129               NS_POPUP_CID,
00130               "@mozilla.org/widgets/popup/mac;1",
00131               nsMacWindowConstructor },
00132        {      "Child nsWindow",
00133               NS_CHILD_CID,
00134               "@mozilla.org/widgets/child_window/mac;1",
00135               ChildWindowConstructor },
00136        {      "File Picker",
00137               NS_FILEPICKER_CID,
00138               "@mozilla.org/filepicker;1",
00139               nsFilePickerConstructor },
00140        {      "AppShell",
00141               NS_APPSHELL_CID,
00142               "@mozilla.org/widget/appshell/mac;1",
00143               nsAppShellConstructor },
00144        {      "Toolkit",
00145               NS_TOOLKIT_CID,
00146               "@mozilla.org/widget/toolkit/mac;1",
00147               nsToolkitConstructor },
00148        {      "Look And Feel",
00149               NS_LOOKANDFEEL_CID,
00150               "@mozilla.org/widget/lookandfeel;1",
00151               nsLookAndFeelConstructor },
00152        {      "Menubar",
00153               NS_MENUBAR_CID,
00154               "@mozilla.org/widget/menubar/mac;1",
00155               nsMenuBarXConstructor },
00156        {      "Menu",
00157               NS_MENU_CID,
00158               "@mozilla.org/widget/menu/mac;1",
00159               nsMenuXConstructor },
00160        {      "MenuItem",
00161               NS_MENUITEM_CID,
00162               "@mozilla.org/widget/menuitem/mac;1",
00163               nsMenuItemXConstructor },
00164        {      "Sound",
00165               NS_SOUND_CID,
00166               "@mozilla.org/sound;1",
00167               nsSoundConstructor },
00168        {      "Transferable",
00169               NS_TRANSFERABLE_CID,
00170               "@mozilla.org/widget/transferable;1",
00171               nsTransferableConstructor },
00172        {      "HTML Format Converter",
00173               NS_HTMLFORMATCONVERTER_CID,
00174               "@mozilla.org/widget/htmlformatconverter;1",
00175               nsHTMLFormatConverterConstructor },
00176        {      "Clipboard",
00177               NS_CLIPBOARD_CID,
00178               "@mozilla.org/widget/clipboard;1",
00179               nsClipboardConstructor },
00180        {      "Clipboard Helper",
00181               NS_CLIPBOARDHELPER_CID,
00182               "@mozilla.org/widget/clipboardhelper;1",
00183               nsClipboardHelperConstructor },
00184        {      "Drag Service",
00185               NS_DRAGSERVICE_CID,
00186               "@mozilla.org/widget/dragservice;1",
00187               nsDragServiceConstructor },
00188        {      "Drag Helper Service",
00189               NS_DRAGHELPERSERVICE_CID,
00190               "@mozilla.org/widget/draghelperservice;1",
00191               nsDragHelperServiceConstructor },
00192        {      "Native Scrollbar",
00193               NS_NATIVESCROLLBAR_CID,
00194               "@mozilla.org/widget/nativescrollbar;1",
00195               nsNativeScrollbarConstructor },
00196        {      "Gtk Bidi Keyboard",
00197               NS_BIDIKEYBOARD_CID,
00198               "@mozilla.org/widget/bidikeyboard;1",
00199               nsBidiKeyboardConstructor },
00200 };
00201 
00202 NS_IMPL_NSGETMODULE(nsWidgetMacModule, gComponents)
00203