diff --git a/mozilla/build/mac/NGLayoutBuildList.pm b/mozilla/build/mac/NGLayoutBuildList.pm index ee0b76e2c5a..2e05ce64b36 100644 --- a/mozilla/build/mac/NGLayoutBuildList.pm +++ b/mozilla/build/mac/NGLayoutBuildList.pm @@ -345,7 +345,6 @@ sub BuildDist() # XPAPPS InstallFromManifest(":mozilla:xpfe:AppCores:public:MANIFEST", "$distdirectory:xpfe:"); - InstallFromManifest(":mozilla:xpfe:appshell:public:MANIFEST", "$distdirectory:xpfe:"); #// To get out defines in all the project, dummy alias NGLayoutConfigInclude.h into MacConfigInclude.h MakeAlias(":mozilla:config:mac:NGLayoutConfigInclude.h", ":mozilla:dist:config:MacConfigInclude.h"); diff --git a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp index e1f394c04d1..b34462d0a5c 100644 --- a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp @@ -220,6 +220,7 @@ static NS_DEFINE_CID(kJVMManagerCID, NS_JVMMANAGER_CID); static NS_DEFINE_IID(kCMenuBarCID, NS_MENUBAR_CID); static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID); static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID); +static NS_DEFINE_IID(kCXULCommandCID, NS_XULCOMMAND_CID); static NS_DEFINE_IID(kStringBundleCID, NS_STRINGBUNDLE_CID); @@ -337,4 +338,5 @@ NS_SetupRegistry() nsRepository::RegisterFactory(kCMenuBarCID, WIDGET_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCMenuCID, WIDGET_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCMenuItemCID, WIDGET_DLL, PR_FALSE, PR_FALSE); + nsRepository::RegisterFactory(kCXULCommandCID, WIDGET_DLL, PR_FALSE, PR_FALSE); } diff --git a/mozilla/widget/macbuild/widget.mcp b/mozilla/widget/macbuild/widget.mcp index 7fe13649b08..6743e891250 100644 Binary files a/mozilla/widget/macbuild/widget.mcp and b/mozilla/widget/macbuild/widget.mcp differ diff --git a/mozilla/widget/public/MANIFEST b/mozilla/widget/public/MANIFEST index 63ab6b699dd..2f4812a2c68 100644 --- a/mozilla/widget/public/MANIFEST +++ b/mozilla/widget/public/MANIFEST @@ -43,3 +43,4 @@ nsIToolbarManagerListener.h nsIImageButton.h nsIImageButtonListener.h nsIContentConnector.h +nsIXULCommand.h diff --git a/mozilla/widget/public/Makefile.in b/mozilla/widget/public/Makefile.in index 6e9f6291f9f..04e996f0d1e 100644 --- a/mozilla/widget/public/Makefile.in +++ b/mozilla/widget/public/Makefile.in @@ -79,6 +79,7 @@ EXPORTS = \ nsIMenuButton.h \ nsIImageButtonListener.h \ nsIContentConnector.h \ + nsIXULCommand.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/widget/public/makefile.win b/mozilla/widget/public/makefile.win index 261b3cd64d7..3aaf3438006 100644 --- a/mozilla/widget/public/makefile.win +++ b/mozilla/widget/public/makefile.win @@ -30,7 +30,8 @@ EXPORTS=nsui.h nsIWidget.h nsIButton.h nsICheckButton.h nsIListWidget.h \ nsIDialog.h nsILabel.h nsWidgetSupport.h \ nsIMenuBar.h nsIMenu.h nsIMenuItem.h nsIToolbar.h nsIImageButton.h nsIToolbar.h \ nsIToolbarManager.h nsIToolbarManagerListener.h nsIToolbarItem.h nsIToolbarItemHolder.h \ - nsIPopUpMenu.h nsIMenuButton.h nsIImageButtonListener.h nsIContentConnector.h + nsIPopUpMenu.h nsIMenuButton.h nsIImageButtonListener.h nsIContentConnector.h \ + nsIXULCommand.h include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/widget/public/nsWidgetsCID.h b/mozilla/widget/public/nsWidgetsCID.h index 90854b9465a..db1bbc8dc23 100644 --- a/mozilla/widget/public/nsWidgetsCID.h +++ b/mozilla/widget/public/nsWidgetsCID.h @@ -177,3 +177,6 @@ #define NS_TREEVIEW_CID \ { 0xfaf80a1, 0x815c, 0x11d2, { 0x96, 0xed, 0x0, 0x10, 0x4b, 0x7b, 0x7d, 0xeb } } +#define NS_XULCOMMAND_CID \ + { 0xabf645a1, 0xb3d0, 0x11d2, { 0x9a, 0x42, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74}} + diff --git a/mozilla/widget/src/build/nsGTKWidgetFactory.cpp b/mozilla/widget/src/build/nsGTKWidgetFactory.cpp index d1decbd80d6..24636b7f400 100644 --- a/mozilla/widget/src/build/nsGTKWidgetFactory.cpp +++ b/mozilla/widget/src/build/nsGTKWidgetFactory.cpp @@ -49,6 +49,7 @@ #include "nsToolbar.h" #include "nsToolbarManager.h" #include "nsToolbarItemHolder.h" +#include "nsXULCommand.h" static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); static NS_DEFINE_IID(kCChild, NS_CHILD_CID); @@ -80,6 +81,7 @@ static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID); static NS_DEFINE_IID(kCPopUpMenu, NS_POPUPMENU_CID); static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID); static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_CID); +static NS_DEFINE_IID(kCXULCommand, NS_XULCOMMAND_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); @@ -228,6 +230,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCMenuItem)) { inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem(); } + else if (mClassID.Equals(kCXULCommand)) { + inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand(); + } else if (mClassID.Equals(kCImageButton)) { inst = (nsISupports*)(nsWidget *)new nsImageButton(); } diff --git a/mozilla/widget/src/build/nsMotifWidgetFactory.cpp b/mozilla/widget/src/build/nsMotifWidgetFactory.cpp index ef714c2cca5..41d8979b366 100644 --- a/mozilla/widget/src/build/nsMotifWidgetFactory.cpp +++ b/mozilla/widget/src/build/nsMotifWidgetFactory.cpp @@ -47,6 +47,7 @@ #include "nsToolbar.h" #include "nsToolbarManager.h" #include "nsToolbarItemHolder.h" +#include "nsXULCommand.h" @@ -86,6 +87,7 @@ static NS_DEFINE_IID(kCToolBar, NS_TOOLBAR_CID); static NS_DEFINE_IID(kCToolBarManager, NS_TOOLBARMANAGER_CID); static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID); static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID); +static NS_DEFINE_IID(kCXULCommand, NS_XULCOMMAND_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); @@ -215,6 +217,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCMenuItem)) { inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem(); } + else if (mClassID.Equals(kCXULCommand)) { + inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand(); + } else if (mClassID.Equals(kCImageButton)) { inst = (nsISupports*)(nsWindow*)new nsImageButton(); } diff --git a/mozilla/widget/src/build/nsWinWidgetFactory.cpp b/mozilla/widget/src/build/nsWinWidgetFactory.cpp index 9ed1cffba50..61333e7d631 100644 --- a/mozilla/widget/src/build/nsWinWidgetFactory.cpp +++ b/mozilla/widget/src/build/nsWinWidgetFactory.cpp @@ -51,6 +51,7 @@ #include "nsToolbarItemHolder.h" #include "nsAppShell.h" #include "nsIServiceManager.h" +#include "nsXULCommand.h" static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); static NS_DEFINE_IID(kCChild, NS_CHILD_CID); @@ -82,6 +83,7 @@ static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID); static NS_DEFINE_IID(kCPopUpMenu, NS_POPUPMENU_CID); static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID); static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_CID); +static NS_DEFINE_IID(kCXULCommand, NS_XULCOMMAND_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); @@ -228,6 +230,9 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter, else if (mClassID.Equals(kCMenuItem)) { inst = (nsISupports*)(nsIMenuItem*)new nsMenuItem(); } + else if (mClassID.Equals(kCXULCommand)) { + inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand(); + } else if (mClassID.Equals(kCImageButton)) { inst = (nsISupports*)(nsWindow*)new nsImageButton(); } diff --git a/mozilla/widget/src/mac/nsWidgetFactory.cpp b/mozilla/widget/src/mac/nsWidgetFactory.cpp index b1352c5c77a..86db2ac7f83 100644 --- a/mozilla/widget/src/mac/nsWidgetFactory.cpp +++ b/mozilla/widget/src/mac/nsWidgetFactory.cpp @@ -43,6 +43,7 @@ #include "nsTreeView.h" #include "nsToolbarManager.h" #include "nsToolbarItemHolder.h" +#include "nsXULCommand.h" #include "nsTextAreaWidget.h" @@ -82,6 +83,7 @@ static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID); static NS_DEFINE_IID(kCPopUpMenu, NS_POPUPMENU_CID); static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID); static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_CID); +static NS_DEFINE_IID(kCXULCommand, NS_XULCOMMAND_CID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); @@ -226,6 +228,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCMenuItem)) { inst = (nsISupports*)(nsIMenuItem*) new nsMenuItem(); } + else if (mClassID.Equals(kCXULCommand)) { + inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand(); + } else if (mClassID.Equals(kCImageButton)) { inst = (nsISupports*)(nsWindow*)new nsImageButton(); } diff --git a/mozilla/widget/src/xpwidgets/Makefile.in b/mozilla/widget/src/xpwidgets/Makefile.in index fd42561378f..b16b8aa2dda 100644 --- a/mozilla/widget/src/xpwidgets/Makefile.in +++ b/mozilla/widget/src/xpwidgets/Makefile.in @@ -28,7 +28,8 @@ LIBRARY_NAME = raptorbasewidget_s #MODULES=widget #LCFLAGS=-D_IMPL_NS_WIDGET -CPPSRCS=nsBaseWidget.cpp \ +CPPSRCS=nsXULCommand.cpp \ + nsBaseWidget.cpp \ nsMenuButton.cpp \ nsToolbarItemHolder.cpp \ nsToolbarManager.cpp \ diff --git a/mozilla/widget/src/xpwidgets/makefile.win b/mozilla/widget/src/xpwidgets/makefile.win index 98ddf596c7e..6e228cf5731 100644 --- a/mozilla/widget/src/xpwidgets/makefile.win +++ b/mozilla/widget/src/xpwidgets/makefile.win @@ -22,7 +22,7 @@ LIBRARY_NAME = raptorbasewidget_s REQUIRES=xpcom gfxwin raptor dom js DEFINES =-D_IMPL_NS_WIDGET -CPPSRCS = \ +CPPSRCS =nsXULCommand.cpp \ nsBaseWidget.cpp \ nsMenuButton.cpp \ nsToolbarItemHolder.cpp \ diff --git a/mozilla/xpfe/appshell/macbuild/AppShell.mcp b/mozilla/xpfe/appshell/macbuild/AppShell.mcp index 2cc6a3cd77a..a5f2ad5c732 100644 Binary files a/mozilla/xpfe/appshell/macbuild/AppShell.mcp and b/mozilla/xpfe/appshell/macbuild/AppShell.mcp differ diff --git a/mozilla/xpfe/appshell/public/Makefile.in b/mozilla/xpfe/appshell/public/Makefile.in index dca83496a2f..878785fc235 100644 --- a/mozilla/xpfe/appshell/public/Makefile.in +++ b/mozilla/xpfe/appshell/public/Makefile.in @@ -24,12 +24,10 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/config.mk EXPORTS = \ - nsIXULCommand.h \ nsAppShellCIDs.h \ nsIAppShellService.h \ nsICmdLineService.h \ nsIWidgetController.h \ - nsIXULCommand.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/xpfe/appshell/public/makefile.win b/mozilla/xpfe/appshell/public/makefile.win index d8d0cb9fe28..cf016fb7c3e 100644 --- a/mozilla/xpfe/appshell/public/makefile.win +++ b/mozilla/xpfe/appshell/public/makefile.win @@ -23,11 +23,9 @@ MODULE=raptor EXPORTS = \ nsAppShellCIDs.h \ - nsIXULCommand.h \ nsIAppShellService.h \ nsICmdLineService.h \ nsIWidgetController.h \ - nsIXULCommand.h \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpfe/appshell/src/Makefile.in b/mozilla/xpfe/appshell/src/Makefile.in index 528af77c8cf..1a201616ac7 100644 --- a/mozilla/xpfe/appshell/src/Makefile.in +++ b/mozilla/xpfe/appshell/src/Makefile.in @@ -28,7 +28,6 @@ LIBRARY_NAME = nsappshell MODULE=raptor CPPSRCS= \ - nsXULCommand.cpp \ nsAppShellService.cpp \ nsWebShellWindow.cpp \ nsAppShellFactory.cpp \ diff --git a/mozilla/xpfe/appshell/src/makefile.win b/mozilla/xpfe/appshell/src/makefile.win index 25d166c5876..bf8ce63cc46 100644 --- a/mozilla/xpfe/appshell/src/makefile.win +++ b/mozilla/xpfe/appshell/src/makefile.win @@ -22,7 +22,6 @@ DEFINES=-D_IMPL_NS_APPSHELL -DWIN32_LEAN_AND_MEAN MODULE=raptor CPPSRCS= \ - nsXULCommand.cpp \ nsAppShellService.cpp \ nsWebShellWindow.cpp \ nsAppShellFactory.cpp \ @@ -30,7 +29,6 @@ CPPSRCS= \ $(NULL) CPP_OBJS= \ - .\$(OBJDIR)\nsXULCommand.obj \ .\$(OBJDIR)\nsAppShellService.obj \ .\$(OBJDIR)\nsWebShellWindow.obj \ .\$(OBJDIR)\nsAppShellFactory.obj \ diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index b0abeb9ae84..59fb7c9fce8 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -33,8 +33,8 @@ #include "nsIWidgetController.h" #include "nsAppShellCIDs.h" -#include "nsXULCommand.h" #include "nsIXULCommand.h" +//#include "nsXULCommand.h" #include "nsIDOMCharacterData.h" #include "nsIMenuBar.h" @@ -60,6 +60,7 @@ static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID); static NS_DEFINE_IID(kMenuBarCID, NS_MENUBAR_CID); static NS_DEFINE_IID(kMenuCID, NS_MENU_CID); static NS_DEFINE_IID(kMenuItemCID, NS_MENUITEM_CID); +static NS_DEFINE_IID(kXULCommandCID, NS_XULCOMMAND_CID); /* Define Interface IDs */ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); @@ -410,6 +411,8 @@ nsCOMPtr nsWebShellWindow::FindNamedParentFromDoc(nsIDOMDocument * a //---------------------------------------- void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aDOMDoc) { + nsresult rv = NS_NOINTERFACE; + // locate the window element which holds toolbars and menus and commands nsCOMPtr window(FindNamedParentFromDoc(aDOMDoc, nsAutoString("window"))); if ( !window ) @@ -432,15 +435,29 @@ void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aD element->GetAttribute(nsAutoString("name"), name); element->GetAttribute(nsAutoString("onCommand"), value); + nsIXULCommand * xulCmdInterface = nsnull; + rv = nsRepository::CreateInstance(kXULCommandCID, nsnull, kIXULCommandIID, + (void**)&xulCmdInterface); + if (NS_OK != rv) { + // Error + } + xulCmdInterface->SetName(name);//nsIXULCommand + xulCmdInterface->SetCommand(value);//nsIXULCommand + xulCmdInterface->SetWebShell(aWebShell);// Added to nsIXULCommand + xulCmdInterface->SetDOMElement(element);// Added to nsIXULCommand + mCommands.AppendElement(xulCmdInterface); + + /* nsXULCommand * xulCmd = new nsXULCommand(); - xulCmd->SetName(name); - xulCmd->SetCommand(value); - xulCmd->SetWebShell(aWebShell); - xulCmd->SetDOMElement(element); + xulCmd->SetName(name);//nsIXULCommand + xulCmd->SetCommand(value);//nsIXULCommand + xulCmd->SetWebShell(aWebShell);// Added to nsIXULCommand + xulCmd->SetDOMElement(element);// Added to nsIXULCommand nsIXULCommand * icmd; if (NS_OK == xulCmd->QueryInterface(kIXULCommandIID, (void**) &icmd)) { mCommands.AppendElement(icmd); } + */ //printf("Commands[%s] value[%s]\n", nsAutoCString(name), nsAutoCString(value)); } } @@ -468,6 +485,21 @@ void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aD if (name.Equals(nsAutoString("BUTTON"))) ConnectCommandToOneGUINode(node, element, name); else if (name.Equals(nsAutoString("INPUT"))) { + nsIXULCommand * xulCmdInterface = nsnull; + rv = nsRepository::CreateInstance(kXULCommandCID, nsnull, kIXULCommandIID, + (void**)&xulCmdInterface); + if (NS_OK != rv) { + // Error + } + xulCmdInterface->SetName(name); + xulCmdInterface->SetCommand(value); + xulCmdInterface->SetWebShell(aWebShell); + xulCmdInterface->SetDOMElement(element); + + mCommands.AppendElement(xulCmdInterface); + + xulCmdInterface->AddUINode(node); + /* nsXULCommand * xulCmd = new nsXULCommand(); xulCmd->SetName(name); xulCmd->SetCommand(value); @@ -478,6 +510,7 @@ void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aD mCommands.AppendElement(icmd); } xulCmd->AddUINode(node); + */ //printf("Linking cmd to button [%s]\n", nsAutoCString(cmdName)); } } diff --git a/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp b/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp index 61977c19aa7..fbe68045232 100644 --- a/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp +++ b/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp @@ -143,6 +143,7 @@ static NS_DEFINE_IID(kCMenuBarCID, NS_MENUBAR_CID); static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID); static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID); static NS_DEFINE_IID(kCEditorCID, NS_EDITOR_CID); +static NS_DEFINE_IID(kCXULCommandCID, NS_XULCOMMAND_CID); extern "C" void NS_SetupRegistry() @@ -201,6 +202,7 @@ NS_SetupRegistry() nsRepository::RegisterFactory(kCMenuBarCID, WIDGET_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCMenuCID, WIDGET_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCMenuItemCID, WIDGET_DLL, PR_FALSE, PR_FALSE); + nsRepository::RegisterFactory(kCXULCommandCID, WIDGET_DLL, PR_FALSE, PR_FALSE); #ifndef XP_MAC // temporary nsRepository::RegisterFactory(kCEditorCID, EDITOR_DLL, PR_FALSE, PR_FALSE); #endif // XP_MAC