mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Added a new windows-only subdirectory called embed/AcviveX which contains an ActiveX wrapper control for NGLayout
This commit is contained in:
parent
48b8f0c27a
commit
e113f7d5b2
452
webshell/embed/ActiveX/CPMozillaControl.h
Normal file
452
webshell/embed/ActiveX/CPMozillaControl.h
Normal file
@ -0,0 +1,452 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// CProxyDWebBrowserEvents
|
||||
template <class T>
|
||||
class CProxyDWebBrowserEvents : public IConnectionPointImpl<T, &DIID_DWebBrowserEvents, CComDynamicUnkArray>
|
||||
{
|
||||
public:
|
||||
//methods:
|
||||
//DWebBrowserEvents : IDispatch
|
||||
public:
|
||||
void Fire_BeforeNavigate(
|
||||
BSTR URL,
|
||||
long Flags,
|
||||
BSTR TargetFrameName,
|
||||
VARIANT * PostData,
|
||||
BSTR Headers,
|
||||
VARIANT_BOOL * Cancel)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[5].vt = VT_BSTR;
|
||||
pvars[5].bstrVal= URL;
|
||||
pvars[4].vt = VT_I4;
|
||||
pvars[4].lVal= Flags;
|
||||
pvars[3].vt = VT_BSTR;
|
||||
pvars[3].bstrVal= TargetFrameName;
|
||||
pvars[2].vt = VT_VARIANT | VT_BYREF;
|
||||
pvars[2].byref= PostData;
|
||||
pvars[1].vt = VT_BSTR;
|
||||
pvars[1].bstrVal= Headers;
|
||||
pvars[0].vt = VT_BOOL | VT_BYREF;
|
||||
pvars[0].byref= Cancel;
|
||||
DISPPARAMS disp = { pvars, NULL, 6, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x64, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_NavigateComplete(
|
||||
BSTR URL)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BSTR;
|
||||
pvars[0].bstrVal= URL;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x65, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_StatusTextChange(
|
||||
BSTR Text)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BSTR;
|
||||
pvars[0].bstrVal= Text;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_ProgressChange(
|
||||
long Progress,
|
||||
long ProgressMax)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[2];
|
||||
for (int i = 0; i < 2; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[1].vt = VT_I4;
|
||||
pvars[1].lVal= Progress;
|
||||
pvars[0].vt = VT_I4;
|
||||
pvars[0].lVal= ProgressMax;
|
||||
DISPPARAMS disp = { pvars, NULL, 2, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_DownloadComplete()
|
||||
{
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
}
|
||||
void Fire_CommandStateChange(
|
||||
long Command,
|
||||
VARIANT_BOOL Enable)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[2];
|
||||
for (int i = 0; i < 2; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[1].vt = VT_I4;
|
||||
pvars[1].lVal= Command;
|
||||
pvars[0].vt = VT_BOOL;
|
||||
pvars[0].boolVal= Enable;
|
||||
DISPPARAMS disp = { pvars, NULL, 2, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_DownloadBegin()
|
||||
{
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
}
|
||||
void Fire_NewWindow(
|
||||
BSTR URL,
|
||||
long Flags,
|
||||
BSTR TargetFrameName,
|
||||
VARIANT * PostData,
|
||||
BSTR Headers,
|
||||
VARIANT_BOOL * Processed)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[5].vt = VT_BSTR;
|
||||
pvars[5].bstrVal= URL;
|
||||
pvars[4].vt = VT_I4;
|
||||
pvars[4].lVal= Flags;
|
||||
pvars[3].vt = VT_BSTR;
|
||||
pvars[3].bstrVal= TargetFrameName;
|
||||
pvars[2].vt = VT_VARIANT | VT_BYREF;
|
||||
pvars[2].byref= PostData;
|
||||
pvars[1].vt = VT_BSTR;
|
||||
pvars[1].bstrVal= Headers;
|
||||
pvars[0].vt = VT_BOOL | VT_BYREF;
|
||||
pvars[0].byref= Processed;
|
||||
DISPPARAMS disp = { pvars, NULL, 6, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6b, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_TitleChange(
|
||||
BSTR Text)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BSTR;
|
||||
pvars[0].bstrVal= Text;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_FrameBeforeNavigate(
|
||||
BSTR URL,
|
||||
long Flags,
|
||||
BSTR TargetFrameName,
|
||||
VARIANT * PostData,
|
||||
BSTR Headers,
|
||||
VARIANT_BOOL * Cancel)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[5].vt = VT_BSTR;
|
||||
pvars[5].bstrVal= URL;
|
||||
pvars[4].vt = VT_I4;
|
||||
pvars[4].lVal= Flags;
|
||||
pvars[3].vt = VT_BSTR;
|
||||
pvars[3].bstrVal= TargetFrameName;
|
||||
pvars[2].vt = VT_VARIANT | VT_BYREF;
|
||||
pvars[2].byref= PostData;
|
||||
pvars[1].vt = VT_BSTR;
|
||||
pvars[1].bstrVal= Headers;
|
||||
pvars[0].vt = VT_BOOL | VT_BYREF;
|
||||
pvars[0].byref= Cancel;
|
||||
DISPPARAMS disp = { pvars, NULL, 6, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0xc8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_FrameNavigateComplete(
|
||||
BSTR URL)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BSTR;
|
||||
pvars[0].bstrVal= URL;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0xc9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_FrameNewWindow(
|
||||
BSTR URL,
|
||||
long Flags,
|
||||
BSTR TargetFrameName,
|
||||
VARIANT * PostData,
|
||||
BSTR Headers,
|
||||
VARIANT_BOOL * Processed)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[5].vt = VT_BSTR;
|
||||
pvars[5].bstrVal= URL;
|
||||
pvars[4].vt = VT_I4;
|
||||
pvars[4].lVal= Flags;
|
||||
pvars[3].vt = VT_BSTR;
|
||||
pvars[3].bstrVal= TargetFrameName;
|
||||
pvars[2].vt = VT_VARIANT | VT_BYREF;
|
||||
pvars[2].byref= PostData;
|
||||
pvars[1].vt = VT_BSTR;
|
||||
pvars[1].bstrVal= Headers;
|
||||
pvars[0].vt = VT_BOOL | VT_BYREF;
|
||||
pvars[0].byref= Processed;
|
||||
DISPPARAMS disp = { pvars, NULL, 6, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0xcc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_Quit(
|
||||
VARIANT_BOOL * Cancel)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BOOL | VT_BYREF;
|
||||
pvars[0].byref= Cancel;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x67, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
void Fire_WindowMove()
|
||||
{
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6d, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
}
|
||||
void Fire_WindowResize()
|
||||
{
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6e, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
}
|
||||
void Fire_WindowActivate()
|
||||
{
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x6f, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
}
|
||||
void Fire_PropertyChange(
|
||||
BSTR Property)
|
||||
{
|
||||
VARIANTARG* pvars = new VARIANTARG[1];
|
||||
for (int i = 0; i < 1; i++)
|
||||
VariantInit(&pvars[i]);
|
||||
T* pT = (T*)this;
|
||||
pT->Lock();
|
||||
IUnknown** pp = m_vec.begin();
|
||||
while (pp < m_vec.end())
|
||||
{
|
||||
if (*pp != NULL)
|
||||
{
|
||||
pvars[0].vt = VT_BSTR;
|
||||
pvars[0].bstrVal= Property;
|
||||
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
||||
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
||||
pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
||||
}
|
||||
pp++;
|
||||
}
|
||||
pT->Unlock();
|
||||
delete[] pvars;
|
||||
}
|
||||
|
||||
};
|
||||
|
559
webshell/embed/ActiveX/MozillaBrowser.cpp
Normal file
559
webshell/embed/ActiveX/MozillaBrowser.cpp
Normal file
@ -0,0 +1,559 @@
|
||||
// MozillaBrowser.cpp : Implementation of CMozillaBrowser
|
||||
#include "stdafx.h"
|
||||
#include "MozillaControl.h"
|
||||
#include "MozillaBrowser.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMozillaBrowser
|
||||
|
||||
extern "C" void NS_SetupRegistry();
|
||||
|
||||
CMozillaBrowser::CMozillaBrowser()
|
||||
{
|
||||
m_bWindowOnly = TRUE;
|
||||
m_bWndLess = FALSE;
|
||||
|
||||
m_pIWebShell = nsnull;
|
||||
|
||||
// Create the container that handles some things for us
|
||||
m_pWebShellContainer = NULL;
|
||||
|
||||
PL_InitializeEventsLib("");
|
||||
// Register everything
|
||||
NS_SetupRegistry();
|
||||
}
|
||||
|
||||
|
||||
CMozillaBrowser::~CMozillaBrowser()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CMozillaBrowser::InterfaceSupportsErrorInfo(REFIID riid)
|
||||
{
|
||||
static const IID* arr[] =
|
||||
{
|
||||
&IID_IMozillaBrowser,
|
||||
};
|
||||
for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
|
||||
{
|
||||
if (InlineIsEqualGUID(*arr[i],riid))
|
||||
return S_OK;
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CMozillaBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
// Clip the child windows out of paint operations
|
||||
SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_CLIPCHILDREN);
|
||||
|
||||
// Create the NGLayout WebShell
|
||||
CreateWebShell();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CMozillaBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
/* Destroy NGLayout... */
|
||||
if (m_pIWebShell != nsnull)
|
||||
{
|
||||
m_pIWebShell->Destroy();
|
||||
NS_RELEASE(m_pIWebShell);
|
||||
m_pWebShellContainer->Release();
|
||||
m_pWebShellContainer = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT CMozillaBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
/* Pass resize information down to the WebShell... */
|
||||
if (m_pIWebShell)
|
||||
{
|
||||
m_pIWebShell->SetBounds(0, 0, LOWORD(lParam), HIWORD(lParam));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CMozillaBrowser::OnDraw(ATL_DRAWINFO& di)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
RECT& rc = *(RECT*)di.prcBounds;
|
||||
Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
|
||||
DrawText(di.hdcDraw, _T("Mozilla Browser (no window)"), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID);
|
||||
|
||||
HRESULT CMozillaBrowser::CreateWebShell()
|
||||
{
|
||||
if (m_pIWebShell != nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
RECT rcLocation;
|
||||
GetClientRect(&rcLocation);
|
||||
|
||||
nsresult rv;
|
||||
|
||||
rv = NSRepository::CreateInstance(kWebShellCID, nsnull,
|
||||
kIWebShellIID,
|
||||
(void**)&m_pIWebShell);
|
||||
if (NS_OK != rv)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsRect r;
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.width = rcLocation.right - rcLocation.left;
|
||||
r.height = rcLocation.bottom - rcLocation.top;
|
||||
|
||||
PRBool aAllowPlugins = PR_FALSE;
|
||||
|
||||
rv = m_pIWebShell->Init(m_hWnd,
|
||||
r.x, r.y,
|
||||
r.width, r.height,
|
||||
nsScrollPreference_kAuto, aAllowPlugins);
|
||||
|
||||
// Create the container object
|
||||
m_pWebShellContainer = new CWebShellContainer;
|
||||
m_pWebShellContainer->AddRef();
|
||||
|
||||
m_pIWebShell->SetContainer((nsIWebShellContainer*) m_pWebShellContainer);
|
||||
// m_pIWebShell->SetObserver((nsIStreamObserver*)this);
|
||||
// m_pIWebShell->SetPrefs(aPrefs);
|
||||
m_pIWebShell->Show();
|
||||
|
||||
// TODO
|
||||
// -- remove
|
||||
// Use the IWebBrowser::Navigate() method
|
||||
USES_CONVERSION;
|
||||
LPOLESTR pszUrl = T2OLE(_T("http://www.mozilla.org"));
|
||||
BSTR bstrUrl = ::SysAllocString(pszUrl);
|
||||
Navigate(bstrUrl, NULL, NULL, NULL, NULL);
|
||||
::SysFreeString(bstrUrl);
|
||||
// -- remove
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// IWebBrowser
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoBack(void)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (m_pIWebShell->CanBack())
|
||||
{
|
||||
m_pIWebShell->Back();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoForward(void)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (m_pIWebShell->CanForward())
|
||||
{
|
||||
m_pIWebShell->Forward();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoHome(void)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO find and navigate to the home page somehow
|
||||
USES_CONVERSION;
|
||||
Navigate(T2OLE(_T("http://home.netscape.com")), NULL, NULL, NULL, NULL);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoSearch(void)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO find and navigate to the search page somehow
|
||||
|
||||
USES_CONVERSION;
|
||||
Navigate(T2OLE(_T("http://search.netscape.com")), NULL, NULL, NULL, NULL);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Extract the URL parameter
|
||||
nsString sUrl;
|
||||
if (URL == NULL)
|
||||
{
|
||||
// ASSERT(0);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
else
|
||||
{
|
||||
USES_CONVERSION;
|
||||
sUrl = OLE2A(URL);
|
||||
}
|
||||
|
||||
// Extract the launch flags parameter
|
||||
LONG lFlags = 0;
|
||||
if (Flags)
|
||||
{
|
||||
CComVariant vFlags;
|
||||
if (VariantChangeType(Flags, &vFlags, 0, VT_I4) != S_OK)
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
lFlags = vFlags.lVal;
|
||||
}
|
||||
|
||||
|
||||
// Extract the target frame parameter
|
||||
nsString sTargetFrame;
|
||||
if (TargetFrameName)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CComVariant vTargetFrame;
|
||||
if (VariantChangeType(TargetFrameName, &vTargetFrame, 0, VT_BSTR) != S_OK)
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
sTargetFrame = nsString(OLE2A(vTargetFrame.bstrVal));
|
||||
}
|
||||
|
||||
// Extract the post data parameter
|
||||
nsString sPostData;
|
||||
if (PostData)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CComVariant vPostData;
|
||||
if (VariantChangeType(PostData, &vPostData, 0, VT_BSTR) != S_OK)
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
sPostData = nsString(OLE2A(vPostData.bstrVal));
|
||||
}
|
||||
|
||||
|
||||
// TODO Extract the headers parameter
|
||||
PRBool bModifyHistory = PR_TRUE;
|
||||
|
||||
// Check the navigation flags
|
||||
if (lFlags & navOpenInNewWindow)
|
||||
{
|
||||
// TODO open in new window?
|
||||
}
|
||||
if (lFlags & navNoHistory)
|
||||
{
|
||||
// Disable history
|
||||
bModifyHistory = PR_FALSE;
|
||||
}
|
||||
if (lFlags & navNoReadFromCache)
|
||||
{
|
||||
// TODO disable read from cache
|
||||
}
|
||||
if (lFlags & navNoWriteToCache)
|
||||
{
|
||||
// TODO disable write to cache
|
||||
}
|
||||
|
||||
// Create post data from string
|
||||
nsIPostData *pIPostData = nsnull;
|
||||
// NS_NewPostData(PR_FALSE, sPostData, &pIPostData);
|
||||
|
||||
// TODO find the correct target frame
|
||||
|
||||
// Load the URL
|
||||
m_pIWebShell->LoadURL(sUrl, pIPostData, bModifyHistory);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Refresh(void)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Reload the page
|
||||
CComVariant vRefreshType(REFRESH_NORMAL);
|
||||
return Refresh2(&vRefreshType);
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Refresh2(VARIANT __RPC_FAR *Level)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO check specified type
|
||||
|
||||
nsReloadType type = nsReload;
|
||||
m_pIWebShell->Reload(type);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Stop()
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
m_pIWebShell->Stop();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Type(BSTR __RPC_FAR *Type)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Left(long __RPC_FAR *pl)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Left(long Left)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Top(long __RPC_FAR *pl)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Top(long Top)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Width(long __RPC_FAR *pl)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Width(long Width)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Height(long __RPC_FAR *pl)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Height(long Height)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationName(BSTR __RPC_FAR *LocationName)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationURL(BSTR __RPC_FAR *LocationURL)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Busy(VARIANT_BOOL __RPC_FAR *pBool)
|
||||
{
|
||||
if (m_pIWebShell == nsnull)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
148
webshell/embed/ActiveX/MozillaBrowser.h
Normal file
148
webshell/embed/ActiveX/MozillaBrowser.h
Normal file
@ -0,0 +1,148 @@
|
||||
// MozillaBrowser.h : Declaration of the CMozillaBrowser
|
||||
|
||||
#ifndef __MOZILLABROWSER_H_
|
||||
#define __MOZILLABROWSER_H_
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "WebShellContainer.h"
|
||||
|
||||
// This file is autogenerated using the ATL proxy wizard
|
||||
// so don't edit it!
|
||||
#include "CPMozillaControl.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMozillaBrowser
|
||||
class ATL_NO_VTABLE CMozillaBrowser :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CMozillaBrowser, &CLSID_MozillaBrowser>,
|
||||
public CComControl<CMozillaBrowser>,
|
||||
public CProxyDWebBrowserEvents<CMozillaBrowser>,
|
||||
public CStockPropImpl<CMozillaBrowser, IMozillaBrowser, &IID_IMozillaBrowser, &LIBID_MOZILLACONTROLLib>,
|
||||
public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents, &LIBID_MOZILLACONTROLLib>,
|
||||
public IPersistStreamInitImpl<CMozillaBrowser>,
|
||||
public IPersistStorageImpl<CMozillaBrowser>,
|
||||
public IQuickActivateImpl<CMozillaBrowser>,
|
||||
public IOleControlImpl<CMozillaBrowser>,
|
||||
public IOleObjectImpl<CMozillaBrowser>,
|
||||
public IOleInPlaceActiveObjectImpl<CMozillaBrowser>,
|
||||
public IViewObjectExImpl<CMozillaBrowser>,
|
||||
public IOleInPlaceObjectWindowlessImpl<CMozillaBrowser>,
|
||||
public IDataObjectImpl<CMozillaBrowser>,
|
||||
public ISupportErrorInfo,
|
||||
public IConnectionPointContainerImpl<CMozillaBrowser>,
|
||||
public ISpecifyPropertyPagesImpl<CMozillaBrowser>,
|
||||
// Support for IE
|
||||
public IDispatchImpl<IWebBrowser, &IID_IWebBrowser, &LIBID_MOZILLACONTROLLib>
|
||||
{
|
||||
public:
|
||||
CMozillaBrowser();
|
||||
virtual ~CMozillaBrowser();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_MOZILLABROWSER)
|
||||
|
||||
BEGIN_COM_MAP(CMozillaBrowser)
|
||||
COM_INTERFACE_ENTRY(IMozillaBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IMozillaBrowser)
|
||||
COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
|
||||
COM_INTERFACE_ENTRY_IMPL(IOleControl)
|
||||
COM_INTERFACE_ENTRY_IMPL(IOleObject)
|
||||
COM_INTERFACE_ENTRY_IMPL(IQuickActivate)
|
||||
COM_INTERFACE_ENTRY_IMPL(IPersistStorage)
|
||||
COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
|
||||
COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages)
|
||||
COM_INTERFACE_ENTRY_IMPL(IDataObject)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo2)
|
||||
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
||||
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
|
||||
// IE web browser interface
|
||||
COM_INTERFACE_ENTRY(IWebBrowser)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_PROPERTY_MAP(CMozillaBrowser)
|
||||
// Example entries
|
||||
// PROP_ENTRY("Property Description", dispid, clsid)
|
||||
PROP_PAGE(CLSID_StockColorPage)
|
||||
END_PROPERTY_MAP()
|
||||
|
||||
|
||||
BEGIN_CONNECTION_POINT_MAP(CMozillaBrowser)
|
||||
// Fires IE events
|
||||
CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents)
|
||||
END_CONNECTION_POINT_MAP()
|
||||
|
||||
|
||||
BEGIN_MSG_MAP(CMozillaBrowser)
|
||||
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
||||
MESSAGE_HANDLER(WM_PAINT, OnPaint)
|
||||
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
|
||||
MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
|
||||
END_MSG_MAP()
|
||||
|
||||
// Windows message handlers
|
||||
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
|
||||
// ISupportsErrorInfo
|
||||
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
||||
|
||||
// IViewObjectEx
|
||||
STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
|
||||
{
|
||||
ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n"));
|
||||
*pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Protected members
|
||||
protected:
|
||||
CWebShellContainer * m_pWebShellContainer;
|
||||
nsIWebShell * m_pIWebShell;
|
||||
|
||||
virtual HRESULT CreateWebShell();
|
||||
|
||||
// IWebBrowser implementation
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GoBack(void);
|
||||
virtual HRESULT STDMETHODCALLTYPE GoForward(void);
|
||||
virtual HRESULT STDMETHODCALLTYPE GoHome(void);
|
||||
virtual HRESULT STDMETHODCALLTYPE GoSearch(void);
|
||||
virtual HRESULT STDMETHODCALLTYPE Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers);
|
||||
virtual HRESULT STDMETHODCALLTYPE Refresh(void);
|
||||
virtual HRESULT STDMETHODCALLTYPE Refresh2(VARIANT __RPC_FAR *Level);
|
||||
virtual HRESULT STDMETHODCALLTYPE Stop( void);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR __RPC_FAR *Type);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Left(long __RPC_FAR *pl);
|
||||
virtual HRESULT STDMETHODCALLTYPE put_Left(long Left);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Top(long __RPC_FAR *pl);
|
||||
virtual HRESULT STDMETHODCALLTYPE put_Top(long Top);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Width(long __RPC_FAR *pl);
|
||||
virtual HRESULT STDMETHODCALLTYPE put_Width(long Width);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Height(long __RPC_FAR *pl);
|
||||
virtual HRESULT STDMETHODCALLTYPE put_Height(long Height);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_LocationName(BSTR __RPC_FAR *LocationName);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_LocationURL(BSTR __RPC_FAR *LocationURL);
|
||||
virtual HRESULT STDMETHODCALLTYPE get_Busy(VARIANT_BOOL __RPC_FAR *pBool);
|
||||
|
||||
// IMozillaBrowser
|
||||
public:
|
||||
HRESULT OnDraw(ATL_DRAWINFO& di);
|
||||
|
||||
};
|
||||
|
||||
#endif //__MOZILLABROWSER_H_
|
23
webshell/embed/ActiveX/MozillaBrowser.htm
Normal file
23
webshell/embed/ActiveX/MozillaBrowser.htm
Normal file
@ -0,0 +1,23 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=iso-8859-1">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
||||
<title>ATL 2.0 test page for object MozillaBrowser</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<form method="POST">
|
||||
<p><input type="text" size="20" name="T1"><input
|
||||
type="submit" name="B1" value="Submit"></p>
|
||||
</form>
|
||||
|
||||
<p><object id="MozillaBrowser"
|
||||
classid="CLSID:1339B54C-3453-11D2-93B9-000000000000"
|
||||
align="baseline" border="0" width="528" height="316" <> <p>> </p> </object> </p>
|
||||
</body>
|
||||
</html>
|
34
webshell/embed/ActiveX/MozillaBrowser.rgs
Normal file
34
webshell/embed/ActiveX/MozillaBrowser.rgs
Normal file
@ -0,0 +1,34 @@
|
||||
HKCR
|
||||
{
|
||||
Mozilla.Browser.1 = s 'Mozilla Web Browser'
|
||||
{
|
||||
CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}'
|
||||
}
|
||||
Mozilla.Browser = s 'Mozilla Web Browser'
|
||||
{
|
||||
CurVer = s 'Mozilla.Browser.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {1339B54C-3453-11D2-93B9-000000000000} = s 'MozillaBrowser Class'
|
||||
{
|
||||
ProgID = s 'Mozilla.Browser.1'
|
||||
VersionIndependentProgID = s 'Mozilla.Browser'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
ForceRemove 'Control'
|
||||
ForceRemove 'Programmable'
|
||||
ForceRemove 'Insertable'
|
||||
ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 1'
|
||||
'MiscStatus' = s '0'
|
||||
{
|
||||
'1' = s '131473'
|
||||
}
|
||||
'TypeLib' = s '{1339B53E-3453-11D2-93B9-000000000000}'
|
||||
'Version' = s '1.0'
|
||||
}
|
||||
}
|
||||
}
|
73
webshell/embed/ActiveX/MozillaControl.cpp
Normal file
73
webshell/embed/ActiveX/MozillaControl.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
// MozillaControl.cpp : Implementation of DLL Exports.
|
||||
|
||||
|
||||
// Note: Proxy/Stub Information
|
||||
// To build a separate proxy/stub DLL,
|
||||
// run nmake -f MozillaControlps.mk in the project directory.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include "initguid.h"
|
||||
#include "MozillaControl.h"
|
||||
|
||||
#include "MozillaControl_i.c"
|
||||
#include "MozillaBrowser.h"
|
||||
|
||||
|
||||
CComModule _Module;
|
||||
|
||||
BEGIN_OBJECT_MAP(ObjectMap)
|
||||
OBJECT_ENTRY(CLSID_MozillaBrowser, CMozillaBrowser)
|
||||
END_OBJECT_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DLL Entry Point
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
_Module.Init(ObjectMap, hInstance);
|
||||
DisableThreadLibraryCalls(hInstance);
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
_Module.Term();
|
||||
return TRUE; // ok
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Used to determine whether the DLL can be unloaded by OLE
|
||||
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Returns a class factory to create an object of the requested type
|
||||
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
|
||||
{
|
||||
return _Module.GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllRegisterServer - Adds entries to the system registry
|
||||
|
||||
STDAPI DllRegisterServer(void)
|
||||
{
|
||||
// registers object, typelib and all interfaces in typelib
|
||||
return _Module.RegisterServer(TRUE);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DllUnregisterServer - Removes entries from the system registry
|
||||
|
||||
STDAPI DllUnregisterServer(void)
|
||||
{
|
||||
_Module.UnregisterServer();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
9
webshell/embed/ActiveX/MozillaControl.def
Normal file
9
webshell/embed/ActiveX/MozillaControl.def
Normal file
@ -0,0 +1,9 @@
|
||||
; MozillaControl.def : Declares the module parameters.
|
||||
|
||||
LIBRARY "MozillaControl.DLL"
|
||||
|
||||
EXPORTS
|
||||
DllCanUnloadNow @1 PRIVATE
|
||||
DllGetClassObject @2 PRIVATE
|
||||
DllRegisterServer @3 PRIVATE
|
||||
DllUnregisterServer @4 PRIVATE
|
1033
webshell/embed/ActiveX/MozillaControl.h
Normal file
1033
webshell/embed/ActiveX/MozillaControl.h
Normal file
File diff suppressed because it is too large
Load Diff
226
webshell/embed/ActiveX/MozillaControl.idl
Normal file
226
webshell/embed/ActiveX/MozillaControl.idl
Normal file
@ -0,0 +1,226 @@
|
||||
#include <olectl.h>
|
||||
// MozillaControl.idl : IDL source for MozillaControl.dll
|
||||
//
|
||||
|
||||
// This file will be processed by the MIDL tool to
|
||||
// produce the type library (MozillaControl.tlb) and marshalling code.
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
|
||||
// See note below for why IWebBrowser is not imported this way
|
||||
// import "exdisp.idl";
|
||||
#include "exdispid.h"
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(1339B54B-3453-11D2-93B9-000000000000),
|
||||
dual,
|
||||
helpstring("IMozillaBrowser Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IMozillaBrowser : IDispatch
|
||||
{
|
||||
[propget, id(DISPID_HWND)]
|
||||
HRESULT Window([out, retval]long* phwnd);
|
||||
};
|
||||
[
|
||||
uuid(1339B53E-3453-11D2-93B9-000000000000),
|
||||
version(1.0),
|
||||
helpstring("MozillaControl 1.0 Type Library")
|
||||
]
|
||||
library MOZILLACONTROLLib
|
||||
{
|
||||
importlib("stdole32.tlb");
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
// NOTE: There is a very specific reason for repeating the IWebBrowser
|
||||
// verbatim rather than import'ing exdisp.idl - it stops MIDL
|
||||
// failing with a MIDL2020 error!
|
||||
|
||||
[
|
||||
uuid(EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B), // IID_IWebBrowser
|
||||
helpstring("Web Browser interface"),
|
||||
helpcontext(0x0000),
|
||||
hidden,
|
||||
dual,
|
||||
oleautomation,
|
||||
odl
|
||||
]
|
||||
interface IWebBrowser : IDispatch
|
||||
{
|
||||
[id(100), helpstring("Navigates to the previous item in the history list."), helpcontext(0x0000)]
|
||||
HRESULT GoBack();
|
||||
[id(101), helpstring("Navigates to the next item in the history list."), helpcontext(0x0000)]
|
||||
HRESULT GoForward();
|
||||
[id(102), helpstring("Go home/start page."), helpcontext(0x0000)]
|
||||
HRESULT GoHome();
|
||||
[id(103), helpstring("Go Search Page."), helpcontext(0x0000)]
|
||||
HRESULT GoSearch();
|
||||
|
||||
[id(104), helpstring("Navigates to a URL or file."), helpcontext(0x0000)]
|
||||
HRESULT Navigate([in] BSTR URL,
|
||||
[in, optional] VARIANT * Flags,
|
||||
[in, optional] VARIANT * TargetFrameName,
|
||||
[in, optional] VARIANT * PostData,
|
||||
[in, optional] VARIANT * Headers);
|
||||
typedef
|
||||
[
|
||||
uuid(14EE5380-A378-11cf-A731-00A0C9082637),
|
||||
helpstring("Constants for WebBrowser navigation flags")
|
||||
]
|
||||
enum BrowserNavConstants {
|
||||
[helpstring("Open in new window")] navOpenInNewWindow = 0x0001,
|
||||
[helpstring("Exclude from history list")] navNoHistory = 0x0002,
|
||||
[helpstring("Don't read from cache")] navNoReadFromCache = 0x0004,
|
||||
[helpstring("Don't write from cache")] navNoWriteToCache = 0x0008,
|
||||
[helpstring("Try other sites on failure")] navAllowAutosearch = 0x0010,
|
||||
[helpstring("OpenBrowserBar")] navBrowserBar = 0x0020,
|
||||
} BrowserNavConstants;
|
||||
|
||||
[id(DISPID_REFRESH), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)]
|
||||
HRESULT Refresh();
|
||||
|
||||
// The standard Refresh takes no parameters and we need some... use a new name
|
||||
[id(105), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)]
|
||||
HRESULT Refresh2([in,optional] VARIANT * Level);
|
||||
|
||||
typedef
|
||||
[
|
||||
uuid(C317C261-A991-11cf-A731-00A0C9082637),
|
||||
helpstring("Constants for Refresh")
|
||||
]
|
||||
enum RefreshConstants { // must map to these in sdk\inc\docobj.h
|
||||
[helpstring("Refresh normal")] REFRESH_NORMAL = 0, //== OLECMDIDF_REFRESH_NORMAL
|
||||
[helpstring("Refresh if expired")] REFRESH_IFEXPIRED = 1, //== OLECMDIDF_REFRESH_IFEXPIRED
|
||||
[helpstring("Refresh completely")] REFRESH_COMPLETELY = 3 //== OLECMDIDF_REFRESH_COMPLETELY
|
||||
} RefreshConstants;
|
||||
|
||||
[id(106), helpstring("Stops opening a file."), helpcontext(0x0000)]
|
||||
HRESULT Stop();
|
||||
|
||||
// Automation heirarchy...
|
||||
[id(200), propget, helpstring("Returns the application automation object if accessible, this automation object otherwise.."), helpcontext(0x0000)]
|
||||
HRESULT Application([out,retval] IDispatch** ppDisp);
|
||||
|
||||
[id(201), propget, helpstring("Returns the automation object of the container/parent if one exists or this automation object."), helpcontext(0x0000)]
|
||||
HRESULT Parent([out,retval] IDispatch** ppDisp);
|
||||
|
||||
[id(202), propget, helpstring("Returns the container/parent automation object, if any."), helpcontext(0x0000)]
|
||||
HRESULT Container([out,retval] IDispatch** ppDisp);
|
||||
|
||||
[id(203), propget, helpstring("Returns the active Document automation object, if any."), helpcontext(0x0000)]
|
||||
HRESULT Document([out,retval] IDispatch** ppDisp);
|
||||
|
||||
[id(204), propget, helpstring("Returns True if this is the top level object."), helpcontext(0x0000)]
|
||||
HRESULT TopLevelContainer([out, retval] VARIANT_BOOL* pBool);
|
||||
|
||||
[id(205), propget, helpstring("Returns the type of the contained document object."), helpcontext(0x0000)]
|
||||
HRESULT Type([out,retval] BSTR* Type);
|
||||
|
||||
// Window stuff...
|
||||
[id(206), propget, helpstring("The horizontal position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)]
|
||||
HRESULT Left([out, retval] long *pl);
|
||||
[id(206), propput]
|
||||
HRESULT Left([in] long Left);
|
||||
[id(207), propget, helpstring("The vertical position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)]
|
||||
HRESULT Top([out, retval] long *pl);
|
||||
[id(207), propput]
|
||||
HRESULT Top([in] long Top);
|
||||
[id(208), propget, helpstring("The horizontal dimension (pixels) of the frame window/object."), helpcontext(0x0000)]
|
||||
HRESULT Width([out, retval] long *pl);
|
||||
[id(208), propput]
|
||||
HRESULT Width([in] long Width);
|
||||
[id(209), propget, helpstring("The vertical dimension (pixels) of the frame window/object."), helpcontext(0x0000)]
|
||||
HRESULT Height([out, retval] long *pl);
|
||||
[id(209), propput]
|
||||
HRESULT Height([in] long Height);
|
||||
|
||||
// WebBrowser stuff...
|
||||
[id(210), propget, helpstring("Gets the short (UI-friendly) name of the URL/file currently viewed."), helpcontext(0x0000)]
|
||||
HRESULT LocationName([out,retval] BSTR *LocationName);
|
||||
|
||||
[id(211), propget, helpstring("Gets the full URL/path currently viewed."), helpcontext(0x0000)]
|
||||
HRESULT LocationURL([out,retval] BSTR * LocationURL);
|
||||
|
||||
// Added a property to see if the viewer is currenly busy or not...
|
||||
[id(212), propget, helpstring("Query to see if something is still in progress."), helpcontext(0x0000)]
|
||||
HRESULT Busy([out,retval] VARIANT_BOOL *pBool);
|
||||
}
|
||||
|
||||
[
|
||||
uuid(EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B), // DIID_DWebBrowserEvents
|
||||
helpstring("Web Browser Control Events (old)"),
|
||||
hidden
|
||||
]
|
||||
dispinterface DWebBrowserEvents
|
||||
{
|
||||
properties:
|
||||
methods:
|
||||
[id(DISPID_BEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to."), helpcontext(0x0000)]
|
||||
void BeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]VARIANT_BOOL * Cancel);
|
||||
|
||||
[id(DISPID_NAVIGATECOMPLETE), helpstring("Fired when the document being navigated to becomes visible and enters the navigation stack."), helpcontext(0x0000)]
|
||||
void NavigateComplete([in] BSTR URL );
|
||||
|
||||
[id(DISPID_STATUSTEXTCHANGE), helpstring("Statusbar text changed."), helpcontext(0x0000)]
|
||||
void StatusTextChange([in]BSTR Text);
|
||||
|
||||
[id(DISPID_PROGRESSCHANGE), helpstring("Fired when download progress is updated."), helpcontext(0x0000)]
|
||||
void ProgressChange([in] long Progress, [in] long ProgressMax);
|
||||
|
||||
[id(DISPID_DOWNLOADCOMPLETE), helpstring("Download of page complete."), helpcontext(0x0000)]
|
||||
void DownloadComplete();
|
||||
|
||||
[id(DISPID_COMMANDSTATECHANGE), helpstring("The enabled state of a command changed"), helpcontext(0x0000)]
|
||||
void CommandStateChange([in] long Command, [in] VARIANT_BOOL Enable);
|
||||
|
||||
[id(DISPID_DOWNLOADBEGIN), helpstring("Download of a page started."), helpcontext(0x000)]
|
||||
void DownloadBegin();
|
||||
|
||||
[id(DISPID_NEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)]
|
||||
void NewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] VARIANT_BOOL * Processed);
|
||||
|
||||
[id(DISPID_TITLECHANGE), helpstring("Document title changed."), helpcontext(0x0000)]
|
||||
void TitleChange([in]BSTR Text);
|
||||
|
||||
[id(DISPID_FRAMEBEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)]
|
||||
void FrameBeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]VARIANT_BOOL * Cancel);
|
||||
|
||||
[id(DISPID_FRAMENAVIGATECOMPLETE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)]
|
||||
void FrameNavigateComplete([in] BSTR URL );
|
||||
|
||||
[id(DISPID_FRAMENEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)]
|
||||
void FrameNewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] VARIANT_BOOL * Processed);
|
||||
|
||||
// The following are IWebBrowserApp specific:
|
||||
//
|
||||
[id(DISPID_QUIT), helpstring("Fired when application is quiting."), helpcontext(0x0000)]
|
||||
void Quit([in, out] VARIANT_BOOL * Cancel);
|
||||
|
||||
[id(DISPID_WINDOWMOVE), helpstring("Fired when window has been moved."), helpcontext(0x0000)]
|
||||
void WindowMove();
|
||||
|
||||
[id(DISPID_WINDOWRESIZE), helpstring("Fired when window has been sized."), helpcontext(0x0000)]
|
||||
void WindowResize();
|
||||
|
||||
[id(DISPID_WINDOWACTIVATE), helpstring("Fired when window has been activated."), helpcontext(0x0000)]
|
||||
void WindowActivate();
|
||||
|
||||
[id(DISPID_PROPERTYCHANGE), helpstring("Fired when the PutProperty method has been called."), helpcontext(0x0000)]
|
||||
void PropertyChange([in] BSTR Property);
|
||||
}
|
||||
|
||||
|
||||
[
|
||||
uuid(1339B54C-3453-11D2-93B9-000000000000),
|
||||
helpstring("MozillaBrowser Class")
|
||||
]
|
||||
coclass MozillaBrowser
|
||||
{
|
||||
[default] interface IWebBrowser;
|
||||
interface IMozillaBrowser;
|
||||
// [default, source] dispinterface DWebBrowserEvents2;
|
||||
[default, source] dispinterface DWebBrowserEvents;
|
||||
};
|
||||
};
|
124
webshell/embed/ActiveX/MozillaControl.rc
Normal file
124
webshell/embed/ActiveX/MozillaControl.rc
Normal file
@ -0,0 +1,124 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"1 TYPELIB ""MozillaControl.tlb""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "MozillaControl Module\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "MOZILLACONTROL\0"
|
||||
VALUE "LegalCopyright", "Copyright 1997\0"
|
||||
VALUE "OriginalFilename", "MOZILLACONTROL.DLL\0"
|
||||
VALUE "ProductName", "MozillaControl Module\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
VALUE "OLESelfRegister", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_MOZILLABROWSER REGISTRY DISCARDABLE "MozillaBrowser.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "MozillaControl"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
1 TYPELIB "MozillaControl.tlb"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
BIN
webshell/embed/ActiveX/MozillaControl.tlb
Normal file
BIN
webshell/embed/ActiveX/MozillaControl.tlb
Normal file
Binary file not shown.
56
webshell/embed/ActiveX/MozillaControl_i.c
Normal file
56
webshell/embed/ActiveX/MozillaControl_i.c
Normal file
@ -0,0 +1,56 @@
|
||||
/* this file contains the actual definitions of */
|
||||
/* the IIDs and CLSIDs */
|
||||
|
||||
/* link this file in with the server and any clients */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 3.03.0110 */
|
||||
/* at Sun Aug 23 21:54:29 1998
|
||||
*/
|
||||
/* Compiler settings for MozillaControl.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: none
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IID_DEFINED__
|
||||
#define __IID_DEFINED__
|
||||
|
||||
typedef struct _IID
|
||||
{
|
||||
unsigned long x;
|
||||
unsigned short s1;
|
||||
unsigned short s2;
|
||||
unsigned char c[8];
|
||||
} IID;
|
||||
|
||||
#endif // __IID_DEFINED__
|
||||
|
||||
#ifndef CLSID_DEFINED
|
||||
#define CLSID_DEFINED
|
||||
typedef IID CLSID;
|
||||
#endif // CLSID_DEFINED
|
||||
|
||||
const IID IID_IMozillaBrowser = {0x1339B54B,0x3453,0x11D2,{0x93,0xB9,0x00,0x00,0x00,0x00,0x00,0x00}};
|
||||
|
||||
|
||||
const IID LIBID_MOZILLACONTROLLib = {0x1339B53E,0x3453,0x11D2,{0x93,0xB9,0x00,0x00,0x00,0x00,0x00,0x00}};
|
||||
|
||||
|
||||
const IID IID_IWebBrowser = {0xEAB22AC1,0x30C1,0x11CF,{0xA7,0xEB,0x00,0x00,0xC0,0x5B,0xAE,0x0B}};
|
||||
|
||||
|
||||
const IID DIID_DWebBrowserEvents = {0xEAB22AC2,0x30C1,0x11CF,{0xA7,0xEB,0x00,0x00,0xC0,0x5B,0xAE,0x0B}};
|
||||
|
||||
|
||||
const CLSID CLSID_MozillaBrowser = {0x1339B54C,0x3453,0x11D2,{0x93,0xB9,0x00,0x00,0x00,0x00,0x00,0x00}};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
277
webshell/embed/ActiveX/MozillaControl_p.c
Normal file
277
webshell/embed/ActiveX/MozillaControl_p.c
Normal file
@ -0,0 +1,277 @@
|
||||
/* this ALWAYS GENERATED file contains the proxy stub code */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 3.03.0110 */
|
||||
/* at Sun Aug 23 21:54:29 1998
|
||||
*/
|
||||
/* Compiler settings for MozillaControl.idl:
|
||||
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
|
||||
error checks: none
|
||||
*/
|
||||
//@@MIDL_FILE_HEADING( )
|
||||
|
||||
#define USE_STUBLESS_PROXY
|
||||
|
||||
|
||||
/* verify that the <rpcproxy.h> version is high enough to compile this file*/
|
||||
#ifndef __REDQ_RPCPROXY_H_VERSION__
|
||||
#define __REQUIRED_RPCPROXY_H_VERSION__ 440
|
||||
#endif
|
||||
|
||||
|
||||
#include "rpcproxy.h"
|
||||
#ifndef __RPCPROXY_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcproxy.h>
|
||||
#endif // __RPCPROXY_H_VERSION__
|
||||
|
||||
|
||||
#include "MozillaControl.h"
|
||||
|
||||
#define TYPE_FORMAT_STRING_SIZE 5
|
||||
#define PROC_FORMAT_STRING_SIZE 25
|
||||
|
||||
typedef struct _MIDL_TYPE_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
|
||||
} MIDL_TYPE_FORMAT_STRING;
|
||||
|
||||
typedef struct _MIDL_PROC_FORMAT_STRING
|
||||
{
|
||||
short Pad;
|
||||
unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
|
||||
} MIDL_PROC_FORMAT_STRING;
|
||||
|
||||
|
||||
extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
|
||||
extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
|
||||
|
||||
|
||||
/* Object interface: IUnknown, ver. 0.0,
|
||||
GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
|
||||
|
||||
|
||||
/* Object interface: IDispatch, ver. 0.0,
|
||||
GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
|
||||
|
||||
|
||||
/* Object interface: IMozillaBrowser, ver. 0.0,
|
||||
GUID={0x1339B54B,0x3453,0x11D2,{0x93,0xB9,0x00,0x00,0x00,0x00,0x00,0x00}} */
|
||||
|
||||
|
||||
extern const MIDL_STUB_DESC Object_StubDesc;
|
||||
|
||||
|
||||
extern const MIDL_SERVER_INFO IMozillaBrowser_ServerInfo;
|
||||
|
||||
#pragma code_seg(".orpc")
|
||||
|
||||
static const MIDL_STUB_DESC Object_StubDesc =
|
||||
{
|
||||
0,
|
||||
NdrOleAllocate,
|
||||
NdrOleFree,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__MIDL_TypeFormatString.Format,
|
||||
0, /* -error bounds_check flag */
|
||||
0x20000, /* Ndr library version */
|
||||
0,
|
||||
0x303006e, /* MIDL Version 3.3.110 */
|
||||
0,
|
||||
0,
|
||||
0, /* Reserved1 */
|
||||
0, /* Reserved2 */
|
||||
0, /* Reserved3 */
|
||||
0, /* Reserved4 */
|
||||
0 /* Reserved5 */
|
||||
};
|
||||
|
||||
static const unsigned short IMozillaBrowser_FormatStringOffsetTable[] =
|
||||
{
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
(unsigned short) -1,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_SERVER_INFO IMozillaBrowser_ServerInfo =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
0,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&IMozillaBrowser_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
static const MIDL_STUBLESS_PROXY_INFO IMozillaBrowser_ProxyInfo =
|
||||
{
|
||||
&Object_StubDesc,
|
||||
__MIDL_ProcFormatString.Format,
|
||||
&IMozillaBrowser_FormatStringOffsetTable[-3],
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
CINTERFACE_PROXY_VTABLE(8) _IMozillaBrowserProxyVtbl =
|
||||
{
|
||||
&IMozillaBrowser_ProxyInfo,
|
||||
&IID_IMozillaBrowser,
|
||||
IUnknown_QueryInterface_Proxy,
|
||||
IUnknown_AddRef_Proxy,
|
||||
IUnknown_Release_Proxy ,
|
||||
0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
|
||||
0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
|
||||
0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
|
||||
0 /* IDispatch_Invoke_Proxy */ ,
|
||||
(void *)-1 /* IMozillaBrowser::get_Window */
|
||||
};
|
||||
|
||||
|
||||
static const PRPC_STUB_FUNCTION IMozillaBrowser_table[] =
|
||||
{
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
STUB_FORWARDING_FUNCTION,
|
||||
NdrStubCall2
|
||||
};
|
||||
|
||||
CInterfaceStubVtbl _IMozillaBrowserStubVtbl =
|
||||
{
|
||||
&IID_IMozillaBrowser,
|
||||
&IMozillaBrowser_ServerInfo,
|
||||
8,
|
||||
&IMozillaBrowser_table[-3],
|
||||
CStdStubBuffer_DELEGATING_METHODS
|
||||
};
|
||||
|
||||
#pragma data_seg(".rdata")
|
||||
|
||||
#if !defined(__RPC_WIN32__)
|
||||
#error Invalid build platform for this stub.
|
||||
#endif
|
||||
|
||||
#if !(TARGET_IS_NT40_OR_LATER)
|
||||
#error You need a Windows NT 4.0 or later to run this stub because it uses these features:
|
||||
#error -Oif or -Oicf.
|
||||
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
|
||||
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
|
||||
#endif
|
||||
|
||||
|
||||
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
|
||||
/* Procedure get_Window */
|
||||
|
||||
0x33, /* FC_AUTO_HANDLE */
|
||||
0x64, /* 100 */
|
||||
/* 2 */ NdrFcShort( 0x7 ), /* 7 */
|
||||
#ifndef _ALPHA_
|
||||
/* 4 */ NdrFcShort( 0xc ), /* x86, MIPS, PPC Stack size/offset = 12 */
|
||||
#else
|
||||
NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
|
||||
#endif
|
||||
/* 6 */ NdrFcShort( 0x0 ), /* 0 */
|
||||
/* 8 */ NdrFcShort( 0x10 ), /* 16 */
|
||||
/* 10 */ 0x4, /* 4 */
|
||||
0x2, /* 2 */
|
||||
|
||||
/* Parameter phwnd */
|
||||
|
||||
/* 12 */ NdrFcShort( 0x2150 ), /* 8528 */
|
||||
#ifndef _ALPHA_
|
||||
/* 14 */ NdrFcShort( 0x4 ), /* x86, MIPS, PPC Stack size/offset = 4 */
|
||||
#else
|
||||
NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */
|
||||
#endif
|
||||
/* 16 */ 0x8, /* FC_LONG */
|
||||
0x0, /* 0 */
|
||||
|
||||
/* Return value */
|
||||
|
||||
/* 18 */ NdrFcShort( 0x70 ), /* 112 */
|
||||
#ifndef _ALPHA_
|
||||
/* 20 */ NdrFcShort( 0x8 ), /* x86, MIPS, PPC Stack size/offset = 8 */
|
||||
#else
|
||||
NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
|
||||
#endif
|
||||
/* 22 */ 0x8, /* FC_LONG */
|
||||
0x0, /* 0 */
|
||||
|
||||
0x0
|
||||
}
|
||||
};
|
||||
|
||||
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
|
||||
{
|
||||
0,
|
||||
{
|
||||
0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */
|
||||
/* 2 */ 0x8, /* FC_LONG */
|
||||
0x5c, /* FC_PAD */
|
||||
|
||||
0x0
|
||||
}
|
||||
};
|
||||
|
||||
const CInterfaceProxyVtbl * _MozillaControl_ProxyVtblList[] =
|
||||
{
|
||||
( CInterfaceProxyVtbl *) &_IMozillaBrowserProxyVtbl,
|
||||
0
|
||||
};
|
||||
|
||||
const CInterfaceStubVtbl * _MozillaControl_StubVtblList[] =
|
||||
{
|
||||
( CInterfaceStubVtbl *) &_IMozillaBrowserStubVtbl,
|
||||
0
|
||||
};
|
||||
|
||||
PCInterfaceName const _MozillaControl_InterfaceNamesList[] =
|
||||
{
|
||||
"IMozillaBrowser",
|
||||
0
|
||||
};
|
||||
|
||||
const IID * _MozillaControl_BaseIIDList[] =
|
||||
{
|
||||
&IID_IDispatch,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
#define _MozillaControl_CHECK_IID(n) IID_GENERIC_CHECK_IID( _MozillaControl, pIID, n)
|
||||
|
||||
int __stdcall _MozillaControl_IID_Lookup( const IID * pIID, int * pIndex )
|
||||
{
|
||||
|
||||
if(!_MozillaControl_CHECK_IID(0))
|
||||
{
|
||||
*pIndex = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const ExtendedProxyFileInfo MozillaControl_ProxyFileInfo =
|
||||
{
|
||||
(PCInterfaceProxyVtblList *) & _MozillaControl_ProxyVtblList,
|
||||
(PCInterfaceStubVtblList *) & _MozillaControl_StubVtblList,
|
||||
(const PCInterfaceName * ) & _MozillaControl_InterfaceNamesList,
|
||||
(const IID ** ) & _MozillaControl_BaseIIDList,
|
||||
& _MozillaControl_IID_Lookup,
|
||||
1,
|
||||
2
|
||||
};
|
11
webshell/embed/ActiveX/MozillaControlps.def
Normal file
11
webshell/embed/ActiveX/MozillaControlps.def
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
LIBRARY "MozillaControlPS"
|
||||
|
||||
DESCRIPTION 'Proxy/Stub DLL'
|
||||
|
||||
EXPORTS
|
||||
DllGetClassObject @1 PRIVATE
|
||||
DllCanUnloadNow @2 PRIVATE
|
||||
GetProxyDllInfo @3 PRIVATE
|
||||
DllRegisterServer @4 PRIVATE
|
||||
DllUnregisterServer @5 PRIVATE
|
14
webshell/embed/ActiveX/StdAfx.cpp
Normal file
14
webshell/embed/ActiveX/StdAfx.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// stdafx.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _ATL_STATIC_REGISTRY
|
||||
#include <statreg.h>
|
||||
#include <statreg.cpp>
|
||||
#endif
|
||||
|
||||
#include <atlimpl.cpp>
|
||||
#include <atlctl.cpp>
|
||||
#include <atlwin.cpp>
|
49
webshell/embed/ActiveX/StdAfx.h
Normal file
49
webshell/embed/ActiveX/StdAfx.h
Normal file
@ -0,0 +1,49 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#if !defined(AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_)
|
||||
#define AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#define STRICT
|
||||
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
|
||||
|
||||
#include <atlbase.h>
|
||||
//You may derive a class from CComModule and use it if you want to override
|
||||
//something, but do not change the name of _Module
|
||||
extern CComModule _Module;
|
||||
#include <atlcom.h>
|
||||
#include <atlctl.h>
|
||||
|
||||
/* Headers from NGLayout... */
|
||||
#include <malloc.h>
|
||||
|
||||
#include "nsGlobalVariables.h"
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentObserver.h"
|
||||
#include "nsUnitConversion.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prthread.h"
|
||||
#include "prprf.h"
|
||||
#include "nsRepository.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsViewsCID.h"
|
||||
#include "nsString.h"
|
||||
#include "plevent.h"
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED)
|
127
webshell/embed/ActiveX/WebShellContainer.cpp
Normal file
127
webshell/embed/ActiveX/WebShellContainer.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "WebShellContainer.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
|
||||
|
||||
|
||||
CWebShellContainer::CWebShellContainer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CWebShellContainer::~CWebShellContainer()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(CWebShellContainer)
|
||||
NS_IMPL_RELEASE(CWebShellContainer)
|
||||
|
||||
nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
*aInstancePtrResult = NULL;
|
||||
/*
|
||||
if (aIID.Equals(kIBrowserWindowIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsIBrowserWindow*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kIStreamObserverIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsIStreamObserver*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
*/
|
||||
if (aIID.Equals(kIWebShellContainerIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsIWebShellContainer*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
/* if (aIID.Equals(kINetSupportIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsINetSupport*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsISupports*)((nsIBrowserWindow*)this));
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
*/
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SetTitle(const PRUnichar* aTitle)
|
||||
{
|
||||
m_sTitle = aTitle;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetTitle(PRUnichar** aResult)
|
||||
{
|
||||
*aResult = m_sTitle;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason)
|
||||
{
|
||||
// if (mStatus) {
|
||||
// nsAutoString url("Connecting to ");
|
||||
// url.Append(aURL);
|
||||
// mStatus->SetText(url);
|
||||
// }
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL)
|
||||
{
|
||||
// if (mThrobber) {
|
||||
// mThrobber->Start();
|
||||
// mLocation->SetText(aURL);
|
||||
// }
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus)
|
||||
{
|
||||
// if (mThrobber) {
|
||||
// mThrobber->Stop();
|
||||
// }
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::OverLink(nsIWebShell* aShell, const PRUnichar* aURLSpec, const PRUnichar* aTargetSpec)
|
||||
{
|
||||
// if (nsnull != mStatus)
|
||||
// {
|
||||
// mStatus->SetText(aURLSpec);
|
||||
// }
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::NewWebShell(nsIWebShell *&aNewWebShell)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
return rv;
|
||||
}
|
||||
|
31
webshell/embed/ActiveX/WebShellContainer.h
Normal file
31
webshell/embed/ActiveX/WebShellContainer.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef WEBSHELLCONTAINER_H
|
||||
#define WEBSHELLCONTAINER_H
|
||||
|
||||
class CWebShellContainer :
|
||||
public nsIWebShellContainer
|
||||
{
|
||||
public:
|
||||
CWebShellContainer();
|
||||
protected:
|
||||
virtual ~CWebShellContainer();
|
||||
|
||||
// Protected members
|
||||
protected:
|
||||
nsString m_sTitle;
|
||||
|
||||
public:
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIWebShellContainer
|
||||
NS_IMETHOD SetTitle(const PRUnichar* aTitle);
|
||||
NS_IMETHOD GetTitle(PRUnichar** aResult);
|
||||
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);
|
||||
NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL);
|
||||
NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax);
|
||||
NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus);
|
||||
NS_IMETHOD OverLink(nsIWebShell* aShell, const PRUnichar* aURLSpec, const PRUnichar* aTargetSpec);
|
||||
NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell);
|
||||
};
|
||||
|
||||
#endif
|
38
webshell/embed/ActiveX/dlldata.c
Normal file
38
webshell/embed/ActiveX/dlldata.c
Normal file
@ -0,0 +1,38 @@
|
||||
/*********************************************************
|
||||
DllData file -- generated by MIDL compiler
|
||||
|
||||
DO NOT ALTER THIS FILE
|
||||
|
||||
This file is regenerated by MIDL on every IDL file compile.
|
||||
|
||||
To completely reconstruct this file, delete it and rerun MIDL
|
||||
on all the IDL files in this DLL, specifying this file for the
|
||||
/dlldata command line option
|
||||
|
||||
*********************************************************/
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
|
||||
#include <rpcproxy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN_PROXY_FILE( MozillaControl )
|
||||
|
||||
|
||||
PROXYFILE_LIST_START
|
||||
/* Start of list */
|
||||
REFERENCE_PROXY_FILE( MozillaControl ),
|
||||
/* End of list */
|
||||
PROXYFILE_LIST_END
|
||||
|
||||
|
||||
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of generated dlldata file */
|
90
webshell/embed/ActiveX/makefile.win
Normal file
90
webshell/embed/ActiveX/makefile.win
Normal file
@ -0,0 +1,90 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
!if "$(MSSDK)" == ""
|
||||
!message This module requires the MS Platform SDK to be installed.
|
||||
!else
|
||||
|
||||
DLLNAME = MozillaControl
|
||||
QUIET =
|
||||
DEPTH =..\..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
RESFILE = $(DLLNAME).res
|
||||
DEFFILE = $(DLLNAME).def
|
||||
OS_CFLAGS = /D "WIN32"
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\StdAfx.obj \
|
||||
.\$(OBJDIR)\nsSetupRegistry.obj \
|
||||
.\$(OBJDIR)\MozillaControl.obj \
|
||||
.\$(OBJDIR)\MozillaBrowser.obj \
|
||||
.\$(OBJDIR)\WebShellContainer.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\java \
|
||||
-I$(PUBLIC)\plugin \
|
||||
-I$(PUBLIC)\pref
|
||||
|
||||
MYLIBS= \
|
||||
$(DIST)\lib\raptorbase.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
$(DIST)\lib\raptorweb.lib \
|
||||
$(DIST)\lib\xpcom32.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
LLIBS = $(MYLIBS) \
|
||||
comdlg32.lib \
|
||||
ole32.lib \
|
||||
oleaut32.lib \
|
||||
uuid.lib \
|
||||
shell32.lib \
|
||||
-SUBSYSTEM:windows
|
||||
|
||||
LFLAGS = /DLL
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
!ifdef MOZ_NO_DEBUG_RTL
|
||||
OS_CFLAGS = $(OS_CFLAGS) -DMOZ_NO_DEBUG_RTL
|
||||
!endif
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin
|
||||
regsvr32 /s /c $(DIST)\bin\$(DLLNAME).dll
|
||||
|
||||
MozillaControl_i.c MozillaControl.h: MozillaControl.idl
|
||||
midl /Oicf /h MozillaControl.h /iid MozillaControl_i.c MozillaControl.idl
|
||||
|
||||
MozillaControl.cpp \
|
||||
MozillaBrowser.cpp \
|
||||
WebShellContainer.cpp \
|
||||
StdAfx.cpp: StdAfx.h MozillaControl.h
|
||||
|
||||
clobber::
|
||||
regsvr32 /s /c /u $(DIST)\bin\$(DLLNAME).dll
|
||||
|
||||
!endif
|
26
webshell/embed/ActiveX/nsSetupRegistry.cpp
Normal file
26
webshell/embed/ActiveX/nsSetupRegistry.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This evil file will go away when the XPCOM registry can be
|
||||
* externally initialized!
|
||||
*
|
||||
* Until then, include the real file to keep everything in sync.
|
||||
*/
|
||||
#include "..\..\tests\viewer\nsSetupRegistry.cpp"
|
17
webshell/embed/ActiveX/resource.h
Normal file
17
webshell/embed/ActiveX/resource.h
Normal file
@ -0,0 +1,17 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by MozillaControl.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_MOZILLABROWSER 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
23
webshell/embed/makefile.win
Normal file
23
webshell/embed/makefile.win
Normal file
@ -0,0 +1,23 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DIRS= ActiveX
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
@ -18,6 +18,12 @@
|
||||
DEPTH=..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DIRS=public src tests
|
||||
DIRS=public \
|
||||
src \
|
||||
tests \
|
||||
!if "$(MSSDK)" != ""
|
||||
embed \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
Loading…
Reference in New Issue
Block a user