Added some ifdefs to the source and makefile to optionally compile control support.

Plugin support works again (yay!)
This commit is contained in:
locka%iol.ie 1999-05-10 21:27:15 +00:00
Родитель 137d734754
Коммит b22d5bc2b7
8 изменённых файлов: 105 добавлений и 32 удалений

Просмотреть файл

@ -15,6 +15,8 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef CPMOZILLACONTROL_H
#define CPMOZILLACONTROL_H
//////////////////////////////////////////////////////////////////////////////
// CProxyDWebBrowserEvents
@ -924,3 +926,5 @@ public:
};
#endif

Просмотреть файл

@ -34,6 +34,32 @@ static const std::string c_szDefaultPage = "resource://res/MozillaControl.html
BOOL CMozillaBrowser::m_bRegistryInitialized = FALSE;
class CMozDir
{
TCHAR m_szOldDir[1024];
public:
CMozDir()
{
GetCurrentDirectory(1024, m_szOldDir);
CRegKey cKey;
if (cKey.Open(HKEY_LOCAL_MACHINE, _T("Software\\Mozilla")) == ERROR_SUCCESS)
{
TCHAR szCurDir[1024];
DWORD dwSize = sizeof(szCurDir) / sizeof(szCurDir[0]);
if (cKey.QueryValue(szCurDir, _T("MozillaDir"), &dwSize) == ERROR_SUCCESS)
{
SetCurrentDirectory(szCurDir);
}
cKey.Close();
}
}
~CMozDir()
{
// Restore old working directory
SetCurrentDirectory(m_szOldDir);
}
};
/////////////////////////////////////////////////////////////////////////////
// CMozillaBrowser
@ -63,6 +89,9 @@ CMozillaBrowser::CMozillaBrowser()
// the IHTMLDOcument, lazy allocation.
m_pDocument = NULL;
// Change the current directory to the Mozilla dist so that registration
// works properly
// Register components
if (!m_bRegistryInitialized)
{
@ -84,6 +113,7 @@ CMozillaBrowser::CMozillaBrowser()
rv = eventQService->CreateThreadEventQueue();
nsServiceManager::ReleaseService(kEventQueueServiceCID, eventQService);
}
}
@ -859,7 +889,25 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate(BSTR URL, VARIANT __RPC_FAR
// Check the navigation flags
if (lFlags & navOpenInNewWindow)
{
// Open in new window is a no no
CIPtr(IDispatch) spDispNew;
VARIANT_BOOL bCancel = VARIANT_FALSE;
// Test if the event sink can give us a new window to navigate into
Fire_NewWindow2(&spDispNew, &bCancel);
lFlags &= ~(navOpenInNewWindow);
if ((bCancel == VARIANT_FALSE) && spDispNew)
{
CIPtr(IWebBrowser2) spOther = spDispNew;;
if (spOther)
{
CComVariant vURL(URL);
CComVariant vFlags(lFlags);
spOther->Navigate2(&vURL, &vFlags, TargetFrameName, PostData, Headers);
}
}
// Can't open a new window without client suppot
return E_NOTIMPL;
}
if (lFlags & navNoHistory)

Просмотреть файл

@ -29,13 +29,16 @@
#include "MozillaControl.h"
#include "MozillaControl_i.c"
#ifdef USE_CONTROL
#include "MozillaBrowser.h"
#endif
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
#ifdef USE_CONTROL
OBJECT_ENTRY(CLSID_MozillaBrowser, CMozillaBrowser)
#endif
END_OBJECT_MAP()
/////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -60,7 +60,7 @@ CFG=MozillaControl - Win32 Debug
# PROP Intermediate_Dir "Debug"
# PROP Cmd_Line "NMAKE /f makefile.win"
# PROP Rebuild_Opt "/a"
# PROP Target_File ".\WIN32_D.OBJ\npmozctl.dll"
# PROP Target_File "c:\program files\netscape\communicator\program\plugins\npmozctl.dll"
# PROP Bsc_Name "MozillaControl.bsc"
# PROP Target_Dir ""

Просмотреть файл

@ -36,6 +36,10 @@
// Comment these out as appropriate
//#define USE_NGPREF
#ifdef MOZ_ACTIVEX_CONTROL_SUPPORT
#define USE_CONTROL
#endif
#ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT
#define USE_PLUGIN
#endif
@ -71,7 +75,7 @@ typedef long int32;
#include "nsIPref.h"
#endif
#ifdef USE_CONTROL
#include "xp_core.h"
#include "jscompat.h"
@ -85,6 +89,7 @@ typedef long int32;
#include "nsWidgetsCID.h"
#include "nsGfxCIID.h"
#include "nsViewsCID.h"
#include "nsXPComCIID.h"
#include "nsString.h"
#include "nsIURL.h"
@ -104,21 +109,27 @@ typedef long int32;
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#endif
// Mozilla control headers
#include "resource.h"
#include "ActiveXTypes.h"
#include "BrowserDiagnostics.h"
#include "PropertyList.h"
#include "IEHtmlDocument.h"
#include "MozillaControl.h"
#include "MozillaBrowser.h"
#include "WebShellContainer.h"
#include "PropertyList.h"
#include "PropertyBag.h"
#include "ControlSite.h"
#include "ControlSiteIPFrame.h"
#ifdef USE_CONTROL
#include "IEHtmlDocument.h"
#include "CPMozillaControl.h"
#include "MozillaBrowser.h"
#include "WebShellContainer.h"
#include "guids.h"
#endif
#ifdef USE_PLUGIN
#include "npapi.h"
#include "nsIFactory.h"
@ -128,8 +139,6 @@ typedef long int32;
#include "ActiveXPluginInstance.h"
#endif
#include "guids.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

Просмотреть файл

@ -16,6 +16,7 @@
* Reserved.
*/
#include "stdafx.h"
#include "guids.h"
// Class IDs
NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);

