From 71a47fb75ee62c9ea97f0d5d6a71b166c6b0c0ae Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Sat, 29 Jan 2005 02:09:21 +0000 Subject: [PATCH] Remove obsolete native widget files, and do some minor cleanup. Bug 279510, r=pinkerton --- widget/src/cocoa/nsNativeScrollbar.mm | 5 +- widget/src/cocoa/nsWidgetFactory.mm | 33 ++++------- widget/src/mac/Makefile.in | 9 +-- widget/src/mac/nsButton.cpp | 0 widget/src/mac/nsButton.h | 0 widget/src/mac/nsCheckButton.cpp | 0 widget/src/mac/nsCheckButton.h | 0 widget/src/mac/nsFilePicker.cpp | 1 - widget/src/mac/nsLabel.cpp | 0 widget/src/mac/nsLabel.h | 0 widget/src/mac/nsMacWindow.cpp | 9 +-- widget/src/mac/nsNativeScrollbar.h | 1 - widget/src/mac/nsTextHelper.cpp | 0 widget/src/mac/nsTextHelper.h | 0 widget/src/mac/nsTextWidget.cpp | 0 widget/src/mac/nsTextWidget.h | 0 widget/src/mac/nsWidgetFactory.cpp | 82 +++++++++++++-------------- 17 files changed, 56 insertions(+), 84 deletions(-) delete mode 100644 widget/src/mac/nsButton.cpp delete mode 100644 widget/src/mac/nsButton.h delete mode 100644 widget/src/mac/nsCheckButton.cpp delete mode 100644 widget/src/mac/nsCheckButton.h delete mode 100644 widget/src/mac/nsLabel.cpp delete mode 100644 widget/src/mac/nsLabel.h delete mode 100644 widget/src/mac/nsTextHelper.cpp delete mode 100644 widget/src/mac/nsTextHelper.h delete mode 100644 widget/src/mac/nsTextWidget.cpp delete mode 100644 widget/src/mac/nsTextWidget.h diff --git a/widget/src/cocoa/nsNativeScrollbar.mm b/widget/src/cocoa/nsNativeScrollbar.mm index 1ebb2742c63..d9f0dab1035 100644 --- a/widget/src/cocoa/nsNativeScrollbar.mm +++ b/widget/src/cocoa/nsNativeScrollbar.mm @@ -36,11 +36,10 @@ * ***** END LICENSE BLOCK ***** */ +#include + #include "nsNativeScrollbar.h" #include "nsIDeviceContext.h" -#if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330) -#include -#endif #include "nsReadableUtils.h" #include "nsWidgetAtoms.h" diff --git a/widget/src/cocoa/nsWidgetFactory.mm b/widget/src/cocoa/nsWidgetFactory.mm index a23acb8871d..66be2910aaf 100644 --- a/widget/src/cocoa/nsWidgetFactory.mm +++ b/widget/src/cocoa/nsWidgetFactory.mm @@ -37,6 +37,9 @@ #include "nsIFactory.h" #include "nsISupports.h" +#include "nsIComponentManager.h" +#include "nsIGenericFactory.h" + #include "nsWidgetsCID.h" #include "nsToolkit.h" @@ -49,10 +52,6 @@ #include "nsMenuX.h" #include "nsMenuItemX.h" -#define nsMenuBar nsMenuBarX -#define nsMenu nsMenuX -#define nsMenuItem nsMenuItemX - #include "nsClipboard.h" #include "nsClipboardHelper.h" #include "nsTransferable.h" @@ -60,34 +59,24 @@ #include "nsDragService.h" #include "nsDragHelperService.h" -#if USE_NATIVE_VERSION -# include "nsCheckButton.h" -#endif - #include "nsLookAndFeel.h" -#include "nsIComponentManager.h" - #include "nsSound.h" #include "nsNativeScrollbar.h" #include "nsBidiKeyboard.h" - -#include "nsIGenericFactory.h" - NS_GENERIC_FACTORY_CONSTRUCTOR(nsCocoaWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildView) NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellCocoa) NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuBar) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenu) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuItem) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuBarX) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuX) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuItemX) NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeScrollbar) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) -//NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileSpecWithUIImpl) NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) @@ -96,7 +85,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragHelperService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) -static nsModuleComponentInfo components[] = +static const nsModuleComponentInfo gComponents[] = { { "nsWindow", NS_WINDOW_CID, @@ -129,15 +118,15 @@ static nsModuleComponentInfo components[] = { "Menubar", NS_MENUBAR_CID, "@mozilla.org/widget/menubar/mac;1", - nsMenuBarConstructor }, + nsMenuBarXConstructor }, { "Menu", NS_MENU_CID, "@mozilla.org/widget/menu/mac;1", - nsMenuConstructor }, + nsMenuXConstructor }, { "MenuItem", NS_MENUITEM_CID, "@mozilla.org/widget/menuitem/mac;1", - nsMenuItemConstructor }, + nsMenuItemXConstructor }, { "Sound", NS_SOUND_CID, "@mozilla.org/sound;1", @@ -176,4 +165,4 @@ static nsModuleComponentInfo components[] = nsNativeScrollbarConstructor } }; -NS_IMPL_NSGETMODULE(nsWidgetMacModule, components) +NS_IMPL_NSGETMODULE(nsWidgetMacModule, gComponents) diff --git a/widget/src/mac/Makefile.in b/widget/src/mac/Makefile.in index 044919237f4..528c0032a8d 100644 --- a/widget/src/mac/Makefile.in +++ b/widget/src/mac/Makefile.in @@ -82,18 +82,15 @@ GFX_LCPPSRCS = \ nsWatchTask.cpp \ $(NULL) -CPPSRCS = nsAppShell.cpp \ +CPPSRCS = nsAppShell.cpp \ nsBidiKeyboard.cpp \ - nsButton.cpp \ nsChildWindow.cpp \ nsClipboard.cpp \ nsDeleteObserver.cpp \ nsDragService.cpp \ nsDragHelperService.cpp \ nsFilePicker.cpp \ - nsLabel.cpp \ nsLookAndFeel.cpp \ - nsMacControl.cpp \ nsMacEventHandler.cpp \ nsMacMessagePump.cpp \ nsMacResources.cpp \ @@ -103,9 +100,7 @@ CPPSRCS = nsAppShell.cpp \ nsMenuBarX.cpp \ nsMenuItemX.cpp \ nsMimeMapper.cpp \ - nsNativeScrollbar.cpp \ nsSound.cpp \ - nsTextWidget.cpp \ nsTSMStrategy.cpp \ nsToolkitBase.cpp \ nsToolkit.cpp \ @@ -113,6 +108,8 @@ CPPSRCS = nsAppShell.cpp \ nsWindow.cpp \ nsMacNativeUnicodeConverter.cpp \ nsStylClipboardUtils.cpp \ + nsMacControl.cpp \ + nsNativeScrollbar.cpp \ $(GFX_LCPPSRCS) \ $(NULL) diff --git a/widget/src/mac/nsButton.cpp b/widget/src/mac/nsButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsButton.h b/widget/src/mac/nsButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsCheckButton.cpp b/widget/src/mac/nsCheckButton.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsCheckButton.h b/widget/src/mac/nsCheckButton.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsFilePicker.cpp b/widget/src/mac/nsFilePicker.cpp index f43a7c7ac01..d26f4ff84b3 100644 --- a/widget/src/mac/nsFilePicker.cpp +++ b/widget/src/mac/nsFilePicker.cpp @@ -53,7 +53,6 @@ #include -#include "nsMacControl.h" #include "nsCarbonHelpers.h" #include "nsFilePicker.h" diff --git a/widget/src/mac/nsLabel.cpp b/widget/src/mac/nsLabel.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsLabel.h b/widget/src/mac/nsLabel.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsMacWindow.cpp b/widget/src/mac/nsMacWindow.cpp index f6f30fcf2b4..32a27986de1 100644 --- a/widget/src/mac/nsMacWindow.cpp +++ b/widget/src/mac/nsMacWindow.cpp @@ -37,7 +37,6 @@ #include "nsMacWindow.h" #include "nsMacEventHandler.h" -#include "nsMacControl.h" #include "nsToolkit.h" #include "nsIServiceManager.h" // for drag and drop @@ -1485,18 +1484,12 @@ NS_IMETHODIMP nsMacWindow::SetTitle(const nsAString& aTitle) { nsAString::const_iterator begin; const PRUnichar *strTitle = aTitle.BeginReading(begin).get(); - // Try to use the unicode friendly CFString version first CFStringRef labelRef = ::CFStringCreateWithCharacters(kCFAllocatorDefault, (UniChar*)strTitle, aTitle.Length()); - if(labelRef) { + if (labelRef) { ::SetWindowTitleWithCFString(mWindowPtr, labelRef); ::CFRelease(labelRef); - return NS_OK; } - Str255 title; - // unicode to file system charset - nsMacControl::StringToStr255(aTitle, title); - ::SetWTitle(mWindowPtr, title); return NS_OK; } diff --git a/widget/src/mac/nsNativeScrollbar.h b/widget/src/mac/nsNativeScrollbar.h index 850e9448760..532d222930f 100644 --- a/widget/src/mac/nsNativeScrollbar.h +++ b/widget/src/mac/nsNativeScrollbar.h @@ -45,7 +45,6 @@ #include "nsIContent.h" class nsIScrollbarMediator; -class StControlProcSingleton5; // diff --git a/widget/src/mac/nsTextHelper.cpp b/widget/src/mac/nsTextHelper.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsTextHelper.h b/widget/src/mac/nsTextHelper.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsTextWidget.cpp b/widget/src/mac/nsTextWidget.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsTextWidget.h b/widget/src/mac/nsTextWidget.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/mac/nsWidgetFactory.cpp b/widget/src/mac/nsWidgetFactory.cpp index fac2602e6a7..c0cc96686d7 100644 --- a/widget/src/mac/nsWidgetFactory.cpp +++ b/widget/src/mac/nsWidgetFactory.cpp @@ -38,28 +38,21 @@ #include "nsIFactory.h" #include "nsISupports.h" -#include "nsIButton.h" -#include "nsITextWidget.h" +#include "nsIComponentManager.h" +#include "nsIGenericFactory.h" + #include "nsWidgetsCID.h" #include "nsToolkit.h" #include "nsWindow.h" #include "nsMacWindow.h" #include "nsAppShell.h" -#include "nsButton.h" -#include "nsTextWidget.h" -#include "nsLabel.h" #include "nsFilePicker.h" #include "nsNativeScrollbar.h" - #include "nsMenuBarX.h" #include "nsMenuX.h" #include "nsMenuItemX.h" -#define nsMenuBar nsMenuBarX -#define nsMenu nsMenuX -#define nsMenuItem nsMenuItemX - #include "nsClipboard.h" #include "nsClipboardHelper.h" @@ -67,40 +60,41 @@ #include "nsHTMLFormatConverter.h" #include "nsDragService.h" #include "nsDragHelperService.h" - -#if USE_NATIVE_VERSION -# include "nsCheckButton.h" -#endif - #include "nsLookAndFeel.h" - -#include "nsIComponentManager.h" - #include "nsSound.h" - #include "nsBidiKeyboard.h" -#include "nsIGenericFactory.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(nsButton) 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) -#endif +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) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuBar) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenu) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuItem) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuBarX) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuX) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMenuItemX) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) @@ -111,8 +105,22 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragHelperService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeScrollbar) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) -static const nsModuleComponentInfo components[] = +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", @@ -125,18 +133,10 @@ static const nsModuleComponentInfo components[] = NS_CHILD_CID, "@mozilla.org/widgets/child_window/mac;1", ChildWindowConstructor }, - { "Button", - NS_BUTTON_CID, - "@mozilla.org/widgets/button/mac;1", - nsButtonConstructor }, { "File Picker", NS_FILEPICKER_CID, "@mozilla.org/filepicker;1", nsFilePickerConstructor }, - { "Text Field", - NS_TEXTFIELD_CID, - "@mozilla.org/widgets/textwidget/mac;1", - nsTextWidgetConstructor }, { "AppShell", NS_APPSHELL_CID, "@mozilla.org/widget/appshell/mac;1", @@ -149,22 +149,18 @@ static const nsModuleComponentInfo components[] = NS_LOOKANDFEEL_CID, "@mozilla.org/widget/lookandfeel;1", nsLookAndFeelConstructor }, - { "Label", - NS_LABEL_CID, - "@mozilla.org/widget/label/mac;1", - nsLabelConstructor }, { "Menubar", NS_MENUBAR_CID, "@mozilla.org/widget/menubar/mac;1", - nsMenuBarConstructor }, + nsMenuBarXConstructor }, { "Menu", NS_MENU_CID, "@mozilla.org/widget/menu/mac;1", - nsMenuConstructor }, + nsMenuXConstructor }, { "MenuItem", NS_MENUITEM_CID, "@mozilla.org/widget/menuitem/mac;1", - nsMenuItemConstructor }, + nsMenuItemXConstructor }, { "Sound", NS_SOUND_CID, "@mozilla.org/sound;1", @@ -203,5 +199,5 @@ static const nsModuleComponentInfo components[] = nsBidiKeyboardConstructor }, }; -NS_IMPL_NSGETMODULE(nsWidgetMacModule, components) +NS_IMPL_NSGETMODULE(nsWidgetMacModule, gComponents)