diff --git a/webshell/embed/gtk/lib/nsSetupRegistry.cpp b/webshell/embed/gtk/lib/nsSetupRegistry.cpp index b54653d5be4..6d104140632 100644 --- a/webshell/embed/gtk/lib/nsSetupRegistry.cpp +++ b/webshell/embed/gtk/lib/nsSetupRegistry.cpp @@ -56,6 +56,8 @@ #include "nsIGenericFactory.h" #include "nsGfxCIID.h" +#include "nsISound.h" + #include "prprf.h" #include "prmem.h" @@ -196,6 +198,8 @@ static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID); static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID); static NS_DEFINE_IID(kCContextMenuCID, NS_CONTEXTMENU_CID); //static NS_DEFINE_IID(kCXULCommandCID, NS_XULCOMMAND_CID); +static NS_DEFINE_IID(kSoundCID, NS_SOUND_CID); + static NS_DEFINE_IID(kUnicharUtilCID, NS_UNICHARUTIL_CID); @@ -266,4 +270,6 @@ NS_SetupRegistry() nsComponentManager::RegisterComponent(kCMenuCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kCMenuItemCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kCContextMenuCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); + + nsComponentManager::RegisterComponent(kSoundCID, "Sound Services", "component://netscape/sound", WIDGET_DLL, PR_FALSE, PR_FALSE); } diff --git a/webshell/tests/viewer/nsSetupRegistry.cpp b/webshell/tests/viewer/nsSetupRegistry.cpp index 294518e6709..265fa00dc37 100644 --- a/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/webshell/tests/viewer/nsSetupRegistry.cpp @@ -47,6 +47,8 @@ #include "nsIGenericFactory.h" #include "nsGfxCIID.h" +#include "nsISound.h" + #include "prprf.h" #include "prmem.h" @@ -131,6 +133,7 @@ static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID); static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID); static NS_DEFINE_IID(kCContextMenuCID, NS_CONTEXTMENU_CID); //static NS_DEFINE_IID(kCXULCommandCID, NS_XULCOMMAND_CID); +static NS_DEFINE_IID(kSoundCID, NS_SOUND_CID); // GFXWIN static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); @@ -209,6 +212,7 @@ NS_SetupRegistry() nsComponentManager::RegisterComponent(kCMenuCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kCMenuItemCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponent(kCContextMenuCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); + nsComponentManager::RegisterComponent(kSoundCID, "Sound Services", "component://netscape/sound", WIDGET_DLL, PR_FALSE, PR_FALSE); // GFXWIN nsComponentManager::RegisterComponent(kCRenderingContextIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE); diff --git a/widget/macbuild/widget.mcp b/widget/macbuild/widget.mcp index 754938b973a..e8f3dae6dc9 100644 Binary files a/widget/macbuild/widget.mcp and b/widget/macbuild/widget.mcp differ diff --git a/widget/macbuild/widgetIDL.mcp b/widget/macbuild/widgetIDL.mcp index 3cf0938029a..1b27a4356b0 100644 Binary files a/widget/macbuild/widgetIDL.mcp and b/widget/macbuild/widgetIDL.mcp differ diff --git a/widget/public/MANIFEST_IDL b/widget/public/MANIFEST_IDL index 99797d1554c..e1fd5e2aa99 100644 --- a/widget/public/MANIFEST_IDL +++ b/widget/public/MANIFEST_IDL @@ -2,4 +2,5 @@ # This is a list of local files which get copied to the mozilla:dist:idl directory # -nsIFileSpecWithUI.idl \ No newline at end of file +nsIFileSpecWithUI.idl +nsISound.idl \ No newline at end of file diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index 63262791e93..7c73ad14ab7 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -83,6 +83,9 @@ EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) MODULE = raptor XPILD_MODULE = widget +XPIDLSRCS = nsISound.idl \ + $(NULL) + include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk diff --git a/widget/public/makefile.win b/widget/public/makefile.win index 9c11210983d..669bf1766a8 100644 --- a/widget/public/makefile.win +++ b/widget/public/makefile.win @@ -22,6 +22,9 @@ DEFINES=-D_IMPL_NS_UI MODULE=raptor XPIDL_MODULE=widget +XPIDLSRCS = .\nsISound.idl \ + $(NULL) + EXPORTS=nsui.h \ nsIFontSizeIterator.h \ nsIFontNameIterator.h \ diff --git a/widget/src/build/nsGTKWidgetFactory.cpp b/widget/src/build/nsGTKWidgetFactory.cpp index 9f721673a21..73f88edcfa1 100644 --- a/widget/src/build/nsGTKWidgetFactory.cpp +++ b/widget/src/build/nsGTKWidgetFactory.cpp @@ -49,6 +49,8 @@ #include "nsXIFFormatConverter.h" #include "nsDragService.h" +#include "nsISound.h" + static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); static NS_DEFINE_IID(kCChild, NS_CHILD_CID); static NS_DEFINE_IID(kCButton, NS_BUTTON_CID); @@ -84,6 +86,9 @@ static NS_DEFINE_IID(kCDragService, NS_DRAGSERVICE_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); +// Sound services (just Beep for now) +static NS_DEFINE_CID(kCSound, NS_SOUND_CID); + class nsWidgetFactory : public nsIFactory { @@ -225,6 +230,11 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCPopUpMenu)) { inst = (nsISupports*)new nsPopUpMenu(); } + else if (mClassID.Equals(kCSound)) { + nsISound* aSound = nsnull; + NS_NewSound(&aSound); + inst = (nsISupports*) aSound; + } else if (mClassID.Equals(kCTransferable)) { inst = (nsISupports*)new nsTransferable(); } diff --git a/widget/src/build/nsWinWidgetFactory.cpp b/widget/src/build/nsWinWidgetFactory.cpp index 0c46b547721..5ac7b89339a 100644 --- a/widget/src/build/nsWinWidgetFactory.cpp +++ b/widget/src/build/nsWinWidgetFactory.cpp @@ -53,6 +53,8 @@ #include "nsDragService.h" #include "nsFileListTransferable.h" +#include "nsISound.h" + static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); static NS_DEFINE_IID(kCChild, NS_CHILD_CID); static NS_DEFINE_IID(kCButton, NS_BUTTON_CID); @@ -89,6 +91,9 @@ static NS_DEFINE_IID(kCFileListTransferable, NS_FILELISTTRANSFERABLE_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); +// Sound services (just Beep for now) +static NS_DEFINE_CID(kCSound, NS_SOUND_CID); + class nsWidgetFactory : public nsIFactory { public: @@ -231,6 +236,11 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter, else if (mClassID.Equals(kCPopUpMenu)) { inst = (nsISupports*)new nsPopUpMenu(); } + else if (mClassID.Equals(kCSound)) { + nsISound* aSound = nsnull; + NS_NewSound(&aSound); + inst = (nsISupports*) aSound; + } else if (mClassID.Equals(kCTransferable)) { inst = (nsISupports*)new nsTransferable(); } diff --git a/widget/src/mac/nsWidgetFactory.cpp b/widget/src/mac/nsWidgetFactory.cpp index 40035185f4e..084db9b0fab 100644 --- a/widget/src/mac/nsWidgetFactory.cpp +++ b/widget/src/mac/nsWidgetFactory.cpp @@ -50,6 +50,8 @@ #include "nsIComponentManager.h" +#include "nsISound.h" + // NOTE the following does not match MAC_STATIC actually used below in this file! #define MACSTATIC @@ -87,6 +89,9 @@ static NS_DEFINE_IID(kCTransferable, NS_TRANSFERABLE_CID); static NS_DEFINE_IID(kCXIFFormatConverter, NS_XIFFORMATCONVERTER_CID); static NS_DEFINE_IID(kCDragService, NS_DRAGSERVICE_CID); +// Sound services (just Beep for now) +static NS_DEFINE_CID(kCSound, NS_SOUND_CID); + //------------------------------------------------------------------------- // @@ -249,6 +254,11 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, // inst = (nsISupports*)new nsPopUpMenu(); NS_NOTYETIMPLEMENTED("nsPopUpMenu"); } + else if (mClassID.Equals(kCSound)) { + nsISound* aSound = nsnull; + NS_NewSound(&aSound); + inst = (nsISupports*) aSound; + } else if (mClassID.Equals(kCTransferable)) { inst = (nsISupports*)new nsTransferable(); }