diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index b0c75247612..e5a20cd2cde 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -54,9 +54,6 @@ #include "nsIFormControl.h" #include "nsIDeviceContext.h" #include "nsHTMLAtoms.h" -#include "nsIButton.h" // remove this when GetCID is pure virtual -#include "nsICheckButton.h" //remove this -#include "nsITextWidget.h" //remove this #include "nsISupports.h" #include "nsStyleConsts.h" #include "nsUnitConversion.h" @@ -520,24 +517,6 @@ nsFormControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { } -/* - * FIXME: this ::GetIID() method has no meaning in life and should be - * removed. - * Pierre Phaneuf - */ -const nsIID& -nsFormControlFrame::GetIID() -{ - return NS_GET_IID(nsIButton); -} - -const nsIID& -nsFormControlFrame::GetCID() -{ - static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); - return kButtonCID; -} - NS_METHOD nsFormControlFrame::HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, diff --git a/layout/forms/nsFormControlFrame.h b/layout/forms/nsFormControlFrame.h index 72eb7484877..972f5af358d 100644 --- a/layout/forms/nsFormControlFrame.h +++ b/layout/forms/nsFormControlFrame.h @@ -125,18 +125,6 @@ public: // new behavior - /** - * Get the class id of the widget associated with this frame - * @return the class id - */ - virtual const nsIID& GetCID(); - - /** - * Get the interface id of widget associated with this frame - * @return the interface id - */ - virtual const nsIID& GetIID(); - /** * Respond to a enter key being pressed */ diff --git a/layout/forms/nsFormControlHelper.cpp b/layout/forms/nsFormControlHelper.cpp index 8d386a39419..a813a5c6f38 100644 --- a/layout/forms/nsFormControlHelper.cpp +++ b/layout/forms/nsFormControlHelper.cpp @@ -55,9 +55,6 @@ #include "nsIFormControl.h" #include "nsIDeviceContext.h" #include "nsHTMLAtoms.h" -#include "nsIButton.h" // remove this when GetCID is pure virtual -#include "nsICheckButton.h" //remove this -#include "nsITextWidget.h" //remove this #include "nsISupports.h" #include "nsStyleConsts.h" #include "nsUnitConversion.h" diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index 7c01717f2e3..ff503bf4597 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -36,7 +36,6 @@ * ***** END LICENSE BLOCK ***** */ #include "nsGfxButtonControlFrame.h" -#include "nsIButton.h" #include "nsWidgetsCID.h" #include "nsIFontMetrics.h" #include "nsFormControlFrame.h" @@ -95,24 +94,6 @@ nsGfxButtonControlFrame::IsFileBrowseButton(PRInt32 type) return rv; } -/* - * FIXME: this ::GetIID() method has no meaning in life and should be - * removed. - * Pierre Phaneuf - */ -const nsIID& -nsGfxButtonControlFrame::GetIID() -{ - return NS_GET_IID(nsIButton); -} - -const nsIID& -nsGfxButtonControlFrame::GetCID() -{ - static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); - return kButtonCID; -} - #ifdef DEBUG NS_IMETHODIMP nsGfxButtonControlFrame::GetFrameName(nsAString& aResult) const diff --git a/layout/forms/nsGfxButtonControlFrame.h b/layout/forms/nsGfxButtonControlFrame.h index b386139a8aa..b40e208f73c 100644 --- a/layout/forms/nsGfxButtonControlFrame.h +++ b/layout/forms/nsGfxButtonControlFrame.h @@ -64,8 +64,6 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - virtual const nsIID& GetCID(); - virtual const nsIID& GetIID(); NS_IMETHOD HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, diff --git a/layout/forms/nsGfxCheckboxControlFrame.cpp b/layout/forms/nsGfxCheckboxControlFrame.cpp index 8c660af5556..d2d23b6e97e 100644 --- a/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -36,7 +36,6 @@ * ***** END LICENSE BLOCK ***** */ #include "nsGfxCheckboxControlFrame.h" -#include "nsICheckButton.h" #include "nsHTMLAtoms.h" #include "nsHTMLParts.h" #include "nsIFormControl.h" diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index a2f522144b4..9994b2703aa 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -54,9 +54,6 @@ EXPORTS = \ nsStringUtil.h \ nsIWidget.h \ nsIKBStateControl.h \ - nsIButton.h \ - nsICheckButton.h \ - nsITextWidget.h \ nsGUIEvent.h \ nsEvent.h \ nsIMouseListener.h \ @@ -64,7 +61,6 @@ EXPORTS = \ nsIMenuListener.h \ nsWidgetsCID.h \ nsILookAndFeel.h \ - nsILabel.h \ nsIDragSessionGTK.h \ nsIDragSessionXlib.h \ nsIDragSessionMac.h \ diff --git a/widget/public/nsIButton.h b/widget/public/nsIButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/public/nsICheckButton.h b/widget/public/nsICheckButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/public/nsILabel.h b/widget/public/nsILabel.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/public/nsITextWidget.h b/widget/public/nsITextWidget.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/public/nsWidgetsCID.h b/widget/public/nsWidgetsCID.h index ab5b8fdab09..8e19465a89b 100644 --- a/widget/public/nsWidgetsCID.h +++ b/widget/public/nsWidgetsCID.h @@ -52,41 +52,15 @@ { 0xba7de611, 0x6088, 0x11d3, \ { 0xa8, 0x3e, 0x0, 0x10, 0x5a, 0x18, 0x34, 0x19 } } - -/* 2d96b3d2-c051-11d1-a827-0040959a28c9 */ -#define NS_BUTTON_CID \ -{ 0x2d96b3d2, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d3-c051-11d1-a827-0040959a28c9 */ -#define NS_CHECKBUTTON_CID \ -{ 0x2d96b3d3, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - /* bd57cee8-1dd1-11b2-9fe7-95cf4709aea3 */ #define NS_FILEPICKER_CID \ { 0xbd57cee8, 0x1dd1, 0x11b2, \ {0x9f, 0xe7, 0x95, 0xcf, 0x47, 0x09, 0xae, 0xa3} } -/* 2d96b3d9-c051-11d1-a827-0040959a28c9 */ -#define NS_HORZSCROLLBAR_CID \ -{ 0x2d96b3d9, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3da-c051-11d1-a827-0040959a28c9 */ -#define NS_VERTSCROLLBAR_CID \ -{ 0x2d96b3da, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - // {c2281100-3b4b-11d6-a384-f705fd0766fc} #define NS_NATIVESCROLLBAR_CID \ { 0xc2281100, 0x3b4b, 0x11d6, { 0xa3, 0x84, 0xf7, 0x05, 0xfd, 0x07, 0x66, 0xfc } } -/* 2d96b3dc-c051-11d1-a827-0040959a28c9 */ -#define NS_TEXTFIELD_CID \ -{ 0x2d96b3dc, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - /* 2d96b3df-c051-11d1-a827-0040959a28c9 */ #define NS_APPSHELL_CID \ { 0x2d96b3df, 0xc051, 0x11d1, \ @@ -105,16 +79,6 @@ { 0xa61e6398, 0x2057, 0x40fd, \ { 0x9c, 0x81, 0x87, 0x3b, 0x90, 0x8d, 0x24, 0xe7 } } -/* 4A781D61-3D28-11d2-8DB8-00609703C14E */ -#define NS_DIALOG_CID \ -{ 0x4a781d61, 0x3d28, 0x11d2, \ - { 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } } - -/* F3131891-3DC7-11d2-8DB8-00609703C14E */ -#define NS_LABEL_CID \ -{ 0xf3131891, 0x3dc7, 0x11d2, \ - { 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } } - //----------------------------------------------------------- // Menus //----------------------------------------------------------- diff --git a/widget/src/build/nsWidgetSupport.cpp b/widget/src/build/nsWidgetSupport.cpp index 3cb3c5dcb81..39fdf522b27 100644 --- a/widget/src/build/nsWidgetSupport.cpp +++ b/widget/src/build/nsWidgetSupport.cpp @@ -40,129 +40,16 @@ #include "nsWidgetSupport.h" #include "nsRect.h" #include "nsIAppShell.h" -#include "nsIButton.h" #include "nsIEventListener.h" -#include "nsILabel.h" #include "nsILookAndFeel.h" #include "nsIMouseListener.h" #include "nsIToolkit.h" #include "nsIWidget.h" -#include "nsICheckButton.h" -#include "nsITextWidget.h" static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -NS_WIDGET nsresult -NS_CreateButton(nsISupports* aParent, - nsIButton* aButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsIWidget* parent = nsnull; - if (aParent != nsnull) - aParent->QueryInterface(kIWidgetIID,(void**)&parent); - - nsIWidget* widget; - if (NS_OK == aButton->QueryInterface(kIWidgetIID,(void**)&widget)) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont != nsnull) - widget->SetFont(*aFont); - NS_IF_RELEASE(widget); - } - - if (aParent != nsnull) - NS_IF_RELEASE(parent); - return NS_OK; -} - -NS_WIDGET nsresult -NS_CreateCheckButton(nsISupports* aParent, - nsICheckButton* aCheckButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsIWidget* parent = nsnull; - if (aParent != nsnull) - aParent->QueryInterface(kIWidgetIID,(void**)&parent); - - nsIWidget* widget; - if (NS_OK == aCheckButton->QueryInterface(kIWidgetIID,(void**)&widget)) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont != nsnull) - widget->SetFont(*aFont); - NS_IF_RELEASE(widget); - } - if (aParent != nsnull) - NS_IF_RELEASE(parent); - return NS_OK; -} - - - - -NS_WIDGET nsresult -NS_CreateLabel( nsISupports* aParent, - nsILabel* aLabel, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsIWidget* parent = nsnull; - if (NS_OK == aParent->QueryInterface(kIWidgetIID,(void**)&parent)) - { - nsIWidget* widget; - if (NS_OK == aLabel->QueryInterface(kIWidgetIID,(void**)&widget)) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont != nsnull) - widget->SetFont(*aFont); - NS_IF_RELEASE(widget); - } - NS_IF_RELEASE(parent); - } - return NS_OK; -} - - - -NS_WIDGET nsresult -NS_CreateTextWidget(nsISupports* aParent, - nsITextWidget* aWidget, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsIWidget* parent = nsnull; - if (aParent != nsnull) - aParent->QueryInterface(kIWidgetIID,(void**)&parent); - - nsIWidget* widget = nsnull; - if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont != nsnull) - widget->SetFont(*aFont); - NS_IF_RELEASE(widget); - } - else - { - NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object"); - } - - if (aParent) - NS_IF_RELEASE(parent); - - return NS_OK; -} - - - extern NS_WIDGET nsresult NS_ShowWidget(nsISupports* aWidget, PRBool aShow) { diff --git a/widget/src/gtk/Makefile.in b/widget/src/gtk/Makefile.in index 892090aedf8..c778e69f9e7 100644 --- a/widget/src/gtk/Makefile.in +++ b/widget/src/gtk/Makefile.in @@ -80,18 +80,13 @@ CSRCS = \ CPPSRCS = \ nsAppShell.cpp \ nsBidiKeyboard.cpp \ - nsButton.cpp \ - nsCheckButton.cpp \ nsClipboard.cpp \ nsDragService.cpp \ nsGtkEventHandler.cpp \ nsGtkUtils.cpp \ nsKeyboardUtils.cpp \ - nsLabel.cpp \ nsLookAndFeel.cpp \ nsSound.cpp \ - nsTextHelper.cpp \ - nsTextWidget.cpp \ nsToolkit.cpp \ nsWidget.cpp \ nsWidgetFactory.cpp \ diff --git a/widget/src/gtk/nsButton.cpp b/widget/src/gtk/nsButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsButton.h b/widget/src/gtk/nsButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsCheckButton.cpp b/widget/src/gtk/nsCheckButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsCheckButton.h b/widget/src/gtk/nsCheckButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsLabel.cpp b/widget/src/gtk/nsLabel.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsLabel.h b/widget/src/gtk/nsLabel.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsTextHelper.cpp b/widget/src/gtk/nsTextHelper.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsTextHelper.h b/widget/src/gtk/nsTextHelper.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsTextWidget.cpp b/widget/src/gtk/nsTextWidget.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsTextWidget.h b/widget/src/gtk/nsTextWidget.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/gtk/nsWidgetFactory.cpp b/widget/src/gtk/nsWidgetFactory.cpp index a75118f4654..f8403b9ba76 100644 --- a/widget/src/gtk/nsWidgetFactory.cpp +++ b/widget/src/gtk/nsWidgetFactory.cpp @@ -44,13 +44,9 @@ #include "nsWidgetsCID.h" #include "nsWindow.h" -#include "nsButton.h" -#include "nsCheckButton.h" -#include "nsTextWidget.h" #include "nsAppShell.h" #include "nsToolkit.h" #include "nsLookAndFeel.h" -#include "nsLabel.h" #include "nsTransferable.h" #include "nsClipboard.h" #include "nsClipboardHelper.h" @@ -67,13 +63,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCheckButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextWidget) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell) NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel) NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) @@ -96,18 +88,6 @@ static const nsModuleComponentInfo components[] = NS_CHILD_CID, "@mozilla.org/widgets/child_window/gtk;1", ChildWindowConstructor }, - { "Gtk Button", - NS_BUTTON_CID, - "@mozilla.org/widgets/button/gtk;1", - nsButtonConstructor }, - { "Gtk Check Button", - NS_CHECKBUTTON_CID, - "@mozilla.org/widgets/checkbutton/gtk;1", - nsCheckButtonConstructor }, - { "Gtk Text Widget", - NS_TEXTFIELD_CID, - "@mozilla.org/widgets/textwidget/gtk;1", - nsTextWidgetConstructor }, { "Gtk AppShell", NS_APPSHELL_CID, "@mozilla.org/widget/appshell/gtk;1", @@ -120,10 +100,6 @@ static const nsModuleComponentInfo components[] = NS_LOOKANDFEEL_CID, "@mozilla.org/widget/lookandfeel;1", nsLookAndFeelConstructor }, - { "Gtk Label", - NS_LABEL_CID, - "@mozilla.org/widget/label/gtk;1", - nsLabelConstructor }, { "Gtk Sound", NS_SOUND_CID, // "@mozilla.org/widget/sound/gtk;1" diff --git a/widget/src/mac/nsWidgetFactory.cpp b/widget/src/mac/nsWidgetFactory.cpp index 5eb06fb2bf8..21d70d97837 100644 --- a/widget/src/mac/nsWidgetFactory.cpp +++ b/widget/src/mac/nsWidgetFactory.cpp @@ -66,31 +66,9 @@ #include "nsNativeThemeMac.h" #include "nsScreenManagerMac.h" -#if USE_NATIVE_VERSION - -#include "nsIButton.h" -#include "nsITextWidget.h" - -#include "nsButton.h" -#include "nsCheckButton.h" -#include "nsTextWidget.h" -#include "nsLabel.h" - -#endif - NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker) -#if USE_NATIVE_VERSION -NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCheckButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsComboBox) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsRadioButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsListBox) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextAreaWidget) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextWidget) // used by Viewer? -#endif NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell) NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) @@ -111,20 +89,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerMac) static const nsModuleComponentInfo gComponents[] = { -#if USE_NATIVE_VERSION - { "Text Field", - NS_TEXTFIELD_CID, - "@mozilla.org/widgets/textwidget/mac;1", - nsTextWidgetConstructor }, - { "Label", - NS_LABEL_CID, - "@mozilla.org/widget/label/mac;1", - nsLabelConstructor }, - { "Button", - NS_BUTTON_CID, - "@mozilla.org/widgets/button/mac;1", - nsButtonConstructor }, -#endif { "nsWindow", NS_WINDOW_CID, "@mozilla.org/widgets/window/mac;1", diff --git a/widget/src/support/nsWidgetSupport.cpp b/widget/src/support/nsWidgetSupport.cpp index c3625b12c59..3f22b686afd 100644 --- a/widget/src/support/nsWidgetSupport.cpp +++ b/widget/src/support/nsWidgetSupport.cpp @@ -37,11 +37,7 @@ #include "nsWidgetSupport.h" #include "nsRect.h" -#include "nsIButton.h" -#include "nsITextWidget.h" -#include "nsILabel.h" #include "nsIWidget.h" -#include "nsICheckButton.h" #ifdef XP_MAC #define WIDGET_SUPPORT_EXPORT(returnType) \ @@ -51,94 +47,6 @@ returnType #endif -WIDGET_SUPPORT_EXPORT(nsresult) -NS_CreateButton(nsISupports* aParent, - nsIButton* aButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsCOMPtr parent = do_QueryInterface(aParent); - if (parent) { - nsCOMPtr widget = do_QueryInterface(aButton); - if (widget) { - widget->Create(parent, aRect, aHandleEventFunction, nsnull); - widget->Show(PR_TRUE); - if (aFont) { - widget->SetFont(*aFont); - } - } - } - - return NS_OK; -} - -WIDGET_SUPPORT_EXPORT(nsresult) -NS_CreateCheckButton(nsISupports* aParent, - nsICheckButton* aCheckButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsCOMPtr parent = do_QueryInterface(aParent); - if (parent) { - nsCOMPtr widget = do_QueryInterface(aCheckButton); - if (widget) { - widget->Create(parent, aRect, aHandleEventFunction, nsnull); - widget->Show(PR_TRUE); - if (aFont) { - widget->SetFont(*aFont); - } - } - } - - return NS_OK; -} - -WIDGET_SUPPORT_EXPORT(nsresult) -NS_CreateLabel(nsISupports* aParent, - nsILabel* aLabel, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsCOMPtr parent = do_QueryInterface(aParent); - if (parent) { - nsCOMPtr widget = do_QueryInterface(aLabel); - if (widget) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont) { - widget->SetFont(*aFont); - } - } - } - - return NS_OK; -} - -WIDGET_SUPPORT_EXPORT(nsresult) -NS_CreateTextWidget(nsISupports* aParent, - nsITextWidget* aWidget, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont) -{ - nsCOMPtr parent = do_QueryInterface(aParent); - if (parent) { - nsCOMPtr widget = do_QueryInterface(aWidget); - if (widget) { - widget->Create(parent, aRect, aHandleEventFunction, NULL); - widget->Show(PR_TRUE); - if (aFont) { - widget->SetFont(*aFont); - } - } - } - - return NS_OK; -} - WIDGET_SUPPORT_EXPORT(nsresult) NS_ShowWidget(nsISupports* aWidget, PRBool aShow) { diff --git a/widget/src/support/nsWidgetSupport.h b/widget/src/support/nsWidgetSupport.h index c840abf7944..00f39213b4a 100644 --- a/widget/src/support/nsWidgetSupport.h +++ b/widget/src/support/nsWidgetSupport.h @@ -45,16 +45,12 @@ struct nsRect; class nsIAppShell; -class nsIButton; class nsIEventListener; -class nsILabel; class nsILookAndFeel; class nsIMouseListener; class nsIToolkit; class nsIWidget; -class nsICheckButton; class nsITooltipWidget; -class nsITextWidget; #if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA) // A top-level widget stores a reference to itself as a window property @@ -66,46 +62,6 @@ enum { }; #endif -// These are a series of support methods which help in the creation -// of widgets. They are not needed, but are provided as a convenience -// mechanism when creating widgets - -extern nsresult -NS_CreateButton( nsISupports* aParent, - nsIButton* aButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont = nsnull); - -extern nsresult -NS_CreateCheckButton( nsISupports* aParent, - nsICheckButton* aCheckButton, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont = nsnull); - -extern nsresult -NS_CreateLabel( nsISupports* aParent, - nsILabel* aLabel, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont = nsnull); - -extern nsresult -NS_CreateTextWidget(nsISupports* aParent, - nsITextWidget* aWidget, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont = nsnull); - -extern nsresult -NS_CreateTooltipWidget(nsISupports* aParent, - nsITooltipWidget* aWidget, - const nsRect& aRect, - EVENT_CALLBACK aHandleEventFunction, - const nsFont* aFont = nsnull); - - extern nsresult NS_ShowWidget(nsISupports* aWidget, PRBool aShow); diff --git a/widget/src/xlib/Makefile.in b/widget/src/xlib/Makefile.in index 5bf3f61c51b..e69de29bb2d 100644 --- a/widget/src/xlib/Makefile.in +++ b/widget/src/xlib/Makefile.in @@ -1,111 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Roland Mainz -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = widget -LIBRARY_NAME = widget_xlib -EXPORT_LIBRARY = 1 -IS_COMPONENT = 1 -MODULE_NAME = nsWidgetXLIBModule -GRE_MODULE = 1 -LIBXUL_LIBRARY = 1 - -PACKAGE_FILE = widget_xlib.pkg - -REQUIRES = xpcom \ - string \ - appshell \ - gfx \ - layout \ - content \ - dom \ - js \ - xlibrgb \ - uconv \ - pref \ - webshell \ - htmlparser \ - view \ - necko \ - $(NULL) - -CPPSRCS = \ - nsAppShell.cpp \ - nsBidiKeyboard.cpp \ - nsButton.cpp \ - nsCheckButton.cpp \ - nsClipboard.cpp \ - nsDragService.cpp \ - nsKeyCode.cpp \ - nsLabel.cpp \ - nsLookAndFeel.cpp \ - nsScreenXlib.cpp \ - nsScreenManagerXlib.cpp \ - nsSound.cpp \ - nsTextHelper.cpp \ - nsTextWidget.cpp \ - nsToolkit.cpp \ - nsWidget.cpp \ - nsWidgetFactory.cpp \ - nsWindow.cpp \ - nsXUtils.cpp \ - $(NULL) - -SHARED_LIBRARY_LIBS = $(DIST)/lib/libxpwidgets_s.a - -include $(topsrcdir)/config/rules.mk - -EXTRA_DSO_LDOPTS += -L$(DIST)/bin -L$(DIST)/lib -lgkgfx $(MOZ_COMPONENT_LIBS) - -EXTRA_DSO_LDOPTS += -L$(DIST)/bin -lXt -lxlibrgb -lxlibxtbin $(MOZ_XLIB_LDFLAGS) - -CXXFLAGS += $(MOZ_XLIB_CFLAGS) - -DEFINES += -D_IMPL_NS_WIDGET - -LOCAL_INCLUDES = \ - -I$(srcdir)/../xpwidgets \ - -I$(srcdir) \ - $(NULL) - diff --git a/widget/src/xlib/nsButton.cpp b/widget/src/xlib/nsButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsButton.h b/widget/src/xlib/nsButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsCheckButton.cpp b/widget/src/xlib/nsCheckButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsCheckButton.h b/widget/src/xlib/nsCheckButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsLabel.cpp b/widget/src/xlib/nsLabel.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsLabel.h b/widget/src/xlib/nsLabel.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsTextHelper.cpp b/widget/src/xlib/nsTextHelper.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsTextHelper.h b/widget/src/xlib/nsTextHelper.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsTextWidget.cpp b/widget/src/xlib/nsTextWidget.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsTextWidget.h b/widget/src/xlib/nsTextWidget.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/xlib/nsWidgetFactory.cpp b/widget/src/xlib/nsWidgetFactory.cpp index 9068e175666..e69de29bb2d 100644 --- a/widget/src/xlib/nsWidgetFactory.cpp +++ b/widget/src/xlib/nsWidgetFactory.cpp @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Peter Hartshorn - * Ken Faulkner - * Dan Rosen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIGenericFactory.h" -#include "nsIModule.h" -#include "nsCOMPtr.h" -#include "nsWidgetsCID.h" - -#include "nsWindow.h" -#include "nsButton.h" -#include "nsCheckButton.h" -#include "nsTextWidget.h" -#include "nsAppShell.h" -#include "nsToolkit.h" -#include "nsLookAndFeel.h" -#include "nsLabel.h" -#include "nsTransferable.h" -#include "nsClipboard.h" -#include "nsClipboardHelper.h" -#include "nsHTMLFormatConverter.h" -#include "nsDragService.h" -#include "nsSound.h" -#include "nsScreenManagerXlib.h" - -#include "nsBidiKeyboard.h" - -NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCheckButton) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextWidget) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerXlib) - -static const nsModuleComponentInfo components[] = -{ - { "Xlib nsWindow", - NS_WINDOW_CID, - "@mozilla.org/widgets/window/xlib;1", - nsWindowConstructor }, - { "Xlib Child nsWindow", - NS_CHILD_CID, - "@mozilla.org/widgets/child_window/xlib;1", - ChildWindowConstructor }, - { "Xlib Button", - NS_BUTTON_CID, - "@mozilla.org/widgets/button/xlib;1", - nsButtonConstructor }, - { "Xlib Check Button", - NS_CHECKBUTTON_CID, - "@mozilla.org/widgets/checkbutton/xlib;1", - nsCheckButtonConstructor }, - { "Xlib Text Widget", - NS_TEXTFIELD_CID, - "@mozilla.org/widgets/textwidget/xlib;1", - nsTextWidgetConstructor }, - { "Xlib AppShell", - NS_APPSHELL_CID, - "@mozilla.org/widget/appshell/xlib;1", - nsAppShellConstructor }, - { "Xlib Toolkit", - NS_TOOLKIT_CID, - "@mozilla.org/widget/toolkit/xlib;1", - nsToolkitConstructor }, - { "Xlib Look And Feel", - NS_LOOKANDFEEL_CID, - "@mozilla.org/widget/lookandfeel;1", - nsLookAndFeelConstructor }, - { "Xlib Label", - NS_LABEL_CID, - "@mozilla.org/widget/label/xlib;1", - nsLabelConstructor }, - { "Xlib Sound", - NS_SOUND_CID, - "@mozilla.org/sound;1", - nsSoundConstructor }, - { "Transferrable", - NS_TRANSFERABLE_CID, - // "@mozilla.org/widget/transferrable/xlib;1", - "@mozilla.org/widget/transferable;1", - nsTransferableConstructor }, - { "Xlib Clipboard", - NS_CLIPBOARD_CID, - // "@mozilla.org/widget/clipboard/xlib;1", - "@mozilla.org/widget/clipboard;1", - nsClipboardConstructor }, - { "Clipboard Helper", - NS_CLIPBOARDHELPER_CID, - "@mozilla.org/widget/clipboardhelper;1", - nsClipboardHelperConstructor }, - { "HTML Format Converter", - NS_HTMLFORMATCONVERTER_CID, - "@mozilla.org/widget/htmlformatconverter;1", - nsHTMLFormatConverterConstructor }, - { "Xlib Drag Service", - NS_DRAGSERVICE_CID, - // "@mozilla.org/widget/dragservice/xlib;1", - "@mozilla.org/widget/dragservice;1", - nsDragServiceConstructor }, - { "Xlib Bidi Keyboard", - NS_BIDIKEYBOARD_CID, - "@mozilla.org/widget/bidikeyboard;1", - nsBidiKeyboardConstructor }, - { "Xlib Screen Manager", - NS_SCREENMANAGER_CID, - "@mozilla.org/gfx/screenmanager;1", - nsScreenManagerXlibConstructor } -}; - -PR_STATIC_CALLBACK(void) -nsWidgetXLIBModuleDtor(nsIModule *self) -{ - nsClipboard::Shutdown(); -} - -NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetXLIBModule, - components, - nsWidgetXLIBModuleDtor)