зеркало из https://github.com/mozilla/pjs.git
moving nsIXULCommand.h, nsXULCommand.h, and nsXULCommand.cpp to widget dll from appshell
This commit is contained in:
Родитель
700f97ef57
Коммит
a30a5837d2
|
@ -345,7 +345,6 @@ sub BuildDist()
|
||||||
|
|
||||||
# XPAPPS
|
# XPAPPS
|
||||||
InstallFromManifest(":mozilla:xpfe:AppCores:public:MANIFEST", "$distdirectory:xpfe:");
|
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
|
#// 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");
|
MakeAlias(":mozilla:config:mac:NGLayoutConfigInclude.h", ":mozilla:dist:config:MacConfigInclude.h");
|
||||||
|
|
|
@ -220,6 +220,7 @@ static NS_DEFINE_CID(kJVMManagerCID, NS_JVMMANAGER_CID);
|
||||||
static NS_DEFINE_IID(kCMenuBarCID, NS_MENUBAR_CID);
|
static NS_DEFINE_IID(kCMenuBarCID, NS_MENUBAR_CID);
|
||||||
static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID);
|
static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID);
|
||||||
static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_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);
|
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(kCMenuBarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
nsRepository::RegisterFactory(kCMenuCID, 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(kCMenuItemCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
|
nsRepository::RegisterFactory(kCXULCommandCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
Двоичные данные
widget/macbuild/widget.mcp
Двоичные данные
widget/macbuild/widget.mcp
Двоичный файл не отображается.
|
@ -43,3 +43,4 @@ nsIToolbarManagerListener.h
|
||||||
nsIImageButton.h
|
nsIImageButton.h
|
||||||
nsIImageButtonListener.h
|
nsIImageButtonListener.h
|
||||||
nsIContentConnector.h
|
nsIContentConnector.h
|
||||||
|
nsIXULCommand.h
|
||||||
|
|
|
@ -79,6 +79,7 @@ EXPORTS = \
|
||||||
nsIMenuButton.h \
|
nsIMenuButton.h \
|
||||||
nsIImageButtonListener.h \
|
nsIImageButtonListener.h \
|
||||||
nsIContentConnector.h \
|
nsIContentConnector.h \
|
||||||
|
nsIXULCommand.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||||
|
|
|
@ -30,7 +30,8 @@ EXPORTS=nsui.h nsIWidget.h nsIButton.h nsICheckButton.h nsIListWidget.h \
|
||||||
nsIDialog.h nsILabel.h nsWidgetSupport.h \
|
nsIDialog.h nsILabel.h nsWidgetSupport.h \
|
||||||
nsIMenuBar.h nsIMenu.h nsIMenuItem.h nsIToolbar.h nsIImageButton.h nsIToolbar.h \
|
nsIMenuBar.h nsIMenu.h nsIMenuItem.h nsIToolbar.h nsIImageButton.h nsIToolbar.h \
|
||||||
nsIToolbarManager.h nsIToolbarManagerListener.h nsIToolbarItem.h nsIToolbarItemHolder.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>
|
include <$(DEPTH)\config\rules.mak>
|
||||||
|
|
||||||
|
|
|
@ -177,3 +177,6 @@
|
||||||
#define NS_TREEVIEW_CID \
|
#define NS_TREEVIEW_CID \
|
||||||
{ 0xfaf80a1, 0x815c, 0x11d2, { 0x96, 0xed, 0x0, 0x10, 0x4b, 0x7b, 0x7d, 0xeb } }
|
{ 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}}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include "nsToolbar.h"
|
#include "nsToolbar.h"
|
||||||
#include "nsToolbarManager.h"
|
#include "nsToolbarManager.h"
|
||||||
#include "nsToolbarItemHolder.h"
|
#include "nsToolbarItemHolder.h"
|
||||||
|
#include "nsXULCommand.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
|
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
|
||||||
static NS_DEFINE_IID(kCChild, NS_CHILD_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(kCPopUpMenu, NS_POPUPMENU_CID);
|
||||||
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
||||||
static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_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(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||||
|
@ -228,6 +230,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
|
||||||
else if (mClassID.Equals(kCMenuItem)) {
|
else if (mClassID.Equals(kCMenuItem)) {
|
||||||
inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem();
|
inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem();
|
||||||
}
|
}
|
||||||
|
else if (mClassID.Equals(kCXULCommand)) {
|
||||||
|
inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand();
|
||||||
|
}
|
||||||
else if (mClassID.Equals(kCImageButton)) {
|
else if (mClassID.Equals(kCImageButton)) {
|
||||||
inst = (nsISupports*)(nsWidget *)new nsImageButton();
|
inst = (nsISupports*)(nsWidget *)new nsImageButton();
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include "nsToolbar.h"
|
#include "nsToolbar.h"
|
||||||
#include "nsToolbarManager.h"
|
#include "nsToolbarManager.h"
|
||||||
#include "nsToolbarItemHolder.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(kCToolBarManager, NS_TOOLBARMANAGER_CID);
|
||||||
static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID);
|
static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID);
|
||||||
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_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(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||||
|
@ -215,6 +217,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
|
||||||
else if (mClassID.Equals(kCMenuItem)) {
|
else if (mClassID.Equals(kCMenuItem)) {
|
||||||
inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem();
|
inst = (nsISupports*)(nsIMenuItem *)new nsMenuItem();
|
||||||
}
|
}
|
||||||
|
else if (mClassID.Equals(kCXULCommand)) {
|
||||||
|
inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand();
|
||||||
|
}
|
||||||
else if (mClassID.Equals(kCImageButton)) {
|
else if (mClassID.Equals(kCImageButton)) {
|
||||||
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "nsToolbarItemHolder.h"
|
#include "nsToolbarItemHolder.h"
|
||||||
#include "nsAppShell.h"
|
#include "nsAppShell.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
|
#include "nsXULCommand.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
|
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
|
||||||
static NS_DEFINE_IID(kCChild, NS_CHILD_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(kCPopUpMenu, NS_POPUPMENU_CID);
|
||||||
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
||||||
static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_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(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||||
|
@ -228,6 +230,9 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter,
|
||||||
else if (mClassID.Equals(kCMenuItem)) {
|
else if (mClassID.Equals(kCMenuItem)) {
|
||||||
inst = (nsISupports*)(nsIMenuItem*)new nsMenuItem();
|
inst = (nsISupports*)(nsIMenuItem*)new nsMenuItem();
|
||||||
}
|
}
|
||||||
|
else if (mClassID.Equals(kCXULCommand)) {
|
||||||
|
inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand();
|
||||||
|
}
|
||||||
else if (mClassID.Equals(kCImageButton)) {
|
else if (mClassID.Equals(kCImageButton)) {
|
||||||
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "nsTreeView.h"
|
#include "nsTreeView.h"
|
||||||
#include "nsToolbarManager.h"
|
#include "nsToolbarManager.h"
|
||||||
#include "nsToolbarItemHolder.h"
|
#include "nsToolbarItemHolder.h"
|
||||||
|
#include "nsXULCommand.h"
|
||||||
|
|
||||||
|
|
||||||
#include "nsTextAreaWidget.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(kCPopUpMenu, NS_POPUPMENU_CID);
|
||||||
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID);
|
||||||
static NS_DEFINE_IID(kCTreeView, NS_TREEVIEW_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(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||||
|
@ -226,6 +228,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
|
||||||
else if (mClassID.Equals(kCMenuItem)) {
|
else if (mClassID.Equals(kCMenuItem)) {
|
||||||
inst = (nsISupports*)(nsIMenuItem*) new nsMenuItem();
|
inst = (nsISupports*)(nsIMenuItem*) new nsMenuItem();
|
||||||
}
|
}
|
||||||
|
else if (mClassID.Equals(kCXULCommand)) {
|
||||||
|
inst = (nsISupports*)(nsIXULCommand*) new nsXULCommand();
|
||||||
|
}
|
||||||
else if (mClassID.Equals(kCImageButton)) {
|
else if (mClassID.Equals(kCImageButton)) {
|
||||||
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
inst = (nsISupports*)(nsWindow*)new nsImageButton();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@ LIBRARY_NAME = raptorbasewidget_s
|
||||||
#MODULES=widget
|
#MODULES=widget
|
||||||
#LCFLAGS=-D_IMPL_NS_WIDGET
|
#LCFLAGS=-D_IMPL_NS_WIDGET
|
||||||
|
|
||||||
CPPSRCS=nsBaseWidget.cpp \
|
CPPSRCS=nsXULCommand.cpp \
|
||||||
|
nsBaseWidget.cpp \
|
||||||
nsMenuButton.cpp \
|
nsMenuButton.cpp \
|
||||||
nsToolbarItemHolder.cpp \
|
nsToolbarItemHolder.cpp \
|
||||||
nsToolbarManager.cpp \
|
nsToolbarManager.cpp \
|
||||||
|
|
|
@ -22,7 +22,7 @@ LIBRARY_NAME = raptorbasewidget_s
|
||||||
REQUIRES=xpcom gfxwin raptor dom js
|
REQUIRES=xpcom gfxwin raptor dom js
|
||||||
DEFINES =-D_IMPL_NS_WIDGET
|
DEFINES =-D_IMPL_NS_WIDGET
|
||||||
|
|
||||||
CPPSRCS = \
|
CPPSRCS =nsXULCommand.cpp \
|
||||||
nsBaseWidget.cpp \
|
nsBaseWidget.cpp \
|
||||||
nsMenuButton.cpp \
|
nsMenuButton.cpp \
|
||||||
nsToolbarItemHolder.cpp \
|
nsToolbarItemHolder.cpp \
|
||||||
|
|
Двоичные данные
xpfe/appshell/macbuild/AppShell.mcp
Двоичные данные
xpfe/appshell/macbuild/AppShell.mcp
Двоичный файл не отображается.
|
@ -24,12 +24,10 @@ include $(DEPTH)/config/autoconf.mk
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nsIXULCommand.h \
|
|
||||||
nsAppShellCIDs.h \
|
nsAppShellCIDs.h \
|
||||||
nsIAppShellService.h \
|
nsIAppShellService.h \
|
||||||
nsICmdLineService.h \
|
nsICmdLineService.h \
|
||||||
nsIWidgetController.h \
|
nsIWidgetController.h \
|
||||||
nsIXULCommand.h \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||||
|
|
|
@ -23,11 +23,9 @@ MODULE=raptor
|
||||||
|
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nsAppShellCIDs.h \
|
nsAppShellCIDs.h \
|
||||||
nsIXULCommand.h \
|
|
||||||
nsIAppShellService.h \
|
nsIAppShellService.h \
|
||||||
nsICmdLineService.h \
|
nsICmdLineService.h \
|
||||||
nsIWidgetController.h \
|
nsIWidgetController.h \
|
||||||
nsIXULCommand.h \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include <$(DEPTH)\config\rules.mak>
|
include <$(DEPTH)\config\rules.mak>
|
||||||
|
|
|
@ -28,7 +28,6 @@ LIBRARY_NAME = nsappshell
|
||||||
MODULE=raptor
|
MODULE=raptor
|
||||||
|
|
||||||
CPPSRCS= \
|
CPPSRCS= \
|
||||||
nsXULCommand.cpp \
|
|
||||||
nsAppShellService.cpp \
|
nsAppShellService.cpp \
|
||||||
nsWebShellWindow.cpp \
|
nsWebShellWindow.cpp \
|
||||||
nsAppShellFactory.cpp \
|
nsAppShellFactory.cpp \
|
||||||
|
|
|
@ -22,7 +22,6 @@ DEFINES=-D_IMPL_NS_APPSHELL -DWIN32_LEAN_AND_MEAN
|
||||||
MODULE=raptor
|
MODULE=raptor
|
||||||
|
|
||||||
CPPSRCS= \
|
CPPSRCS= \
|
||||||
nsXULCommand.cpp \
|
|
||||||
nsAppShellService.cpp \
|
nsAppShellService.cpp \
|
||||||
nsWebShellWindow.cpp \
|
nsWebShellWindow.cpp \
|
||||||
nsAppShellFactory.cpp \
|
nsAppShellFactory.cpp \
|
||||||
|
@ -30,7 +29,6 @@ CPPSRCS= \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CPP_OBJS= \
|
CPP_OBJS= \
|
||||||
.\$(OBJDIR)\nsXULCommand.obj \
|
|
||||||
.\$(OBJDIR)\nsAppShellService.obj \
|
.\$(OBJDIR)\nsAppShellService.obj \
|
||||||
.\$(OBJDIR)\nsWebShellWindow.obj \
|
.\$(OBJDIR)\nsWebShellWindow.obj \
|
||||||
.\$(OBJDIR)\nsAppShellFactory.obj \
|
.\$(OBJDIR)\nsAppShellFactory.obj \
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
#include "nsIWidgetController.h"
|
#include "nsIWidgetController.h"
|
||||||
#include "nsAppShellCIDs.h"
|
#include "nsAppShellCIDs.h"
|
||||||
|
|
||||||
#include "nsXULCommand.h"
|
|
||||||
#include "nsIXULCommand.h"
|
#include "nsIXULCommand.h"
|
||||||
|
//#include "nsXULCommand.h"
|
||||||
#include "nsIDOMCharacterData.h"
|
#include "nsIDOMCharacterData.h"
|
||||||
|
|
||||||
#include "nsIMenuBar.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(kMenuBarCID, NS_MENUBAR_CID);
|
||||||
static NS_DEFINE_IID(kMenuCID, NS_MENU_CID);
|
static NS_DEFINE_IID(kMenuCID, NS_MENU_CID);
|
||||||
static NS_DEFINE_IID(kMenuItemCID, NS_MENUITEM_CID);
|
static NS_DEFINE_IID(kMenuItemCID, NS_MENUITEM_CID);
|
||||||
|
static NS_DEFINE_IID(kXULCommandCID, NS_XULCOMMAND_CID);
|
||||||
|
|
||||||
/* Define Interface IDs */
|
/* Define Interface IDs */
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
|
@ -410,6 +411,8 @@ nsCOMPtr<nsIDOMNode> nsWebShellWindow::FindNamedParentFromDoc(nsIDOMDocument * a
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aDOMDoc)
|
void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aDOMDoc)
|
||||||
{
|
{
|
||||||
|
nsresult rv = NS_NOINTERFACE;
|
||||||
|
|
||||||
// locate the window element which holds toolbars and menus and commands
|
// locate the window element which holds toolbars and menus and commands
|
||||||
nsCOMPtr<nsIDOMNode> window(FindNamedParentFromDoc(aDOMDoc, nsAutoString("window")));
|
nsCOMPtr<nsIDOMNode> window(FindNamedParentFromDoc(aDOMDoc, nsAutoString("window")));
|
||||||
if ( !window )
|
if ( !window )
|
||||||
|
@ -432,15 +435,29 @@ void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aD
|
||||||
element->GetAttribute(nsAutoString("name"), name);
|
element->GetAttribute(nsAutoString("name"), name);
|
||||||
element->GetAttribute(nsAutoString("onCommand"), value);
|
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();
|
nsXULCommand * xulCmd = new nsXULCommand();
|
||||||
xulCmd->SetName(name);
|
xulCmd->SetName(name);//nsIXULCommand
|
||||||
xulCmd->SetCommand(value);
|
xulCmd->SetCommand(value);//nsIXULCommand
|
||||||
xulCmd->SetWebShell(aWebShell);
|
xulCmd->SetWebShell(aWebShell);// Added to nsIXULCommand
|
||||||
xulCmd->SetDOMElement(element);
|
xulCmd->SetDOMElement(element);// Added to nsIXULCommand
|
||||||
nsIXULCommand * icmd;
|
nsIXULCommand * icmd;
|
||||||
if (NS_OK == xulCmd->QueryInterface(kIXULCommandIID, (void**) &icmd)) {
|
if (NS_OK == xulCmd->QueryInterface(kIXULCommandIID, (void**) &icmd)) {
|
||||||
mCommands.AppendElement(icmd);
|
mCommands.AppendElement(icmd);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//printf("Commands[%s] value[%s]\n", nsAutoCString(name), nsAutoCString(value));
|
//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")))
|
if (name.Equals(nsAutoString("BUTTON")))
|
||||||
ConnectCommandToOneGUINode(node, element, name);
|
ConnectCommandToOneGUINode(node, element, name);
|
||||||
else if (name.Equals(nsAutoString("INPUT"))) {
|
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();
|
nsXULCommand * xulCmd = new nsXULCommand();
|
||||||
xulCmd->SetName(name);
|
xulCmd->SetName(name);
|
||||||
xulCmd->SetCommand(value);
|
xulCmd->SetCommand(value);
|
||||||
|
@ -478,6 +510,7 @@ void nsWebShellWindow::LoadCommands(nsIWebShell * aWebShell, nsIDOMDocument * aD
|
||||||
mCommands.AppendElement(icmd);
|
mCommands.AppendElement(icmd);
|
||||||
}
|
}
|
||||||
xulCmd->AddUINode(node);
|
xulCmd->AddUINode(node);
|
||||||
|
*/
|
||||||
//printf("Linking cmd to button [%s]\n", nsAutoCString(cmdName));
|
//printf("Linking cmd to button [%s]\n", nsAutoCString(cmdName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,7 @@ static NS_DEFINE_IID(kCMenuBarCID, NS_MENUBAR_CID);
|
||||||
static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID);
|
static NS_DEFINE_IID(kCMenuCID, NS_MENU_CID);
|
||||||
static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID);
|
static NS_DEFINE_IID(kCMenuItemCID, NS_MENUITEM_CID);
|
||||||
static NS_DEFINE_IID(kCEditorCID, NS_EDITOR_CID);
|
static NS_DEFINE_IID(kCEditorCID, NS_EDITOR_CID);
|
||||||
|
static NS_DEFINE_IID(kCXULCommandCID, NS_XULCOMMAND_CID);
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
NS_SetupRegistry()
|
NS_SetupRegistry()
|
||||||
|
@ -201,6 +202,7 @@ NS_SetupRegistry()
|
||||||
nsRepository::RegisterFactory(kCMenuBarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
nsRepository::RegisterFactory(kCMenuBarCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
nsRepository::RegisterFactory(kCMenuCID, 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(kCMenuItemCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
|
nsRepository::RegisterFactory(kCXULCommandCID, WIDGET_DLL, PR_FALSE, PR_FALSE);
|
||||||
#ifndef XP_MAC // temporary
|
#ifndef XP_MAC // temporary
|
||||||
nsRepository::RegisterFactory(kCEditorCID, EDITOR_DLL, PR_FALSE, PR_FALSE);
|
nsRepository::RegisterFactory(kCEditorCID, EDITOR_DLL, PR_FALSE, PR_FALSE);
|
||||||
#endif // XP_MAC
|
#endif // XP_MAC
|
||||||
|
|
Загрузка…
Ссылка в новой задаче