From d4a82e8a586bc2802f9abcd824e54640a5f4d80a Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Mon, 30 Nov 1998 10:39:37 +0000 Subject: [PATCH] Tweaks to allow building SeaMonkeyBrowser w/o the editor. --- Makefile.in | 1 - configure.in | 16 ++++++++++++---- webshell/tests/viewer/nsSetupRegistry.cpp | 7 ++++++- xpfe/xpviewer/src/nsBrowserWindow.cpp | 15 ++++++++++++--- xpfe/xpviewer/src/nsBrowserWindow.h | 6 ++++++ xpfe/xpviewer/src/nsSetupRegistry.cpp | 6 ++++++ 6 files changed, 42 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index a4afc3b02ac7..e9a29f1c0c32 100644 --- a/Makefile.in +++ b/Makefile.in @@ -69,7 +69,6 @@ DIRS += \ view \ widget \ layout \ - editor \ webshell ifdef MOZ_EDITOR diff --git a/configure.in b/configure.in index c116159e71c5..c42853396c55 100644 --- a/configure.in +++ b/configure.in @@ -972,9 +972,6 @@ dom/src/events/Makefile dom/src/html/Makefile dom/src/jsurl/Makefile dom/tools/Makefile -editor/Makefile -editor/core/Makefile -editor/public/Makefile gfx/Makefile gfx/public/Makefile gfx/src/Makefile @@ -1140,6 +1137,17 @@ xpfe/xpviewer/Makefile xpfe/xpviewer/src/Makefile xpfe/xpviewer/public/Makefile" -AC_OUTPUT($NG_MAKEFILES) +EDITOR_MAKEFILES=" +editor/Makefile +editor/core/Makefile +editor/public/Makefile" + +MAKEFILES="$NG_MAKEFILES" + +if test -n "$MOZ_EDITOR"; then + MAKEFILES="$MAKEFILES $EDITOR_MAKEFILES" +fi + +AC_OUTPUT($MAKEFILES) diff --git a/webshell/tests/viewer/nsSetupRegistry.cpp b/webshell/tests/viewer/nsSetupRegistry.cpp index 48a40c983a91..18b4fdd21f9e 100644 --- a/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/webshell/tests/viewer/nsSetupRegistry.cpp @@ -40,8 +40,9 @@ #include "nsLayoutCID.h" #include "nsINetService.h" +#ifdef NGEDITOR #include "nsIEditor.h" - +#endif #ifdef XP_PC #define WIDGET_DLL "raptorwidget.dll" @@ -120,7 +121,9 @@ static NS_DEFINE_IID(kCXMLDocument, NS_XMLDOCUMENT_CID); static NS_DEFINE_IID(kCImageDocument, NS_IMAGEDOCUMENT_CID); static NS_DEFINE_IID(kCHTMLImageElementFactory, NS_HTMLIMAGEELEMENTFACTORY_CID); static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID); +#ifdef NGEDITOR static NS_DEFINE_IID(kIEditFactoryIID, NS_IEDITORFACTORY_IID); +#endif extern "C" void NS_SetupRegistry() @@ -167,6 +170,8 @@ NS_SetupRegistry() nsRepository::RegisterFactory(kCHTMLImageElementFactory, LAYOUT_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kNetServiceCID, NETLIB_DLL, PR_FALSE, PR_FALSE); #ifndef XP_MAC // temporary +#ifdef NGEDITOR nsRepository::RegisterFactory(kIEditFactoryIID, EDITOR_DLL, PR_FALSE, PR_FALSE); +#endif #endif //XP_MAC } diff --git a/xpfe/xpviewer/src/nsBrowserWindow.cpp b/xpfe/xpviewer/src/nsBrowserWindow.cpp index 08f249de866a..7bd4c7167ab7 100644 --- a/xpfe/xpviewer/src/nsBrowserWindow.cpp +++ b/xpfe/xpviewer/src/nsBrowserWindow.cpp @@ -96,8 +96,9 @@ #include #endif - +#ifdef NGEDITOR #include "nsIEditor.h" +#endif // XXX For font setting below #include "nsFont.h" @@ -178,9 +179,10 @@ static NS_DEFINE_IID(kIPopUpMenuIID, NS_IPOPUPMENU_IID); static NS_DEFINE_IID(kIMenuButtonIID, NS_IMENUBUTTON_IID); static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); +#ifdef NGEDITOR static NS_DEFINE_IID(kIEditFactoryIID, NS_IEDITORFACTORY_IID); static NS_DEFINE_IID(kIEditorIID, NS_IEDITOR_IID); - +#endif static const char* gsAOLFormat = "AOLMAIL"; static const char* gsHTMLFormat = "text/html"; @@ -768,9 +770,11 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) DoJSConsole(); break; +#ifdef NGEDITOR case EDITOR_MODE: DoEditorMode(mWebShell); break; +#endif } //switch return nsEventStatus_eIgnore; @@ -2825,6 +2829,7 @@ nsBrowserWindow::DoJSConsole() mApp->CreateJSConsole(this); } +#ifdef NGEDITOR //---------------------------------------- void nsBrowserWindow::DoEditorMode(nsIWebShell *aWebShell) @@ -2879,7 +2884,7 @@ nsBrowserWindow::AddEditor(nsIEditor *aEditor) if (!mEditor)//THIS FUNCTION REALLY NEEDS HELP mEditor = aEditor; } - +#endif #ifdef NS_DEBUG @@ -3384,7 +3389,9 @@ void CreateBrowserMenus(nsIMenuBar * aMenuBar) {"Debug Robot", "R", VIEWER_DEBUGROBOT}, {"-", NULL, 0}, {"Show Content Quality", ".", VIEWER_SHOW_CONTENT_QUALITY}, +#ifdef NGEDITOR {"Editor", "E", EDITOR_MODE}, +#endif {NULL, NULL, 0} }; @@ -3415,12 +3422,14 @@ void CreateBrowserMenus(nsIMenuBar * aMenuBar) CreateMenuItem(fileMenu, "-", 0); CreateMenuItem(fileMenu, "Exit", VIEWER_EXIT); +#ifdef NGEDITOR nsIMenu * editMenu = CreateMenu(aMenuBar, "Edit", 'E'); i = 0; while (editMenus[i].title != nsnull) { CreateMenuItem(editMenu, editMenus[i].title, editMenus[i].command); i++; } +#endif #ifdef NOT_YET nsIMenu * viewMenu = CreateMenu(aMenuBar, "View", 'V'); diff --git a/xpfe/xpviewer/src/nsBrowserWindow.h b/xpfe/xpviewer/src/nsBrowserWindow.h index 2233ff3bebfa..f6d7311e49d3 100644 --- a/xpfe/xpviewer/src/nsBrowserWindow.h +++ b/xpfe/xpviewer/src/nsBrowserWindow.h @@ -32,7 +32,9 @@ #include "nsIToolbarManagerListener.h" #include "nsIImageButtonListener.h" +#ifdef NGEDITOR #include "nsIEditor.h" +#endif class nsILabel; class nsICheckButton; @@ -148,7 +150,9 @@ public: void DoViewSource(); void DoCopy(); void DoJSConsole(); +#ifdef NGEDITOR void DoEditorMode(nsIWebShell* aWebShell); +#endif nsIPresShell* GetPresShell(); void DoFind(); @@ -295,8 +299,10 @@ protected: void UpdateToolbarBtns(); +#ifdef NGEDITOR void AddEditor(nsIEditor *); //this function is temporary and WILL be depricated nsIEditor * mEditor; //this will hold the editor for future commands. we must think about this mjudge +#endif }; // nsViewSourceWindow diff --git a/xpfe/xpviewer/src/nsSetupRegistry.cpp b/xpfe/xpviewer/src/nsSetupRegistry.cpp index c946fa08844e..d29656af1d02 100644 --- a/xpfe/xpviewer/src/nsSetupRegistry.cpp +++ b/xpfe/xpviewer/src/nsSetupRegistry.cpp @@ -40,7 +40,9 @@ #include "nsLayoutCID.h" #include "nsINetService.h" +#ifdef NGEDITOR #include "nsIEditor.h" +#endif #ifdef XP_PC @@ -136,7 +138,9 @@ static NS_DEFINE_IID(kCMenuButtonCID, NS_MENUBUTTON_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); +#ifdef NGEDITOR static NS_DEFINE_IID(kIEditFactoryIID, NS_IEDITORFACTORY_IID); +#endif extern "C" void NS_SetupRegistry() @@ -194,6 +198,8 @@ NS_SetupRegistry() nsRepository::RegisterFactory(kCMenuItemCID, WIDGET_DLL, PR_FALSE, PR_FALSE); #ifndef XP_MAC // temporary +#ifdef NGEDITOR nsRepository::RegisterFactory(kIEditFactoryIID, EDITOR_DLL, PR_FALSE, PR_FALSE); +#endif #endif // XP_MAC }