Просмотреть файл

@ -24,6 +24,16 @@ QUIET =
DEPTH =..\..\..
IGNORE_MANIFEST=1
# The default is to include control support unless told to do otherwise
!ifndef MOZ_ACTIVEX_NO_CONTROL_SUPPORT
MOZ_ACTIVEX_CONTROL_SUPPORT = 1
!endif
!ifndef MOZ_ACTIVEX_NO_PLUGIN_SUPPORT
# MOZ_ACTIVEX_PLUGIN_SUPPORT = 1
!endif
MAKE_OBJ_TYPE = DLL
DLL=.\$(OBJDIR)\$(DLLNAME).dll
RESFILE = MozillaControl.res
@ -35,21 +45,23 @@ DEFFILE = MozillaControl.def
OBJS = \
.\$(OBJDIR)\StdAfx.obj \
.\$(OBJDIR)\guids.obj \
.\$(OBJDIR)\nsSetupRegistry.obj \
.\$(OBJDIR)\MozillaControl.obj \
.\$(OBJDIR)\MozillaBrowser.obj \
.\$(OBJDIR)\WebShellContainer.obj \
.\$(OBJDIR)\ControlSite.obj \
.\$(OBJDIR)\ControlSiteIPFrame.obj \
.\$(OBJDIR)\PropertyBag.obj \
.\$(OBJDIR)\MozillaControl.obj \
!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT
.\$(OBJDIR)\nsSetupRegistry.obj \
.\$(OBJDIR)\MozillaBrowser.obj \
.\$(OBJDIR)\WebShellContainer.obj \
.\$(OBJDIR)\IEHtmlNode.obj \
.\$(OBJDIR)\IEHtmlElementCollection.obj \
.\$(OBJDIR)\IEHtmlElement.obj \
.\$(OBJDIR)\IEHtmlDocument.obj \
.\$(OBJDIR)\guids.obj \
!endif
# .\$(OBJDIR)\ActiveXPlugin.obj \
# .\$(OBJDIR)\ActiveXPluginInstance.obj \
!ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT
.\$(OBJDIR)\ActiveXPlugin.obj \
.\$(OBJDIR)\ActiveXPluginInstance.obj \
.\$(OBJDIR)\ActiveScriptSite.obj \
.\$(OBJDIR)\LegacyPlugin.obj \
.\$(OBJDIR)\npwin.obj \
@ -84,11 +96,13 @@ LINCS= \
$(NULL)
MYLIBS= \
!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT
$(DIST)\lib\raptorbase.lib \
$(DIST)\lib\raptorgfxwin.lib \
$(DIST)\lib\raptorweb.lib \
$(DIST)\lib\xpcom32.lib \
$(LIBNSPR) \
!endif
$(NULL)
LLIBS = $(MYLIBS) \
@ -112,6 +126,10 @@ LCFLAGS = $(LCFLAGS) -DMOZ_NO_DEBUG_RTL
LCFLAGS = $(LCFLAGS) -DMOZ_ACTIVEX_PLUGIN_SUPPORT
!endif
!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT
LCFLAGS = $(LCFLAGS) -DMOZ_ACTIVEX_CONTROL_SUPPORT
!endif
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)\bin
$(MAKE_INSTALL) MozillaControl.html $(DIST)\bin\res
@ -135,6 +153,10 @@ ControlSite.cpp \
ControlSiteIPFrame.cpp \
PropertyBag.cpp : StdAfx.h PropertyBag.h ControlSite.h ControlSiteIPFrame.h
MozillaControl.cpp \
StdAfx.cpp: StdAfx.h MozillaControl.h MozillaBrowser.h WebShellContainer.h
!ifdef MOZ_ACTIVEX_CONTROL_SUPPORT
IEHtmlNode.cpp : StdAfx.h IEHtmlNode.h
IEHtmlElementCollection.cpp : StdAfx.h IEHtmlElementCollection.h
@ -147,6 +169,7 @@ MozillaControl.cpp \
MozillaBrowser.cpp \
WebShellContainer.cpp \
StdAfx.cpp: StdAfx.h MozillaControl.h MozillaBrowser.h WebShellContainer.h
!endif
guids.cpp: StdAfx.h guids.h

Просмотреть файл

@ -1,15 +0,0 @@
; MozillaControl.def : Declares the module parameters.
LIBRARY "npmozctl.DLL"
EXPORTS
; Plugin exports
NP_GetEntryPoints @1
NP_Initialize @2
NP_Shutdown @3
NSGetFactory @10
; ActiveX exports
DllCanUnloadNow @100 PRIVATE
DllGetClassObject @101 PRIVATE
DllRegisterServer @102 PRIVATE
DllUnregisterServer @103 PRIVATE