diff --git a/embedding/browser/activex/src/Makefile.in b/embedding/browser/activex/src/Makefile.in deleted file mode 100644 index fc3617a826a..00000000000 --- a/embedding/browser/activex/src/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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/MPL/ -# -# 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 the Mozilla browser. -# -# The Initial Developer of the Original Code is -# Netscape Communications, Inc. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = activex - -DIRS = $(NULL) - -# Common -DIRS += common - -# ActiveX plugin -ifdef MOZ_ACTIVEX_SCRIPTING_SUPPORT -DIRS += plugin -endif - -# The ActiveX control is now built in tier 99 from mozilla/Makefile.in - -include $(topsrcdir)/config/rules.mk diff --git a/embedding/browser/activex/src/common/CPMozillaControl.h b/embedding/browser/activex/src/common/CPMozillaControl.h deleted file mode 100644 index 14283f177b6..00000000000 --- a/embedding/browser/activex/src/common/CPMozillaControl.h +++ /dev/null @@ -1,949 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef CPMOZILLACONTROL_H -#define CPMOZILLACONTROL_H - -////////////////////////////////////////////////////////////////////////////// -// CProxyDWebBrowserEvents -template -class CProxyDWebBrowserEvents : public IConnectionPointImpl -{ -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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*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(*pp); - pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - -}; - - -////////////////////////////////////////////////////////////////////////////// -// CProxyDWebBrowserEvents2 -template -class CProxyDWebBrowserEvents2 : public IConnectionPointImpl -{ -public: -//methods: -//DWebBrowserEvents2 : IDispatch -public: - 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(*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(*pp); - pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - 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(*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(*pp); - pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - 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(*pp); - pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - 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(*pp); - pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_PropertyChange( - BSTR szProperty) - { - 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= szProperty; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_BeforeNavigate2( - IDispatch * pDisp, - VARIANT * URL, - VARIANT * Flags, - VARIANT * TargetFrameName, - VARIANT * PostData, - VARIANT * Headers, - VARIANT_BOOL * Cancel) - { - VARIANTARG* pvars = new VARIANTARG[7]; - for (int i = 0; i < 7; i++) - VariantInit(&pvars[i]); - T* pT = (T*)this; - pT->Lock(); - IUnknown** pp = m_vec.begin(); - while (pp < m_vec.end()) - { - if (*pp != NULL) - { - pvars[6].vt = VT_DISPATCH; - pvars[6].pdispVal= pDisp; - pvars[5].vt = VT_VARIANT | VT_BYREF; - pvars[5].byref= URL; - pvars[4].vt = VT_VARIANT | VT_BYREF; - pvars[4].byref= Flags; - pvars[3].vt = VT_VARIANT | VT_BYREF; - pvars[3].byref= TargetFrameName; - pvars[2].vt = VT_VARIANT | VT_BYREF; - pvars[2].byref= PostData; - pvars[1].vt = VT_VARIANT | VT_BYREF; - pvars[1].byref= Headers; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 7, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfa, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_NewWindow2( - IDispatch * * ppDisp, - VARIANT_BOOL * Cancel) - { - 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_DISPATCH | VT_BYREF; - pvars[1].byref= ppDisp; - pvars[0].vt = VT_BOOL | VT_BYREF; - pvars[0].byref= Cancel; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfb, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_NavigateComplete2( - IDispatch * pDisp, - VARIANT * URL) - { - 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_DISPATCH; - pvars[1].pdispVal= pDisp; - pvars[0].vt = VT_VARIANT | VT_BYREF; - pvars[0].byref= URL; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_DocumentComplete( - IDispatch * pDisp, - VARIANT * URL) - { - 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_DISPATCH; - pvars[1].pdispVal= pDisp; - pvars[0].vt = VT_VARIANT | VT_BYREF; - pvars[0].byref= URL; - DISPPARAMS disp = { pvars, NULL, 2, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x103, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnQuit() - { - 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(*pp); - pDispatch->Invoke(0xfd, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - } - void Fire_OnVisible( - VARIANT_BOOL Visible) - { - 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; - pvars[0].boolVal= Visible; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xfe, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnToolBar( - VARIANT_BOOL ToolBar) - { - 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; - pvars[0].boolVal= ToolBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0xff, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnMenuBar( - VARIANT_BOOL MenuBar) - { - 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; - pvars[0].boolVal= MenuBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x100, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnStatusBar( - VARIANT_BOOL StatusBar) - { - 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; - pvars[0].boolVal= StatusBar; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x101, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnFullScreen( - VARIANT_BOOL FullScreen) - { - 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; - pvars[0].boolVal= FullScreen; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x102, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - void Fire_OnTheaterMode( - VARIANT_BOOL TheaterMode) - { - 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; - pvars[0].boolVal= TheaterMode; - DISPPARAMS disp = { pvars, NULL, 1, 0 }; - IDispatch* pDispatch = reinterpret_cast(*pp); - pDispatch->Invoke(0x104, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL); - } - pp++; - } - pT->Unlock(); - delete[] pvars; - } - -}; - - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/ControlEventSink.cpp b/embedding/browser/activex/src/common/ControlEventSink.cpp deleted file mode 100644 index 59ef0805daf..00000000000 --- a/embedding/browser/activex/src/common/ControlEventSink.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include "ControlEventSink.h" - -CControlEventSink::CControlEventSink() : - m_dwEventCookie(0), - m_EventIID(GUID_NULL) -{ -} - -CControlEventSink::~CControlEventSink() -{ - UnsubscribeFromEvents(); -} - -BOOL -CControlEventSink::GetEventSinkIID(IUnknown *pControl, IID &iid, ITypeInfo **typeInfo) -{ - iid = GUID_NULL; - if (!pControl) - { - return E_INVALIDARG; - } - - // IProvideClassInfo2 way is easiest -// CComQIPtr classInfo2 = pControl; -// if (classInfo2) -// { -// classInfo2->GetGUID(GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid); -// if (!::IsEqualIID(iid, GUID_NULL)) -// { -// return TRUE; -// } -// } - - // Yuck, the hard way - CComQIPtr classInfo = pControl; - if (!classInfo) - { - return FALSE; - } - - // Search the class type information for the default source interface - // which is the outgoing event sink. - - CComPtr classTypeInfo; - classInfo->GetClassInfo(&classTypeInfo); - if (!classTypeInfo) - { - return FALSE; - } - TYPEATTR *classAttr = NULL; - if (FAILED(classTypeInfo->GetTypeAttr(&classAttr))) - { - return FALSE; - } - INT implFlags = 0; - for (UINT i = 0; i < classAttr->cImplTypes; i++) - { - // Search for the interface with the [default, source] attr - if (SUCCEEDED(classTypeInfo->GetImplTypeFlags(i, &implFlags)) && - implFlags == (IMPLTYPEFLAG_FDEFAULT | IMPLTYPEFLAG_FSOURCE)) - { - CComPtr eventSinkTypeInfo; - HREFTYPE hRefType; - if (SUCCEEDED(classTypeInfo->GetRefTypeOfImplType(i, &hRefType)) && - SUCCEEDED(classTypeInfo->GetRefTypeInfo(hRefType, &eventSinkTypeInfo))) - { - TYPEATTR *eventSinkAttr = NULL; - if (SUCCEEDED(eventSinkTypeInfo->GetTypeAttr(&eventSinkAttr))) - { - iid = eventSinkAttr->guid; - if (typeInfo) - { - *typeInfo = eventSinkTypeInfo.p; - (*typeInfo)->AddRef(); - } - eventSinkTypeInfo->ReleaseTypeAttr(eventSinkAttr); - } - } - break; - } - } - classTypeInfo->ReleaseTypeAttr(classAttr); - - return (!::IsEqualIID(iid, GUID_NULL)); -} - -void CControlEventSink::UnsubscribeFromEvents() -{ - if (m_spEventCP) - { - // Unsubscribe and reset - m_spEventCP->Unadvise(m_dwEventCookie); - m_dwEventCookie = 0; - m_spEventCP.Release(); - } -} - -HRESULT CControlEventSink::SubscribeToEvents(IUnknown *pControl) -{ - if (!pControl) - { - return E_INVALIDARG; - } - - // Throw away any existing connections - UnsubscribeFromEvents(); - - // Grab the outgoing event sink IID which will be used to subscribe - // to events via the connection point container. - - IID iidEventSink; - CComPtr typeInfo; - if (!GetEventSinkIID(pControl, iidEventSink, &typeInfo)) - { - return E_FAIL; - } - - // Get the connection point - CComQIPtr ccp = pControl; - CComPtr cp; - if (!ccp) - { - return E_FAIL; - } - - // Custom IID - m_EventIID = iidEventSink; - DWORD dwCookie = 0; - if (!ccp || - FAILED(ccp->FindConnectionPoint(m_EventIID, &cp)) || - FAILED(cp->Advise(this, &dwCookie))) - { - return E_FAIL; - } - - m_spEventCP = cp; - m_dwEventCookie = dwCookie; - m_spEventSinkTypeInfo = typeInfo; - return S_OK; -} - -HRESULT -CControlEventSink::InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - // Override me! - return E_NOTIMPL; -} - -/////////////////////////////////////////////////////////////////////////////// -// IDispatch implementation - - -HRESULT STDMETHODCALLTYPE CControlEventSink::GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlEventSink::GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlEventSink::GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlEventSink::Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr) -{ - return InternalInvoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); -} - - diff --git a/embedding/browser/activex/src/common/ControlEventSink.h b/embedding/browser/activex/src/common/ControlEventSink.h deleted file mode 100644 index 44b45bad40b..00000000000 --- a/embedding/browser/activex/src/common/ControlEventSink.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef CONTROLEVENTSINK_H -#define CONTROLEVENTSINK_H - -// This class listens for events from the specified control - -class CControlEventSink : - public CComObjectRootEx, - public IDispatch -{ -public: - CControlEventSink(); - - // Current event connection point - CComPtr m_spEventCP; - CComPtr m_spEventSinkTypeInfo; - DWORD m_dwEventCookie; - IID m_EventIID; - -protected: - virtual ~CControlEventSink(); - - static HRESULT WINAPI SinkQI(void* pv, REFIID riid, LPVOID* ppv, DWORD_PTR dw) - { - CControlEventSink *pThis = (CControlEventSink *) pv; - if (!IsEqualIID(pThis->m_EventIID, GUID_NULL) && - IsEqualIID(pThis->m_EventIID, riid)) - { - return pThis->QueryInterface(__uuidof(IDispatch), ppv); - } - return E_NOINTERFACE; - } - -public: - -BEGIN_COM_MAP(CControlEventSink) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY_FUNC_BLIND(0, SinkQI) -END_COM_MAP() - - virtual HRESULT SubscribeToEvents(IUnknown *pControl); - virtual void UnsubscribeFromEvents(); - virtual BOOL GetEventSinkIID(IUnknown *pControl, IID &iid, ITypeInfo **typeInfo); - virtual HRESULT InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); - -// IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo); - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr); -}; - -typedef CComObject CControlEventSinkInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/ControlSite.cpp b/embedding/browser/activex/src/common/ControlSite.cpp deleted file mode 100644 index 6bb8c4946e9..00000000000 --- a/embedding/browser/activex/src/common/ControlSite.cpp +++ /dev/null @@ -1,1421 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include - -#include "ControlSite.h" -#include "PropertyBag.h" -#include "ControlSiteIPFrame.h" - -class CDefaultControlSiteSecurityPolicy : public CControlSiteSecurityPolicy -{ - // Test if the specified class id implements the specified category - BOOL ClassImplementsCategory(const CLSID & clsid, const CATID &catid, BOOL &bClassExists); -public: - // Test if the class is safe to host - virtual BOOL IsClassSafeToHost(const CLSID & clsid); - // Test if the specified class is marked safe for scripting - virtual BOOL IsClassMarkedSafeForScripting(const CLSID & clsid, BOOL &bClassExists); - // Test if the instantiated object is safe for scripting on the specified interface - virtual BOOL IsObjectSafeForScripting(IUnknown *pObject, const IID &iid); -}; - -BOOL -CDefaultControlSiteSecurityPolicy::ClassImplementsCategory(const CLSID &clsid, const CATID &catid, BOOL &bClassExists) -{ - bClassExists = FALSE; - - // Test if there is a CLSID entry. If there isn't then obviously - // the object doesn't exist and therefore doesn't implement any category. - // In this situation, the function returns REGDB_E_CLASSNOTREG. - - CRegKey key; - if (key.Open(HKEY_CLASSES_ROOT, _T("CLSID"), KEY_READ) != ERROR_SUCCESS) - { - // Must fail if we can't even open this! - return FALSE; - } - LPOLESTR szCLSID = NULL; - if (FAILED(StringFromCLSID(clsid, &szCLSID))) - { - return FALSE; - } - USES_CONVERSION; - CRegKey keyCLSID; - LONG lResult = keyCLSID.Open(key, W2CT(szCLSID), KEY_READ); - CoTaskMemFree(szCLSID); - if (lResult != ERROR_SUCCESS) - { - // Class doesn't exist - return FALSE; - } - keyCLSID.Close(); - - // CLSID exists, so try checking what categories it implements - bClassExists = TRUE; - CComQIPtr spCatInfo; - HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatInformation, (LPVOID*) &spCatInfo); - if (spCatInfo == NULL) - { - // Must fail if we can't open the category manager - return FALSE; - } - - // See what categories the class implements - CComQIPtr spEnumCATID; - if (FAILED(spCatInfo->EnumImplCategoriesOfClass(clsid, &spEnumCATID))) - { - // Can't enumerate classes in category so fail - return FALSE; - } - - // Search for matching categories - BOOL bFound = FALSE; - CATID catidNext = GUID_NULL; - while (spEnumCATID->Next(1, &catidNext, NULL) == S_OK) - { - if (::IsEqualCATID(catid, catidNext)) - { - return TRUE; - } - } - - return FALSE; -} - -// Test if the class is safe to host -BOOL CDefaultControlSiteSecurityPolicy::IsClassSafeToHost(const CLSID & clsid) -{ - return TRUE; -} - -// Test if the specified class is marked safe for scripting -BOOL CDefaultControlSiteSecurityPolicy::IsClassMarkedSafeForScripting(const CLSID & clsid, BOOL &bClassExists) -{ - // Test the category the object belongs to - return ClassImplementsCategory(clsid, CATID_SafeForScripting, bClassExists); -} - -// Test if the instantiated object is safe for scripting on the specified interface -BOOL CDefaultControlSiteSecurityPolicy::IsObjectSafeForScripting(IUnknown *pObject, const IID &iid) -{ - if (!pObject) { - return FALSE; - } - // Ask the control if its safe for scripting - CComQIPtr spObjectSafety = pObject; - if (!spObjectSafety) - { - return FALSE; - } - - DWORD dwSupported = 0; // Supported options (mask) - DWORD dwEnabled = 0; // Enabled options - - // Assume scripting via IDispatch - if (FAILED(spObjectSafety->GetInterfaceSafetyOptions( - iid, &dwSupported, &dwEnabled))) - { - // Interface is not safe or failure. - return FALSE; - } - - // Test if safe for scripting - if (!(dwEnabled & dwSupported) & INTERFACESAFE_FOR_UNTRUSTED_CALLER) - { - // Object says it is not set to be safe, but supports unsafe calling, - // try enabling it and asking again. - - if(!(dwSupported & INTERFACESAFE_FOR_UNTRUSTED_CALLER) || - FAILED(spObjectSafety->SetInterfaceSafetyOptions( - iid, INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_CALLER)) || - FAILED(spObjectSafety->GetInterfaceSafetyOptions( - iid, &dwSupported, &dwEnabled)) || - !(dwEnabled & dwSupported) & INTERFACESAFE_FOR_UNTRUSTED_CALLER) - { - return FALSE; - } - } - - return TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// - -// Constructor -CControlSite::CControlSite() -{ - TRACE_METHOD(CControlSite::CControlSite); - - m_hWndParent = NULL; - m_CLSID = CLSID_NULL; - m_bSetClientSiteFirst = FALSE; - m_bVisibleAtRuntime = TRUE; - memset(&m_rcObjectPos, 0, sizeof(m_rcObjectPos)); - - m_bInPlaceActive = FALSE; - m_bUIActive = FALSE; - m_bInPlaceLocked = FALSE; - m_bWindowless = FALSE; - m_bSupportWindowlessActivation = TRUE; - m_bSafeForScriptingObjectsOnly = FALSE; - m_pSecurityPolicy = GetDefaultControlSecurityPolicy(); - - // Initialise ambient properties - m_nAmbientLocale = 0; - m_clrAmbientForeColor = ::GetSysColor(COLOR_WINDOWTEXT); - m_clrAmbientBackColor = ::GetSysColor(COLOR_WINDOW); - m_bAmbientUserMode = true; - m_bAmbientShowHatching = true; - m_bAmbientShowGrabHandles = true; - m_bAmbientAppearance = true; // 3d - - // Windowless variables - m_hDCBuffer = NULL; - m_hRgnBuffer = NULL; - m_hBMBufferOld = NULL; - m_hBMBuffer = NULL; -} - - -// Destructor -CControlSite::~CControlSite() -{ - TRACE_METHOD(CControlSite::~CControlSite); - Detach(); -} - -// Create the specified control, optionally providing properties to initialise -// it with and a name. -HRESULT CControlSite::Create(REFCLSID clsid, PropertyList &pl, - LPCWSTR szCodebase, IBindCtx *pBindContext) -{ - TRACE_METHOD(CControlSite::Create); - - m_CLSID = clsid; - m_ParameterList = pl; - - // See if security policy will allow the control to be hosted - if (m_pSecurityPolicy && !m_pSecurityPolicy->IsClassSafeToHost(clsid)) - { - return E_FAIL; - } - - // See if object is script safe - BOOL checkForObjectSafety = FALSE; - if (m_pSecurityPolicy && m_bSafeForScriptingObjectsOnly) - { - BOOL bClassExists = FALSE; - BOOL bIsSafe = m_pSecurityPolicy->IsClassMarkedSafeForScripting(clsid, bClassExists); - if (!bClassExists && szCodebase) - { - // Class doesn't exist, so allow code below to fetch it - } - else if (!bIsSafe) - { - // The class is not flagged as safe for scripting, so - // we'll have to create it to ask it if its safe. - checkForObjectSafety = TRUE; - } - } - - // Create the object - CComPtr spObject; - HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_IUnknown, (void **) &spObject); - if (SUCCEEDED(hr) && checkForObjectSafety) - { - // Assume scripting via IDispatch - if (!m_pSecurityPolicy->IsObjectSafeForScripting(spObject, __uuidof(IDispatch))) - { - return E_FAIL; - } - // Drop through, success! - } - - // Do we need to download the control? - if (FAILED(hr) && szCodebase) - { - wchar_t *szURL = NULL; - - // Test if the code base ends in #version=a,b,c,d - DWORD dwFileVersionMS = 0xffffffff; - DWORD dwFileVersionLS = 0xffffffff; - const wchar_t *szHash = wcsrchr(szCodebase, wchar_t('#')); - if (szHash) - { - if (wcsnicmp(szHash, L"#version=", 9) == 0) - { - int a, b, c, d; - if (swscanf(szHash + 9, L"%d,%d,%d,%d", &a, &b, &c, &d) == 4) - { - dwFileVersionMS = MAKELONG(b,a); - dwFileVersionLS = MAKELONG(d,c); - } - } - szURL = _wcsdup(szCodebase); - // Terminate at the hash mark - if (szURL) - szURL[szHash - szCodebase] = wchar_t('\0'); - } - else - { - szURL = _wcsdup(szCodebase); - } - if (!szURL) - return E_OUTOFMEMORY; - - CComPtr spBindContext; - CComPtr spBindStatusCallback; - CComPtr spOldBSC; - - // Create our own bind context or use the one provided? - BOOL useInternalBSC = FALSE; - if (!pBindContext) - { - useInternalBSC = TRUE; - hr = CreateBindCtx(0, &spBindContext); - if (FAILED(hr)) - { - free(szURL); - return hr; - } - spBindStatusCallback = dynamic_cast(this); - hr = RegisterBindStatusCallback(spBindContext, spBindStatusCallback, &spOldBSC, 0); - if (FAILED(hr)) - { - free(szURL); - return hr; - } - } - else - { - spBindContext = pBindContext; - } - - hr = CoGetClassObjectFromURL(clsid, szURL, dwFileVersionMS, dwFileVersionLS, - NULL, spBindContext, CLSCTX_ALL, NULL, IID_IUnknown, (void **) &m_spObject); - - free(szURL); - - // Handle the internal binding synchronously so the object exists - // or an error code is available when the method returns. - if (useInternalBSC) - { - if (MK_S_ASYNCHRONOUS == hr) - { - m_bBindingInProgress = TRUE; - m_hrBindResult = E_FAIL; - - // Spin around waiting for binding to complete - HANDLE hFakeEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - while (m_bBindingInProgress) - { - MSG msg; - // Process pending messages - while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (!::GetMessage(&msg, NULL, 0, 0)) - { - m_bBindingInProgress = FALSE; - break; - } - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - if (!m_bBindingInProgress) - break; - // Sleep for a bit or the next msg to appear - ::MsgWaitForMultipleObjects(1, &hFakeEvent, FALSE, 500, QS_ALLEVENTS); - } - ::CloseHandle(hFakeEvent); - - // Set the result - hr = m_hrBindResult; - } - - // Destroy the bind status callback & context - if (spBindStatusCallback) - { - RevokeBindStatusCallback(spBindContext, spBindStatusCallback); - spBindContext.Release(); - } - } - } - - if (spObject) - m_spObject = spObject; - - return hr; -} - - -// Attach the created control to a window and activate it -HRESULT CControlSite::Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInitStream) -{ - TRACE_METHOD(CControlSite::Attach); - - if (hwndParent == NULL) - { - NS_ERROR("No parent hwnd"); - return E_INVALIDARG; - } - - m_hWndParent = hwndParent; - m_rcObjectPos = rcPos; - - // Object must have been created - if (m_spObject == NULL) - { - return E_UNEXPECTED; - } - - m_spIViewObject = m_spObject; - m_spIOleObject = m_spObject; - - if (m_spIOleObject == NULL) - { - return E_FAIL; - } - - DWORD dwMiscStatus; - m_spIOleObject->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus); - - if (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST) - { - m_bSetClientSiteFirst = TRUE; - } - if (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME) - { - m_bVisibleAtRuntime = FALSE; - } - - // Some objects like to have the client site as the first thing - // to be initialised (for ambient properties and so forth) - if (m_bSetClientSiteFirst) - { - m_spIOleObject->SetClientSite(this); - } - - // If there is a parameter list for the object and no init stream then - // create one here. - CPropertyBagInstance *pPropertyBag = NULL; - if (pInitStream == NULL && m_ParameterList.GetSize() > 0) - { - CPropertyBagInstance::CreateInstance(&pPropertyBag); - pPropertyBag->AddRef(); - for (unsigned long i = 0; i < m_ParameterList.GetSize(); i++) - { - pPropertyBag->Write(m_ParameterList.GetNameOf(i), - const_cast(m_ParameterList.GetValueOf(i))); - } - pInitStream = (IPersistPropertyBag *) pPropertyBag; - } - - // Initialise the control from store if one is provided - if (pInitStream) - { - CComQIPtr spPropertyBag = pInitStream; - CComQIPtr spStream = pInitStream; - CComQIPtr spIPersistStream = m_spIOleObject; - CComQIPtr spIPersistPropertyBag = m_spIOleObject; - - if (spIPersistPropertyBag && spPropertyBag) - { - spIPersistPropertyBag->Load(spPropertyBag, NULL); - } - else if (spIPersistStream && spStream) - { - spIPersistStream->Load(spStream); - } - } - else - { - // Initialise the object if possible - CComQIPtr spIPersistStreamInit = m_spIOleObject; - if (spIPersistStreamInit) - { - spIPersistStreamInit->InitNew(); - } - } - - m_spIOleInPlaceObject = m_spObject; - m_spIOleInPlaceObjectWindowless = m_spObject; - - // In-place activate the object - if (m_bVisibleAtRuntime) - { - DoVerb(OLEIVERB_INPLACEACTIVATE); - } - - m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos); - - // For those objects which haven't had their client site set yet, - // it's done here. - if (!m_bSetClientSiteFirst) - { - m_spIOleObject->SetClientSite(this); - } - - return S_OK; -} - - -// Unhook the control from the window and throw it all away -HRESULT CControlSite::Detach() -{ - TRACE_METHOD(CControlSite::Detach); - - if (m_spIOleInPlaceObjectWindowless) - { - m_spIOleInPlaceObjectWindowless.Release(); - } - - if (m_spIOleInPlaceObject) - { - m_spIOleInPlaceObject->InPlaceDeactivate(); - m_spIOleInPlaceObject.Release(); - } - - if (m_spIOleObject) - { - m_spIOleObject->Close(OLECLOSE_NOSAVE); - m_spIOleObject->SetClientSite(NULL); - m_spIOleObject.Release(); - } - - m_spIViewObject.Release(); - m_spObject.Release(); - - return S_OK; -} - - -// Return the IUnknown of the contained control -HRESULT CControlSite::GetControlUnknown(IUnknown **ppObject) -{ - *ppObject = NULL; - if (m_spObject) - { - m_spObject->QueryInterface(IID_IUnknown, (void **) ppObject); - } - return S_OK; -} - - -// Subscribe to an event sink on the control -HRESULT CControlSite::Advise(IUnknown *pIUnkSink, const IID &iid, DWORD *pdwCookie) -{ - if (m_spObject == NULL) - { - return E_UNEXPECTED; - } - - if (pIUnkSink == NULL || pdwCookie == NULL) - { - return E_INVALIDARG; - } - - return AtlAdvise(m_spObject, pIUnkSink, iid, pdwCookie); -} - - -// Unsubscribe event sink from the control -HRESULT CControlSite::Unadvise(const IID &iid, DWORD dwCookie) -{ - if (m_spObject == NULL) - { - return E_UNEXPECTED; - } - - return AtlUnadvise(m_spObject, iid, dwCookie); -} - - -// Draw the control -HRESULT CControlSite::Draw(HDC hdc) -{ - TRACE_METHOD(CControlSite::Draw); - - // Draw only when control is windowless or deactivated - if (m_spIViewObject) - { - if (m_bWindowless || !m_bInPlaceActive) - { - RECTL *prcBounds = (m_bWindowless) ? NULL : (RECTL *) &m_rcObjectPos; - m_spIViewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL, hdc, prcBounds, NULL, NULL, 0); - } - } - else - { - // Draw something to indicate no control is there - HBRUSH hbr = CreateSolidBrush(RGB(200,200,200)); - FillRect(hdc, &m_rcObjectPos, hbr); - DeleteObject(hbr); - } - - return S_OK; -} - - -// Execute the specified verb -HRESULT CControlSite::DoVerb(LONG nVerb, LPMSG lpMsg) -{ - TRACE_METHOD(CControlSite::DoVerb); - - if (m_spIOleObject == NULL) - { - return E_FAIL; - } - - return m_spIOleObject->DoVerb(nVerb, lpMsg, this, 0, m_hWndParent, &m_rcObjectPos); -} - - -// Set the position on the control -HRESULT CControlSite::SetPosition(const RECT &rcPos) -{ - TRACE_METHOD(CControlSite::SetPosition); - m_rcObjectPos = rcPos; - if (m_spIOleInPlaceObject) - { - m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos); - } - return S_OK; -} - - -void CControlSite::FireAmbientPropertyChange(DISPID id) -{ - if (m_spObject) - { - CComQIPtr spControl = m_spObject; - if (spControl) - { - spControl->OnAmbientPropertyChange(id); - } - } -} - - -void CControlSite::SetAmbientUserMode(BOOL bUserMode) -{ - bool bNewMode = bUserMode ? true : false; - if (m_bAmbientUserMode != bNewMode) - { - m_bAmbientUserMode = bNewMode; - FireAmbientPropertyChange(DISPID_AMBIENT_USERMODE); - } -} - -/////////////////////////////////////////////////////////////////////////////// -// CControlSiteSecurityPolicy implementation - -CControlSiteSecurityPolicy *CControlSite::GetDefaultControlSecurityPolicy() -{ - static CDefaultControlSiteSecurityPolicy defaultControlSecurityPolicy; - return &defaultControlSecurityPolicy; -} - -// Test if the class is safe to host -BOOL CControlSite::IsClassSafeToHost(const CLSID & clsid) -{ - if (m_pSecurityPolicy) - return m_pSecurityPolicy->IsClassSafeToHost(clsid); - return TRUE; -} - -// Test if the specified class is marked safe for scripting -BOOL CControlSite::IsClassMarkedSafeForScripting(const CLSID & clsid, BOOL &bClassExists) -{ - if (m_pSecurityPolicy) - return m_pSecurityPolicy->IsClassMarkedSafeForScripting(clsid, bClassExists); - return TRUE; -} - -// Test if the instantiated object is safe for scripting on the specified interface -BOOL CControlSite::IsObjectSafeForScripting(IUnknown *pObject, const IID &iid) -{ - if (m_pSecurityPolicy) - return m_pSecurityPolicy->IsObjectSafeForScripting(pObject, iid); - return TRUE; -} - -BOOL CControlSite::IsObjectSafeForScripting(const IID &iid) -{ - return IsObjectSafeForScripting(m_spObject, iid); -} - -/////////////////////////////////////////////////////////////////////////////// -// IServiceProvider implementation - -HRESULT STDMETHODCALLTYPE CControlSite::QueryService(REFGUID guidService, REFIID riid, void** ppv) -{ - if (m_spServiceProvider) - return m_spServiceProvider->QueryService(guidService, riid, ppv); - return E_NOINTERFACE; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IDispatch implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr) -{ - if (wFlags & DISPATCH_PROPERTYGET) - { - CComVariant vResult; - - switch (dispIdMember) - { - case DISPID_AMBIENT_APPEARANCE: - vResult = CComVariant(m_bAmbientAppearance); - break; - - case DISPID_AMBIENT_FORECOLOR: - vResult = CComVariant((long) m_clrAmbientForeColor); - break; - - case DISPID_AMBIENT_BACKCOLOR: - vResult = CComVariant((long) m_clrAmbientBackColor); - break; - - case DISPID_AMBIENT_LOCALEID: - vResult = CComVariant((long) m_nAmbientLocale); - break; - - case DISPID_AMBIENT_USERMODE: - vResult = CComVariant(m_bAmbientUserMode); - break; - - case DISPID_AMBIENT_SHOWGRABHANDLES: - vResult = CComVariant(m_bAmbientShowGrabHandles); - break; - - case DISPID_AMBIENT_SHOWHATCHING: - vResult = CComVariant(m_bAmbientShowHatching); - break; - - default: - return DISP_E_MEMBERNOTFOUND; - } - - VariantCopy(pVarResult, &vResult); - return S_OK; - } - - return E_FAIL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSink implementation - - -void STDMETHODCALLTYPE CControlSite::OnDataChange(/* [unique][in] */ FORMATETC __RPC_FAR *pFormatetc, /* [unique][in] */ STGMEDIUM __RPC_FAR *pStgmed) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnViewChange(/* [in] */ DWORD dwAspect, /* [in] */ LONG lindex) -{ - // Redraw the control - InvalidateRect(NULL, FALSE); -} - - -void STDMETHODCALLTYPE CControlSite::OnRename(/* [in] */ IMoniker __RPC_FAR *pmk) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnSave(void) -{ -} - - -void STDMETHODCALLTYPE CControlSite::OnClose(void) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSink2 implementation - - -void STDMETHODCALLTYPE CControlSite::OnLinkSrcChange(/* [unique][in] */ IMoniker __RPC_FAR *pmk) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IAdviseSinkEx implementation - - -void STDMETHODCALLTYPE CControlSite::OnViewStatusChange(/* [in] */ DWORD dwViewStatus) -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSite::GetWindow(/* [out] */ HWND __RPC_FAR *phwnd) -{ - *phwnd = m_hWndParent; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ContextSensitiveHelp(/* [in] */ BOOL fEnterMode) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleClientSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::SaveObject(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetMoniker(/* [in] */ DWORD dwAssign, /* [in] */ DWORD dwWhichMoniker, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmk) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetContainer(/* [out] */ IOleContainer __RPC_FAR *__RPC_FAR *ppContainer) -{ - if (!ppContainer) return E_INVALIDARG; - *ppContainer = m_spContainer; - if (*ppContainer) - { - (*ppContainer)->AddRef(); - } - return (*ppContainer) ? S_OK : E_NOINTERFACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ShowObject(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnShowWindow(/* [in] */ BOOL fShow) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::RequestNewObjectLayout(void) -{ - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::CanInPlaceActivate(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceActivate(void) -{ - m_bInPlaceActive = TRUE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnUIActivate(void) -{ - m_bUIActive = TRUE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetWindowContext(/* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, /* [out] */ LPRECT lprcPosRect, /* [out] */ LPRECT lprcClipRect, /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo) -{ - *lprcPosRect = m_rcObjectPos; - *lprcClipRect = m_rcObjectPos; - - CControlSiteIPFrameInstance *pIPFrame = NULL; - CControlSiteIPFrameInstance::CreateInstance(&pIPFrame); - pIPFrame->AddRef(); - - *ppFrame = (IOleInPlaceFrame *) pIPFrame; - *ppDoc = NULL; - - lpFrameInfo->fMDIApp = FALSE; - lpFrameInfo->hwndFrame = NULL; - lpFrameInfo->haccel = NULL; - lpFrameInfo->cAccelEntries = 0; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::Scroll(/* [in] */ SIZE scrollExtant) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnUIDeactivate(/* [in] */ BOOL fUndoable) -{ - m_bUIActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceDeactivate(void) -{ - m_bInPlaceActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::DiscardUndoState(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::DeactivateAndUndo(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnPosRectChange(/* [in] */ LPCRECT lprcPosRect) -{ - if (lprcPosRect == NULL) - { - return E_INVALIDARG; - } - SetPosition(m_rcObjectPos); - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSiteEx implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceActivateEx(/* [out] */ BOOL __RPC_FAR *pfNoRedraw, /* [in] */ DWORD dwFlags) -{ - m_bInPlaceActive = TRUE; - - if (pfNoRedraw) - { - *pfNoRedraw = FALSE; - } - if (dwFlags & ACTIVATE_WINDOWLESS) - { - if (!m_bSupportWindowlessActivation) - { - return E_INVALIDARG; - } - m_bWindowless = TRUE; - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnInPlaceDeactivateEx(/* [in] */ BOOL fNoRedraw) -{ - m_bInPlaceActive = FALSE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::RequestUIActivate(void) -{ - return S_FALSE; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceSiteWindowless implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::CanWindowlessActivate(void) -{ - // Allow windowless activation? - return (m_bSupportWindowlessActivation) ? S_OK : S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetCapture(void) -{ - // TODO capture the mouse for the object - return S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::SetCapture(/* [in] */ BOOL fCapture) -{ - // TODO capture the mouse for the object - return S_FALSE; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetFocus(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::SetFocus(/* [in] */ BOOL fFocus) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetDC(/* [in] */ LPCRECT pRect, /* [in] */ DWORD grfFlags, /* [out] */ HDC __RPC_FAR *phDC) -{ - if (phDC == NULL) - { - return E_INVALIDARG; - } - - // Can't do nested painting - if (m_hDCBuffer != NULL) - { - return E_UNEXPECTED; - } - - m_rcBuffer = m_rcObjectPos; - if (pRect != NULL) - { - m_rcBuffer = *pRect; - } - - m_hBMBuffer = NULL; - m_dwBufferFlags = grfFlags; - - // See if the control wants a DC that is onscreen or offscreen - if (m_dwBufferFlags & OLEDC_OFFSCREEN) - { - m_hDCBuffer = CreateCompatibleDC(NULL); - if (m_hDCBuffer == NULL) - { - // Error - return E_OUTOFMEMORY; - } - - long cx = m_rcBuffer.right - m_rcBuffer.left; - long cy = m_rcBuffer.bottom - m_rcBuffer.top; - - m_hBMBuffer = CreateCompatibleBitmap(m_hDCBuffer, cx, cy); - m_hBMBufferOld = (HBITMAP) SelectObject(m_hDCBuffer, m_hBMBuffer); - SetViewportOrgEx(m_hDCBuffer, m_rcBuffer.left, m_rcBuffer.top, NULL); - - // TODO When OLEDC_PAINTBKGND we must draw every site behind this one - } - else - { - // TODO When OLEDC_PAINTBKGND we must draw every site behind this one - - // Get the window DC - m_hDCBuffer = GetWindowDC(m_hWndParent); - if (m_hDCBuffer == NULL) - { - // Error - return E_OUTOFMEMORY; - } - - // Clip the control so it can't trash anywhere it isn't allowed to draw - if (!(m_dwBufferFlags & OLEDC_NODRAW)) - { - m_hRgnBuffer = CreateRectRgnIndirect(&m_rcBuffer); - - // TODO Clip out opaque areas of sites behind this one - - SelectClipRgn(m_hDCBuffer, m_hRgnBuffer); - } - } - - *phDC = m_hDCBuffer; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ReleaseDC(/* [in] */ HDC hDC) -{ - // Release the DC - if (hDC == NULL || hDC != m_hDCBuffer) - { - return E_INVALIDARG; - } - - // Test if the DC was offscreen or onscreen - if ((m_dwBufferFlags & OLEDC_OFFSCREEN) && - !(m_dwBufferFlags & OLEDC_NODRAW)) - { - // BitBlt the buffer into the control's object - SetViewportOrgEx(m_hDCBuffer, 0, 0, NULL); - HDC hdc = GetWindowDC(m_hWndParent); - - long cx = m_rcBuffer.right - m_rcBuffer.left; - long cy = m_rcBuffer.bottom - m_rcBuffer.top; - - BitBlt(hdc, m_rcBuffer.left, m_rcBuffer.top, cx, cy, m_hDCBuffer, 0, 0, SRCCOPY); - - ::ReleaseDC(m_hWndParent, hdc); - } - else - { - // TODO If OLEDC_PAINTBKGND is set draw the DVASPECT_CONTENT of every object above this one - } - - // Clean up settings ready for next drawing - if (m_hRgnBuffer) - { - SelectClipRgn(m_hDCBuffer, NULL); - DeleteObject(m_hRgnBuffer); - m_hRgnBuffer = NULL; - } - - SelectObject(m_hDCBuffer, m_hBMBufferOld); - if (m_hBMBuffer) - { - DeleteObject(m_hBMBuffer); - m_hBMBuffer = NULL; - } - - // Delete the DC - if (m_dwBufferFlags & OLEDC_OFFSCREEN) - { - ::DeleteDC(m_hDCBuffer); - } - else - { - ::ReleaseDC(m_hWndParent, m_hDCBuffer); - } - m_hDCBuffer = NULL; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::InvalidateRect(/* [in] */ LPCRECT pRect, /* [in] */ BOOL fErase) -{ - // Clip the rectangle against the object's size and invalidate it - RECT rcI = { 0, 0, 0, 0 }; - if (pRect == NULL) - { - rcI = m_rcObjectPos; - } - else - { - IntersectRect(&rcI, &m_rcObjectPos, pRect); - } - ::InvalidateRect(m_hWndParent, &rcI, fErase); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::InvalidateRgn(/* [in] */ HRGN hRGN, /* [in] */ BOOL fErase) -{ - if (hRGN == NULL) - { - ::InvalidateRect(m_hWndParent, &m_rcObjectPos, fErase); - } - else - { - // Clip the region with the object's bounding area - HRGN hrgnClip = CreateRectRgnIndirect(&m_rcObjectPos); - if (CombineRgn(hrgnClip, hrgnClip, hRGN, RGN_AND) != ERROR) - { - ::InvalidateRgn(m_hWndParent, hrgnClip, fErase); - } - DeleteObject(hrgnClip); - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::ScrollRect(/* [in] */ INT dx, /* [in] */ INT dy, /* [in] */ LPCRECT pRectScroll, /* [in] */ LPCRECT pRectClip) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::AdjustRect(/* [out][in] */ LPRECT prc) -{ - if (prc == NULL) - { - return E_INVALIDARG; - } - - // Clip the rectangle against the object position - RECT rcI = { 0, 0, 0, 0 }; - IntersectRect(&rcI, &m_rcObjectPos, prc); - *prc = rcI; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnDefWindowMessage(/* [in] */ UINT msg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam, /* [out] */ LRESULT __RPC_FAR *plResult) -{ - if (plResult == NULL) - { - return E_INVALIDARG; - } - - // Pass the message to the windowless control - if (m_bWindowless && m_spIOleInPlaceObjectWindowless) - { - return m_spIOleInPlaceObjectWindowless->OnWindowMessage(msg, wParam, lParam, plResult); - } - - return S_FALSE; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleControlSite implementation - - -HRESULT STDMETHODCALLTYPE CControlSite::OnControlInfoChanged(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::LockInPlaceActive(/* [in] */ BOOL fLock) -{ - m_bInPlaceLocked = fLock; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::GetExtendedControl(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::TransformCoords(/* [out][in] */ POINTL __RPC_FAR *pPtlHimetric, /* [out][in] */ POINTF __RPC_FAR *pPtfContainer, /* [in] */ DWORD dwFlags) -{ - HRESULT hr = S_OK; - - if (pPtlHimetric == NULL) - { - return E_INVALIDARG; - } - if (pPtfContainer == NULL) - { - return E_INVALIDARG; - } - - HDC hdc = ::GetDC(m_hWndParent); - ::SetMapMode(hdc, MM_HIMETRIC); - POINT rgptConvert[2]; - rgptConvert[0].x = 0; - rgptConvert[0].y = 0; - - if (dwFlags & XFORMCOORDS_HIMETRICTOCONTAINER) - { - rgptConvert[1].x = pPtlHimetric->x; - rgptConvert[1].y = pPtlHimetric->y; - ::LPtoDP(hdc, rgptConvert, 2); - if (dwFlags & XFORMCOORDS_SIZE) - { - pPtfContainer->x = (float)(rgptConvert[1].x - rgptConvert[0].x); - pPtfContainer->y = (float)(rgptConvert[0].y - rgptConvert[1].y); - } - else if (dwFlags & XFORMCOORDS_POSITION) - { - pPtfContainer->x = (float)rgptConvert[1].x; - pPtfContainer->y = (float)rgptConvert[1].y; - } - else - { - hr = E_INVALIDARG; - } - } - else if (dwFlags & XFORMCOORDS_CONTAINERTOHIMETRIC) - { - rgptConvert[1].x = (int)(pPtfContainer->x); - rgptConvert[1].y = (int)(pPtfContainer->y); - ::DPtoLP(hdc, rgptConvert, 2); - if (dwFlags & XFORMCOORDS_SIZE) - { - pPtlHimetric->x = rgptConvert[1].x - rgptConvert[0].x; - pPtlHimetric->y = rgptConvert[0].y - rgptConvert[1].y; - } - else if (dwFlags & XFORMCOORDS_POSITION) - { - pPtlHimetric->x = rgptConvert[1].x; - pPtlHimetric->y = rgptConvert[1].y; - } - else - { - hr = E_INVALIDARG; - } - } - else - { - hr = E_INVALIDARG; - } - - ::ReleaseDC(m_hWndParent, hdc); - - return hr; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::TranslateAccelerator(/* [in] */ MSG __RPC_FAR *pMsg, /* [in] */ DWORD grfModifiers) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::OnFocus(/* [in] */ BOOL fGotFocus) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSite::ShowPropertyFrame(void) -{ - return E_NOTIMPL; -} - -/////////////////////////////////////////////////////////////////////////////// -// IBindStatusCallback implementation - -HRESULT STDMETHODCALLTYPE CControlSite::OnStartBinding(DWORD dwReserved, - IBinding __RPC_FAR *pib) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::GetPriority(LONG __RPC_FAR *pnPriority) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnLowResource(DWORD reserved) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnProgress(ULONG ulProgress, - ULONG ulProgressMax, - ULONG ulStatusCode, - LPCWSTR szStatusText) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnStopBinding(HRESULT hresult, LPCWSTR szError) -{ - m_bBindingInProgress = FALSE; - m_hrBindResult = hresult; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::GetBindInfo(DWORD __RPC_FAR *pgrfBINDF, - BINDINFO __RPC_FAR *pbindInfo) -{ - *pgrfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | - BINDF_GETNEWESTVERSION | BINDF_NOWRITECACHE; - pbindInfo->cbSize = sizeof(BINDINFO); - pbindInfo->szExtraInfo = NULL; - memset(&pbindInfo->stgmedData, 0, sizeof(STGMEDIUM)); - pbindInfo->grfBindInfoF = 0; - pbindInfo->dwBindVerb = 0; - pbindInfo->szCustomVerb = NULL; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnDataAvailable(DWORD grfBSCF, - DWORD dwSize, - FORMATETC __RPC_FAR *pformatetc, - STGMEDIUM __RPC_FAR *pstgmed) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CControlSite::OnObjectAvailable(REFIID riid, - IUnknown __RPC_FAR *punk) -{ - return S_OK; -} - -// IWindowForBindingUI -HRESULT STDMETHODCALLTYPE CControlSite::GetWindow( - /* [in] */ REFGUID rguidReason, - /* [out] */ HWND *phwnd) -{ - *phwnd = NULL; - return S_OK; -} - - diff --git a/embedding/browser/activex/src/common/ControlSite.h b/embedding/browser/activex/src/common/ControlSite.h deleted file mode 100644 index 3e493b50139..00000000000 --- a/embedding/browser/activex/src/common/ControlSite.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef CONTROLSITE_H -#define CONTROLSITE_H - -#include "IOleCommandTargetImpl.h" - -#include "PropertyList.h" - -// If you created a class derived from CControlSite, use the following macro -// in the interface map of the derived class to include all the necessary -// interfaces. -#define CCONTROLSITE_INTERFACES() \ - COM_INTERFACE_ENTRY(IOleWindow) \ - COM_INTERFACE_ENTRY(IOleClientSite) \ - COM_INTERFACE_ENTRY(IOleInPlaceSite) \ - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSite, IOleInPlaceSiteWindowless) \ - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSiteEx, IOleInPlaceSiteWindowless) \ - COM_INTERFACE_ENTRY(IOleControlSite) \ - COM_INTERFACE_ENTRY(IDispatch) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSink, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSink2, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY_IID(IID_IAdviseSinkEx, IAdviseSinkEx) \ - COM_INTERFACE_ENTRY(IOleCommandTarget) \ - COM_INTERFACE_ENTRY(IServiceProvider) \ - COM_INTERFACE_ENTRY(IBindStatusCallback) \ - COM_INTERFACE_ENTRY(IWindowForBindingUI) - -// Temoporarily removed by bug 200680. Stops controls misbehaving and calling -// windowless methods when they shouldn't. -// COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceSiteWindowless, IOleInPlaceSiteWindowless) \ - - -// Class that defines the control's security policy with regards to -// what controls it hosts etc. - -class CControlSiteSecurityPolicy -{ -public: - // Test if the class is safe to host - virtual BOOL IsClassSafeToHost(const CLSID & clsid) = 0; - // Test if the specified class is marked safe for scripting - virtual BOOL IsClassMarkedSafeForScripting(const CLSID & clsid, BOOL &bClassExists) = 0; - // Test if the instantiated object is safe for scripting on the specified interface - virtual BOOL IsObjectSafeForScripting(IUnknown *pObject, const IID &iid) = 0; -}; - -// -// Class for hosting an ActiveX control -// -// This class supports both windowed and windowless classes. The normal -// steps to hosting a control are this: -// -// CControlSiteInstance *pSite = NULL; -// CControlSiteInstance::CreateInstance(&pSite); -// pSite->AddRef(); -// pSite->Create(clsidControlToCreate); -// pSite->Attach(hwndParentWindow, rcPosition); -// -// Where propertyList is a named list of values to initialise the new object -// with, hwndParentWindow is the window in which the control is being created, -// and rcPosition is the position in window coordinates where the control will -// be rendered. -// -// Destruction is this: -// -// pSite->Detach(); -// pSite->Release(); -// pSite = NULL; - -class CControlSite : public CComObjectRootEx, - public CControlSiteSecurityPolicy, - public IOleClientSite, - public IOleInPlaceSiteWindowless, - public IOleControlSite, - public IAdviseSinkEx, - public IDispatch, - public IServiceProvider, - public IOleCommandTargetImpl, - public IBindStatusCallback, - public IWindowForBindingUI -{ -public: -// Site management values - // Handle to parent window - HWND m_hWndParent; - // Position of the site and the contained object - RECT m_rcObjectPos; - // Flag indicating if client site should be set early or late - unsigned m_bSetClientSiteFirst:1; - // Flag indicating whether control is visible or not - unsigned m_bVisibleAtRuntime:1; - // Flag indicating if control is in-place active - unsigned m_bInPlaceActive:1; - // Flag indicating if control is UI active - unsigned m_bUIActive:1; - // Flag indicating if control is in-place locked and cannot be deactivated - unsigned m_bInPlaceLocked:1; - // Flag indicating if the site allows windowless controls - unsigned m_bSupportWindowlessActivation:1; - // Flag indicating if control is windowless (after being created) - unsigned m_bWindowless:1; - // Flag indicating if only safely scriptable controls are allowed - unsigned m_bSafeForScriptingObjectsOnly:1; - // Pointer to an externally registered service provider - CComPtr m_spServiceProvider; - // Pointer to the OLE container - CComPtr m_spContainer; - // Return the default security policy object - static CControlSiteSecurityPolicy *GetDefaultControlSecurityPolicy(); - -protected: -// Pointers to object interfaces - // Raw pointer to the object - CComPtr m_spObject; - // Pointer to objects IViewObject interface - CComQIPtr m_spIViewObject; - // Pointer to object's IOleObject interface - CComQIPtr m_spIOleObject; - // Pointer to object's IOleInPlaceObject interface - CComQIPtr m_spIOleInPlaceObject; - // Pointer to object's IOleInPlaceObjectWindowless interface - CComQIPtr m_spIOleInPlaceObjectWindowless; - // CLSID of the control - CLSID m_CLSID; - // Parameter list - PropertyList m_ParameterList; - // Pointer to the security policy - CControlSiteSecurityPolicy *m_pSecurityPolicy; - -// Binding variables - // Flag indicating whether binding is in progress - unsigned m_bBindingInProgress; - // Result from the binding operation - HRESULT m_hrBindResult; - -// Double buffer drawing variables used for windowless controls - // Area of buffer - RECT m_rcBuffer; - // Bitmap to buffer - HBITMAP m_hBMBuffer; - // Bitmap to buffer - HBITMAP m_hBMBufferOld; - // Device context - HDC m_hDCBuffer; - // Clipping area of site - HRGN m_hRgnBuffer; - // Flags indicating how the buffer was painted - DWORD m_dwBufferFlags; - -// Ambient properties - // Locale ID - LCID m_nAmbientLocale; - // Foreground colour - COLORREF m_clrAmbientForeColor; - // Background colour - COLORREF m_clrAmbientBackColor; - // Flag indicating if control should hatch itself - bool m_bAmbientShowHatching:1; - // Flag indicating if control should have grab handles - bool m_bAmbientShowGrabHandles:1; - // Flag indicating if control is in edit/user mode - bool m_bAmbientUserMode:1; - // Flag indicating if control has a 3d border or not - bool m_bAmbientAppearance:1; - -protected: - // Notifies the attached control of a change to an ambient property - virtual void FireAmbientPropertyChange(DISPID id); - -public: -// Construction and destruction - // Constructor - CControlSite(); - // Destructor - virtual ~CControlSite(); - -BEGIN_COM_MAP(CControlSite) - CCONTROLSITE_INTERFACES() -END_COM_MAP() - -BEGIN_OLECOMMAND_TABLE() -END_OLECOMMAND_TABLE() - - // Returns the window used when processing ole commands - HWND GetCommandTargetWindow() - { - return NULL; // TODO - } - -// Object creation and management functions - // Creates and initialises an object - virtual HRESULT Create(REFCLSID clsid, PropertyList &pl = PropertyList(), - LPCWSTR szCodebase = NULL, IBindCtx *pBindContext = NULL); - // Attaches the object to the site - virtual HRESULT Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInitStream = NULL); - // Detaches the object from the site - virtual HRESULT Detach(); - // Returns the IUnknown pointer for the object - virtual HRESULT GetControlUnknown(IUnknown **ppObject); - // Sets the bounding rectangle for the object - virtual HRESULT SetPosition(const RECT &rcPos); - // Draws the object using the provided DC - virtual HRESULT Draw(HDC hdc); - // Performs the specified action on the object - virtual HRESULT DoVerb(LONG nVerb, LPMSG lpMsg = NULL); - // Sets an advise sink up for changes to the object - virtual HRESULT Advise(IUnknown *pIUnkSink, const IID &iid, DWORD *pdwCookie); - // Removes an advise sink - virtual HRESULT Unadvise(const IID &iid, DWORD dwCookie); - // Register an external service provider object - virtual void SetServiceProvider(IServiceProvider *pSP) - { - m_spServiceProvider = pSP; - } - virtual void SetContainer(IOleContainer *pContainer) - { - m_spContainer = pContainer; - } - // Set the security policy object. Ownership of this object remains with the caller and the security - // policy object is meant to exist for as long as it is set here. - virtual void SetSecurityPolicy(CControlSiteSecurityPolicy *pSecurityPolicy) - { - m_pSecurityPolicy = pSecurityPolicy; - } - virtual CControlSiteSecurityPolicy *GetSecurityPolicy() const - { - return m_pSecurityPolicy; - } - -// Methods to set ambient properties - virtual void SetAmbientUserMode(BOOL bUser); - -// Inline helper methods - // Returns the object's CLSID - virtual const CLSID &GetObjectCLSID() const - { - return m_CLSID; - } - // Tests if the object is valid or not - virtual BOOL IsObjectValid() const - { - return (m_spObject) ? TRUE : FALSE; - } - // Returns the parent window to this one - virtual HWND GetParentWindow() const - { - return m_hWndParent; - } - // Returns the inplace active state of the object - virtual BOOL IsInPlaceActive() const - { - return m_bInPlaceActive; - } - -// CControlSiteSecurityPolicy - // Test if the class is safe to host - virtual BOOL IsClassSafeToHost(const CLSID & clsid); - // Test if the specified class is marked safe for scripting - virtual BOOL IsClassMarkedSafeForScripting(const CLSID & clsid, BOOL &bClassExists); - // Test if the instantiated object is safe for scripting on the specified interface - virtual BOOL IsObjectSafeForScripting(IUnknown *pObject, const IID &iid); - // Test if the instantiated object is safe for scripting on the specified interface - virtual BOOL IsObjectSafeForScripting(const IID &iid); - -// IServiceProvider - virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void** ppv); - -// IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(/* [out] */ UINT __RPC_FAR *pctinfo); - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(/* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(/* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, /* [in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke(/* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, /* [in] */ LCID lcid, /* [in] */ WORD wFlags, /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, /* [out] */ VARIANT __RPC_FAR *pVarResult, /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, /* [out] */ UINT __RPC_FAR *puArgErr); - -// IAdviseSink implementation - virtual /* [local] */ void STDMETHODCALLTYPE OnDataChange(/* [unique][in] */ FORMATETC __RPC_FAR *pFormatetc, /* [unique][in] */ STGMEDIUM __RPC_FAR *pStgmed); - virtual /* [local] */ void STDMETHODCALLTYPE OnViewChange(/* [in] */ DWORD dwAspect, /* [in] */ LONG lindex); - virtual /* [local] */ void STDMETHODCALLTYPE OnRename(/* [in] */ IMoniker __RPC_FAR *pmk); - virtual /* [local] */ void STDMETHODCALLTYPE OnSave(void); - virtual /* [local] */ void STDMETHODCALLTYPE OnClose(void); - -// IAdviseSink2 - virtual /* [local] */ void STDMETHODCALLTYPE OnLinkSrcChange(/* [unique][in] */ IMoniker __RPC_FAR *pmk); - -// IAdviseSinkEx implementation - virtual /* [local] */ void STDMETHODCALLTYPE OnViewStatusChange(/* [in] */ DWORD dwViewStatus); - -// IOleWindow implementation - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode); - -// IOleClientSite implementation - virtual HRESULT STDMETHODCALLTYPE SaveObject(void); - virtual HRESULT STDMETHODCALLTYPE GetMoniker(/* [in] */ DWORD dwAssign, /* [in] */ DWORD dwWhichMoniker, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmk); - virtual HRESULT STDMETHODCALLTYPE GetContainer(/* [out] */ IOleContainer __RPC_FAR *__RPC_FAR *ppContainer); - virtual HRESULT STDMETHODCALLTYPE ShowObject(void); - virtual HRESULT STDMETHODCALLTYPE OnShowWindow(/* [in] */ BOOL fShow); - virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout(void); - -// IOleInPlaceSite implementation - virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate(void); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate(void); - virtual HRESULT STDMETHODCALLTYPE OnUIActivate(void); - virtual HRESULT STDMETHODCALLTYPE GetWindowContext(/* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, /* [out] */ LPRECT lprcPosRect, /* [out] */ LPRECT lprcClipRect, /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo); - virtual HRESULT STDMETHODCALLTYPE Scroll(/* [in] */ SIZE scrollExtant); - virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(/* [in] */ BOOL fUndoable); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate(void); - virtual HRESULT STDMETHODCALLTYPE DiscardUndoState(void); - virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo(void); - virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(/* [in] */ LPCRECT lprcPosRect); - -// IOleInPlaceSiteEx implementation - virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivateEx(/* [out] */ BOOL __RPC_FAR *pfNoRedraw, /* [in] */ DWORD dwFlags); - virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivateEx(/* [in] */ BOOL fNoRedraw); - virtual HRESULT STDMETHODCALLTYPE RequestUIActivate(void); - -// IOleInPlaceSiteWindowless implementation - virtual HRESULT STDMETHODCALLTYPE CanWindowlessActivate(void); - virtual HRESULT STDMETHODCALLTYPE GetCapture(void); - virtual HRESULT STDMETHODCALLTYPE SetCapture(/* [in] */ BOOL fCapture); - virtual HRESULT STDMETHODCALLTYPE GetFocus(void); - virtual HRESULT STDMETHODCALLTYPE SetFocus(/* [in] */ BOOL fFocus); - virtual HRESULT STDMETHODCALLTYPE GetDC(/* [in] */ LPCRECT pRect, /* [in] */ DWORD grfFlags, /* [out] */ HDC __RPC_FAR *phDC); - virtual HRESULT STDMETHODCALLTYPE ReleaseDC(/* [in] */ HDC hDC); - virtual HRESULT STDMETHODCALLTYPE InvalidateRect(/* [in] */ LPCRECT pRect, /* [in] */ BOOL fErase); - virtual HRESULT STDMETHODCALLTYPE InvalidateRgn(/* [in] */ HRGN hRGN, /* [in] */ BOOL fErase); - virtual HRESULT STDMETHODCALLTYPE ScrollRect(/* [in] */ INT dx, /* [in] */ INT dy, /* [in] */ LPCRECT pRectScroll, /* [in] */ LPCRECT pRectClip); - virtual HRESULT STDMETHODCALLTYPE AdjustRect(/* [out][in] */ LPRECT prc); - virtual HRESULT STDMETHODCALLTYPE OnDefWindowMessage(/* [in] */ UINT msg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam, /* [out] */ LRESULT __RPC_FAR *plResult); - -// IOleControlSite implementation - virtual HRESULT STDMETHODCALLTYPE OnControlInfoChanged(void); - virtual HRESULT STDMETHODCALLTYPE LockInPlaceActive(/* [in] */ BOOL fLock); - virtual HRESULT STDMETHODCALLTYPE GetExtendedControl(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE TransformCoords(/* [out][in] */ POINTL __RPC_FAR *pPtlHimetric, /* [out][in] */ POINTF __RPC_FAR *pPtfContainer, /* [in] */ DWORD dwFlags); - virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(/* [in] */ MSG __RPC_FAR *pMsg, /* [in] */ DWORD grfModifiers); - virtual HRESULT STDMETHODCALLTYPE OnFocus(/* [in] */ BOOL fGotFocus); - virtual HRESULT STDMETHODCALLTYPE ShowPropertyFrame( void); - -// IBindStatusCallback - virtual HRESULT STDMETHODCALLTYPE OnStartBinding(/* [in] */ DWORD dwReserved, /* [in] */ IBinding __RPC_FAR *pib); - virtual HRESULT STDMETHODCALLTYPE GetPriority(/* [out] */ LONG __RPC_FAR *pnPriority); - virtual HRESULT STDMETHODCALLTYPE OnLowResource(/* [in] */ DWORD reserved); - virtual HRESULT STDMETHODCALLTYPE OnProgress(/* [in] */ ULONG ulProgress, /* [in] */ ULONG ulProgressMax, /* [in] */ ULONG ulStatusCode, /* [in] */ LPCWSTR szStatusText); - virtual HRESULT STDMETHODCALLTYPE OnStopBinding(/* [in] */ HRESULT hresult, /* [unique][in] */ LPCWSTR szError); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetBindInfo( /* [out] */ DWORD __RPC_FAR *grfBINDF, /* [unique][out][in] */ BINDINFO __RPC_FAR *pbindinfo); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE OnDataAvailable(/* [in] */ DWORD grfBSCF, /* [in] */ DWORD dwSize, /* [in] */ FORMATETC __RPC_FAR *pformatetc, /* [in] */ STGMEDIUM __RPC_FAR *pstgmed); - virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable(/* [in] */ REFIID riid, /* [iid_is][in] */ IUnknown __RPC_FAR *punk); - -// IWindowForBindingUI - virtual HRESULT STDMETHODCALLTYPE GetWindow(/* [in] */ REFGUID rguidReason, /* [out] */ HWND *phwnd); -}; - -typedef CComObject CControlSiteInstance; - - - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/ControlSiteIPFrame.cpp b/embedding/browser/activex/src/common/ControlSiteIPFrame.cpp deleted file mode 100644 index a63b6a41058..00000000000 --- a/embedding/browser/activex/src/common/ControlSiteIPFrame.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include "ControlSiteIPFrame.h" - -CControlSiteIPFrame::CControlSiteIPFrame() -{ - m_hwndFrame = NULL; -} - - -CControlSiteIPFrame::~CControlSiteIPFrame() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// IOleWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::GetWindow(/* [out] */ HWND __RPC_FAR *phwnd) -{ - if (phwnd == NULL) - { - return E_INVALIDARG; - } - *phwnd = m_hwndFrame; - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::ContextSensitiveHelp(/* [in] */ BOOL fEnterMode) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceUIWindow implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::GetBorder(/* [out] */ LPRECT lprectBorder) -{ - return INPLACE_E_NOTOOLSPACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::RequestBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths) -{ - return INPLACE_E_NOTOOLSPACE; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetActiveObject(/* [unique][in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName) -{ - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleInPlaceFrame implementation - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::InsertMenus(/* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetMenu(/* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::RemoveMenus(/* [in] */ HMENU hmenuShared) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::SetStatusText(/* [in] */ LPCOLESTR pszStatusText) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::EnableModeless(/* [in] */ BOOL fEnable) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CControlSiteIPFrame::TranslateAccelerator(/* [in] */ LPMSG lpmsg, /* [in] */ WORD wID) -{ - return E_NOTIMPL; -} - diff --git a/embedding/browser/activex/src/common/ControlSiteIPFrame.h b/embedding/browser/activex/src/common/ControlSiteIPFrame.h deleted file mode 100644 index 43f02a24573..00000000000 --- a/embedding/browser/activex/src/common/ControlSiteIPFrame.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef CONTROLSITEIPFRAME_H -#define CONTROLSITEIPFRAME_H - -class CControlSiteIPFrame : public CComObjectRootEx, - public IOleInPlaceFrame -{ -public: - CControlSiteIPFrame(); - virtual ~CControlSiteIPFrame(); - - HWND m_hwndFrame; - -BEGIN_COM_MAP(CControlSiteIPFrame) - COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleInPlaceFrame) - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceUIWindow, IOleInPlaceFrame) - COM_INTERFACE_ENTRY(IOleInPlaceFrame) -END_COM_MAP() - - // IOleWindow - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd); - virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode); - - // IOleInPlaceUIWindow implementation - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetBorder(/* [out] */ LPRECT lprectBorder); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE RequestBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetBorderSpace(/* [unique][in] */ LPCBORDERWIDTHS pborderwidths); - virtual HRESULT STDMETHODCALLTYPE SetActiveObject(/* [unique][in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [unique][string][in] */ LPCOLESTR pszObjName); - - // IOleInPlaceFrame implementation - virtual HRESULT STDMETHODCALLTYPE InsertMenus(/* [in] */ HMENU hmenuShared, /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetMenu(/* [in] */ HMENU hmenuShared, /* [in] */ HOLEMENU holemenu, /* [in] */ HWND hwndActiveObject); - virtual HRESULT STDMETHODCALLTYPE RemoveMenus(/* [in] */ HMENU hmenuShared); - virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE SetStatusText(/* [in] */ LPCOLESTR pszStatusText); - virtual HRESULT STDMETHODCALLTYPE EnableModeless(/* [in] */ BOOL fEnable); - virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(/* [in] */ LPMSG lpmsg, /* [in] */ WORD wID); -}; - -typedef CComObject CControlSiteIPFrameInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IEHtmlButtonElement.cpp b/embedding/browser/activex/src/common/IEHtmlButtonElement.cpp deleted file mode 100644 index 989e0427c52..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlButtonElement.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include "IEHTMLButtonElement.h" -#include "IEHtmlElement.h" -#include "nsIDOMHTMLButtonElement.h" - -HRESULT CIEHtmlButtonElement::FinalConstruct( ) -{ - return CComCreator >::CreateInstance(GetControllingUnknown(), - IID_IUnknown, reinterpret_cast(&m_pHtmlElementAgg)); -} - -HRESULT CIEHtmlButtonElement::GetHtmlElement(CIEHtmlElement **ppHtmlElement) -{ - if (ppHtmlElement == NULL) - return E_FAIL; - *ppHtmlElement = NULL; - IHTMLElement* pHtmlElement = NULL; - // This causes an AddRef on outer unknown: - HRESULT hr = m_pHtmlElementAgg->QueryInterface(IID_IHTMLElement, (void**)&pHtmlElement); - *ppHtmlElement = (CIEHtmlElement*)pHtmlElement; - return hr; -} - -HRESULT CIEHtmlButtonElement::SetDOMNode(nsIDOMNode *pDomNode) -{ - mDOMNode = pDomNode; - //Forward to aggregated object: - CIEHtmlElement *pHtmlElement; - GetHtmlElement(&pHtmlElement); - HRESULT hr = pHtmlElement->SetDOMNode(pDomNode); - // Release on outer unknown because GetHtmlDomNode does AddRef on it: - GetControllingUnknown()->Release(); - return hr; -} - -HRESULT CIEHtmlButtonElement::SetParent(CNode *pParent) -{ - CNode::SetParent(pParent); - //Forward to aggregated object: - CIEHtmlElement *pHtmlElement; - GetHtmlElement(&pHtmlElement); - HRESULT hr = pHtmlElement->SetParent(pParent); - // Release on outer unknown because GetHtmlDomNode does AddRef on it: - GetControllingUnknown()->Release(); - return hr; -} - -// ----------------------------------------------------------------------- -// IHTMLButtonElement Implementation -// ----------------------------------------------------------------------- - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_type(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::put_value(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_value(BSTR __RPC_FAR *p) -{ - if (p == NULL) - return E_INVALIDARG; - - *p = NULL; - nsCOMPtr domHtmlButtonElement = do_QueryInterface(mDOMNode); - if (!domHtmlButtonElement) - return E_UNEXPECTED; - nsAutoString strValue; - domHtmlButtonElement->GetValue(strValue); - *p = SysAllocString(strValue.get()); - if (!*p) - return E_OUTOFMEMORY; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::put_name(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_name(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::put_status(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_status(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::put_disabled(VARIANT_BOOL v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_disabled(VARIANT_BOOL __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::get_form(IHTMLFormElement __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlButtonElement::createTextRange(IHTMLTxtRange __RPC_FAR *__RPC_FAR *range) -{ - return E_NOTIMPL; -} diff --git a/embedding/browser/activex/src/common/IEHtmlButtonElement.h b/embedding/browser/activex/src/common/IEHtmlButtonElement.h deleted file mode 100644 index e619e8e3538..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlButtonElement.h +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// -// Declaration of IHTMLButtonElement and related classes -// -#ifndef IHTMLBUTTONELEMENT_H -#define IHTMLBUTTONELEMENT_H - -#include "IEHtmlNode.h" - -class CIEHtmlElement; - -// NOTE: Nasty hack in case arcane SDK does not define IHTMLButtonElement - -#ifndef __IHTMLButtonElement_INTERFACE_DEFINED__ - MIDL_INTERFACE("3050f2bb-98b5-11cf-bb82-00aa00bdce0b") - IHTMLButtonElement : public IDispatch - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_type( - /* [out][retval] */ BSTR *p) = 0; - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_value( - /* [in] */ BSTR v) = 0; - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_value( - /* [out][retval] */ BSTR *p) = 0; - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_name( - /* [in] */ BSTR v) = 0; - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_name( - /* [out][retval] */ BSTR *p) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_status( - /* [in] */ VARIANT v) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_status( - /* [out][retval] */ VARIANT *p) = 0; - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_disabled( - /* [in] */ VARIANT_BOOL v) = 0; - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_disabled( - /* [out][retval] */ VARIANT_BOOL *p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_form( - /* [out][retval] */ IHTMLFormElement **p) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE createTextRange( - /* [out][retval] */ IHTMLTxtRange **range) = 0; - - }; -#endif - -class CIEHtmlButtonElement : - public CNode, - public IDispatchImpl -{ -public: - CIEHtmlButtonElement() { - }; - - HRESULT FinalConstruct( ); - virtual HRESULT GetHtmlElement(CIEHtmlElement **ppHtmlElement); - virtual HRESULT SetDOMNode(nsIDOMNode *pDomNode); - virtual HRESULT SetParent(CNode *pParent); - -DECLARE_GET_CONTROLLING_UNKNOWN() - -protected: - virtual ~CIEHtmlButtonElement() { - }; - -public: - -BEGIN_COM_MAP(CIEHtmlButtonElement) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLButtonElement) - COM_INTERFACE_ENTRY_AGGREGATE(IID_IHTMLElement, m_pHtmlElementAgg.p) - COM_INTERFACE_ENTRY_AGGREGATE(__uuidof(IHTMLDOMNode), m_pHtmlElementAgg.p) -END_COM_MAP() - - // IHTMLButtonElement Implementation: - virtual HRESULT STDMETHODCALLTYPE get_type(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_value(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_value(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_name(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_name(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_status(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_status(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_disabled(VARIANT_BOOL v); - virtual HRESULT STDMETHODCALLTYPE get_disabled(VARIANT_BOOL __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_form(IHTMLFormElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE createTextRange(IHTMLTxtRange __RPC_FAR *__RPC_FAR *range); - -protected: - CComPtr m_pHtmlElementAgg; -}; - -typedef CComObject CIEHtmlButtonElementInstance; - -#endif //IHTMLBUTTONELEMENT_H diff --git a/embedding/browser/activex/src/common/IEHtmlElement.cpp b/embedding/browser/activex/src/common/IEHtmlElement.cpp deleted file mode 100644 index c993fa15a8b..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlElement.cpp +++ /dev/null @@ -1,976 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include "nsCOMPtr.h" -#include "nsIDOMElement.h" - -#include "IEHtmlElement.h" -#include "IEHtmlElementCollection.h" - -#include "nsIDOMHTMLElement.h" -#include "nsIDOMNSHTMLElement.h" -#include "nsIDOMDocumentRange.h" -#include "nsIDOMRange.h" -#include "nsIDOMNSRange.h" -#include "nsIDOMDocumentFragment.h" -#include "nsIDocumentEncoder.h" -#include "nsContentCID.h" - -CIEHtmlElement::CIEHtmlElement() -{ - m_pNodeAgg = NULL; -} - -HRESULT CIEHtmlElement::FinalConstruct( ) -{ - return CComCreator >::CreateInstance(GetControllingUnknown(), - IID_IUnknown, reinterpret_cast(&m_pNodeAgg)); -} - -CIEHtmlElement::~CIEHtmlElement() -{ -} - -void CIEHtmlElement::FinalRelease( ) -{ - m_pNodeAgg->Release(); -} - -HRESULT CIEHtmlElement::GetChildren(CIEHtmlElementCollectionInstance **ppCollection) -{ - // Validate parameters - if (ppCollection == NULL) - { - return E_INVALIDARG; - } - - *ppCollection = NULL; - - // Create a collection representing the children of this node - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, FALSE, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->AddRef(); - *ppCollection = pCollection; - } - - return S_OK; -} - -HRESULT CIEHtmlElement::GetHtmlDomNode(CIEHtmlDomNode **ppHtmlDomNode) -{ - if (ppHtmlDomNode == NULL) - return E_FAIL; - *ppHtmlDomNode = NULL; - IHTMLDOMNode* pHtmlNode = NULL; - // This causes an AddRef on outer unknown: - HRESULT hr = m_pNodeAgg->QueryInterface(__uuidof(IHTMLDOMNode), (void**)&pHtmlNode); - *ppHtmlDomNode = (CIEHtmlDomNode*)pHtmlNode; - return hr; -} - -HRESULT CIEHtmlElement::SetDOMNode(nsIDOMNode *pDomNode) -{ - mDOMNode = pDomNode; - // Forward to aggregated object: - CIEHtmlDomNode *pHtmlDomNode; - GetHtmlDomNode(&pHtmlDomNode); - HRESULT hr = pHtmlDomNode->SetDOMNode(pDomNode); - // Release on outer unknown because GetHtmlDomNode does AddRef on it: - GetControllingUnknown()->Release(); - return hr; -} - -HRESULT CIEHtmlElement::SetParent(CNode *pParent) -{ - CNode::SetParent(pParent); - // Forward to aggregated object: - CIEHtmlDomNode *pHtmlDomNode; - GetHtmlDomNode(&pHtmlDomNode); - HRESULT hr = pHtmlDomNode->SetParent(pParent); - // Release on outer unknown because GetHtmlDomNode does AddRef on it: - GetControllingUnknown()->Release(); - return hr; -} - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLElement implementation - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::setAttribute(BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - - nsCOMPtr element = do_QueryInterface(mDOMNode); - if (!element) - { - return E_UNEXPECTED; - } - - // Get the name from the BSTR - USES_CONVERSION; - nsAutoString name(OLE2W(strAttributeName)); - - // Get the value from the variant - CComVariant vValue; - if (FAILED(vValue.ChangeType(VT_BSTR, &AttributeValue))) - { - return E_INVALIDARG; - } - - // Set the attribute - nsAutoString value(OLE2W(vValue.bstrVal)); - element->SetAttribute(name, value); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::getAttribute(BSTR strAttributeName, LONG lFlags, VARIANT __RPC_FAR *AttributeValue) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - if (AttributeValue == NULL) - { - return E_INVALIDARG; - } - VariantInit(AttributeValue); - - // Get the name from the BSTR - USES_CONVERSION; - nsAutoString name(OLE2W(strAttributeName)); - - nsCOMPtr element = do_QueryInterface(mDOMNode); - if (!element) - { - return E_UNEXPECTED; - } - - BOOL bCaseSensitive = (lFlags == VARIANT_TRUE) ? TRUE : FALSE; - - - // Get the attribute - nsAutoString value; - nsresult rv = element->GetAttribute(name, value); - if (NS_SUCCEEDED(rv)) - { - USES_CONVERSION; - AttributeValue->vt = VT_BSTR; - AttributeValue->bstrVal = SysAllocString(W2COLE(value.get())); - return S_OK; - } - else - { - return S_FALSE; - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::removeAttribute(BSTR strAttributeName, LONG lFlags, VARIANT_BOOL __RPC_FAR *pfSuccess) -{ - if (strAttributeName == NULL) - { - return E_INVALIDARG; - } - - nsCOMPtr element = do_QueryInterface(mDOMNode); - if (!element) - { - return E_UNEXPECTED; - } - - BOOL bCaseSensitive = (lFlags == VARIANT_TRUE) ? TRUE : FALSE; - - // Get the name from the BSTR - USES_CONVERSION; - nsAutoString name(OLE2W(strAttributeName)); - - // Remove the attribute - nsresult nr = element->RemoveAttribute(name); - BOOL bRemoved = (nr == NS_OK) ? TRUE : FALSE; - - if (pfSuccess) - { - *pfSuccess = (bRemoved) ? VARIANT_TRUE : VARIANT_FALSE; - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_className(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_className(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - VARIANT vValue; - VariantInit(&vValue); - BSTR bstrName = SysAllocString(OLESTR("class")); - getAttribute(bstrName, FALSE, &vValue); - SysFreeString(bstrName); - - *p = vValue.bstrVal; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_id(BSTR v) -{ - nsCOMPtr domHtmlElmt = do_QueryInterface(mDOMNode); - if (!domHtmlElmt) - return E_UNEXPECTED; - USES_CONVERSION; - nsDependentString strID(OLE2CW(v)); - if (FAILED(domHtmlElmt->SetId(strID))) - return E_FAIL; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_id(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - VARIANT vValue; - VariantInit(&vValue); - BSTR bstrName = SysAllocString(OLESTR("id")); - getAttribute(bstrName, FALSE, &vValue); - SysFreeString(bstrName); - - *p = vValue.bstrVal; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_tagName(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - nsCOMPtr element = do_QueryInterface(mDOMNode); - if (!element) - { - return E_UNEXPECTED; - } - - nsAutoString tagName; - element->GetTagName(tagName); - - USES_CONVERSION; - *p = SysAllocString(W2COLE(tagName.get())); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - if (mParent) - { - CIEHtmlElement *pElt = static_cast(mParent); - pElt->QueryInterface(IID_IHTMLElement, (void **) p); - } - else - { - nsCOMPtr parentNode; - mDOMNode->GetParentNode(getter_AddRefs(parentNode)); - nsCOMPtr domElement = do_QueryInterface(parentNode); - if (domElement) - { - CComPtr pNode; - HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(parentNode, &pNode); - if (FAILED(hr)) - return hr; - if (FAILED(pNode->QueryInterface(IID_IHTMLElement, (void **) p))) - return E_UNEXPECTED; - } - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_style(IHTMLStyle __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onhelp(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onhelp(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onclick(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondblclick(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondblclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeydown(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeydown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeyup(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeyup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onkeypress(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onkeypress(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseout(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseout(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseover(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseover(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmousemove(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmousemove(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmousedown(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmousedown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onmouseup(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onmouseup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_document(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_title(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_title(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_language(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_language(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onselectstart(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onselectstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::scrollIntoView(VARIANT varargStart) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::contains(IHTMLElement __RPC_FAR *pChild, VARIANT_BOOL __RPC_FAR *pfResult) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_sourceIndex(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_recordNumber(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_lang(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_lang(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetLeft(long __RPC_FAR *p) -{ - nsCOMPtr nodeAsHTMLElement = do_QueryInterface(mDOMNode); - if (!nodeAsHTMLElement) - { - return E_NOINTERFACE; - } - - PRInt32 nData; - nodeAsHTMLElement->GetOffsetLeft(&nData); - *p = nData; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetTop(long __RPC_FAR *p) -{ - nsCOMPtr nodeAsHTMLElement = do_QueryInterface(mDOMNode); - if (!nodeAsHTMLElement) - { - return E_NOINTERFACE; - } - - PRInt32 nData; - nodeAsHTMLElement->GetOffsetTop(&nData); - *p = nData; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetWidth(long __RPC_FAR *p) -{ - nsCOMPtr nodeAsHTMLElement = do_QueryInterface(mDOMNode); - if (!nodeAsHTMLElement) - { - return E_NOINTERFACE; - } - - PRInt32 nData; - nodeAsHTMLElement->GetOffsetWidth(&nData); - *p = nData; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetHeight(long __RPC_FAR *p) -{ - nsCOMPtr nodeAsHTMLElement = do_QueryInterface(mDOMNode); - if (!nodeAsHTMLElement) - { - return E_NOINTERFACE; - } - - PRInt32 nData; - nodeAsHTMLElement->GetOffsetHeight(&nData); - *p = nData; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_offsetParent(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_innerHTML(BSTR v) -{ - nsCOMPtr elementHTML = do_QueryInterface(mDOMNode); - if (!elementHTML) - { - return E_UNEXPECTED; - } - - USES_CONVERSION; - nsAutoString innerHTML(OLE2W(v)); - elementHTML->SetInnerHTML(innerHTML); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerHTML(BSTR __RPC_FAR *p) -{ - nsCOMPtr elementHTML = do_QueryInterface(mDOMNode); - if (!elementHTML) - { - return E_UNEXPECTED; - } - - nsAutoString innerHTML; - elementHTML->GetInnerHTML(innerHTML); - - USES_CONVERSION; - *p = SysAllocString(W2COLE(innerHTML.get())); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_innerText(BSTR v) -{ - if (!mDOMNode) - { - return E_UNEXPECTED; - } - - USES_CONVERSION; - nsAutoString innerText(OLE2W(v)); - mDOMNode->SetTextContent(innerText); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerText(BSTR __RPC_FAR *p) -{ - if (!mDOMNode) - { - return E_UNEXPECTED; - } - - nsAutoString innerText; - mDOMNode->GetTextContent(innerText); - - USES_CONVERSION; - *p = SysAllocString(W2COLE(innerText.get())); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_outerHTML(BSTR v) -{ - nsresult rv; - nsCOMPtr domDoc; - nsCOMPtr domRange; - nsCOMPtr domDocFragment; - - mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc)); - nsCOMPtr domDocRange = do_QueryInterface(domDoc); - if (!domDocRange) - return E_FAIL; - domDocRange->CreateRange(getter_AddRefs(domRange)); - if (!domRange) - return E_FAIL; - if (domRange->SetStartBefore(mDOMNode)) - return E_FAIL; - if (domRange->DeleteContents()) - return E_FAIL; - nsAutoString outerHTML(OLE2W(v)); - nsCOMPtr domNSRange = do_QueryInterface(domRange); - rv = domNSRange->CreateContextualFragment(outerHTML, getter_AddRefs(domDocFragment)); - if (!domDocFragment) - return E_FAIL; - nsCOMPtr parentNode; - mDOMNode->GetParentNode(getter_AddRefs(parentNode)); - nsCOMPtr domNode; - parentNode->ReplaceChild(domDocFragment, mDOMNode, getter_AddRefs(domNode)); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_outerHTML(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsresult rv; - nsAutoString outerHTML; - nsCOMPtr domDoc; - nsCOMPtr docEncoder; - nsCOMPtr domRange; - - mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc)); - if (!domDoc) - return E_FAIL; - - docEncoder = do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/html"); - NS_ENSURE_TRUE(docEncoder, NS_ERROR_FAILURE); - docEncoder->Init(domDoc, NS_LITERAL_STRING("text/html"), - nsIDocumentEncoder::OutputEncodeBasicEntities); - nsCOMPtr domDocRange = do_QueryInterface(domDoc); - if (!domDocRange) - return E_FAIL; - domDocRange->CreateRange(getter_AddRefs(domRange)); - if (!domRange) - return E_FAIL; - rv = domRange->SelectNode(mDOMNode); - NS_ENSURE_SUCCESS(rv, rv); - docEncoder->SetRange(domRange); - docEncoder->EncodeToString(outerHTML); - - USES_CONVERSION; - *p = SysAllocString(W2COLE(outerHTML.get())); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_outerText(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_outerText(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::insertAdjacentHTML(BSTR where, BSTR html) -{ - nsresult rv; - nsCOMPtr domDoc; - nsCOMPtr domRange; - nsCOMPtr domDocFragment; - - NS_ASSERTION(mDOMNode, ""); - //Create a range: - mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc)); - nsCOMPtr domDocRange = do_QueryInterface(domDoc); - if (!domDocRange) - return E_FAIL; - domDocRange->CreateRange(getter_AddRefs(domRange)); - if (!domRange) - return E_FAIL; - // Must position range first before calling CreateContextualFragment: - if (domRange->SetStartBefore(mDOMNode)) - return E_FAIL; - USES_CONVERSION; - // Create doc fragment: - nsDependentString strAdjacentHTML(OLE2CW(html)); - nsCOMPtr domNSRange = do_QueryInterface(domRange); - domNSRange->CreateContextualFragment(strAdjacentHTML, getter_AddRefs(domDocFragment)); - if (!domDocFragment) - return E_FAIL; - if (_wcsicmp(OLE2CW(where), L"beforeBegin") == 0) - { - // Insert fragment immediately before us: - nsCOMPtr parentNode; - mDOMNode->GetParentNode(getter_AddRefs(parentNode)); - nsCOMPtr dummyNode; - rv = parentNode->InsertBefore(domDocFragment, mDOMNode, getter_AddRefs(dummyNode)); - return SUCCEEDED(rv)? S_OK: E_FAIL; - } - if (_wcsicmp(OLE2CW(where), L"afterEnd") == 0) - { - // Insert fragment immediately after us: - nsCOMPtr parentNode; - mDOMNode->GetParentNode(getter_AddRefs(parentNode)); - nsCOMPtr dummyNode; - nsCOMPtr nextNode; - mDOMNode->GetNextSibling(getter_AddRefs(nextNode)); - if (nextNode) - { - // Insert immediately before next node: - rv = parentNode->InsertBefore(domDocFragment, nextNode, getter_AddRefs(dummyNode)); - } - else - { - // We are the last child, insert after us: - rv = parentNode->AppendChild(domDocFragment, getter_AddRefs(dummyNode)); - } - return SUCCEEDED(rv)? S_OK: E_FAIL; - } - if (_wcsicmp(OLE2CW(where), L"afterBegin") == 0) - { - // Insert fragment immediately before first child: - nsCOMPtr firstChildNode; - mDOMNode->GetFirstChild(getter_AddRefs(firstChildNode)); - if (!firstChildNode) - return E_FAIL; // IE fails when inserting into a tag that has no childs - nsCOMPtr dummyNode; - rv = mDOMNode->InsertBefore(domDocFragment, firstChildNode, getter_AddRefs(dummyNode)); - return SUCCEEDED(rv)? S_OK: E_FAIL; - } - if (_wcsicmp(OLE2CW(where), L"beforeEnd") == 0) - { - // Insert fragment immediately as last child: - nsCOMPtr dummyNode; - rv = mDOMNode->AppendChild(domDocFragment, getter_AddRefs(dummyNode)); - return SUCCEEDED(rv)? S_OK: E_FAIL; - } - return E_INVALIDARG; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::insertAdjacentText(BSTR where, BSTR text) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_parentTextEdit(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_isTextEdit(VARIANT_BOOL __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::click(void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_filters(IHTMLFiltersCollection __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondragstart(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondragstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::toString(BSTR __RPC_FAR *String) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onbeforeupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onbeforeupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onafterupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onafterupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onerrorupdate(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onerrorupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onrowexit(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onrowexit(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onrowenter(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onrowenter(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondatasetchanged(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondatasetchanged(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondataavailable(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondataavailable(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_ondatasetcomplete(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_ondatasetcomplete(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_onfilterchange(VARIANT v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_onfilterchange(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_children(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Create a collection representing the children of this node - CIEHtmlElementCollectionInstance *pCollection = NULL; - HRESULT hr = GetChildren(&pCollection); - if (SUCCEEDED(hr)) - { - *p = pCollection; - } - - return hr; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_all(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // TODO get ALL contained elements, not just the immediate children - - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, TRUE, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->AddRef(); - *p = pCollection; - } - - return S_OK; -} - diff --git a/embedding/browser/activex/src/common/IEHtmlElement.h b/embedding/browser/activex/src/common/IEHtmlElement.h deleted file mode 100644 index 84f0a88b781..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlElement.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLELEMENT_H -#define IEHTMLELEMENT_H - -#include "IEHtmlNode.h" -#include "IEHtmlElementCollection.h" - -class CIEHtmlElement : - public CNode, - public IDispatchImpl -{ -public: - DECLARE_AGGREGATABLE(CIEHtmlElement) - CIEHtmlElement(); - HRESULT FinalConstruct( ); - void FinalRelease( ); - -DECLARE_GET_CONTROLLING_UNKNOWN() - -protected: - virtual ~CIEHtmlElement(); - -public: - -BEGIN_COM_MAP(CIEHtmlElement) - COM_INTERFACE_ENTRY2(IDispatch, IHTMLElement) - COM_INTERFACE_ENTRY(IHTMLElement) - COM_INTERFACE_ENTRY_AGGREGATE(__uuidof(IHTMLDOMNode), m_pNodeAgg) -END_COM_MAP() - - virtual HRESULT GetChildren(CIEHtmlElementCollectionInstance **ppCollection); - virtual HRESULT GetHtmlDomNode(CIEHtmlDomNode **ppHtmlDomNode); - virtual HRESULT SetDOMNode(nsIDOMNode *pDomNode); - virtual HRESULT SetParent(CNode *pParent); - - // Implementation of IHTMLElement - virtual HRESULT STDMETHODCALLTYPE setAttribute(BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags); - virtual HRESULT STDMETHODCALLTYPE getAttribute(BSTR strAttributeName, LONG lFlags, VARIANT __RPC_FAR *AttributeValue); - virtual HRESULT STDMETHODCALLTYPE removeAttribute(BSTR strAttributeName, LONG lFlags, VARIANT_BOOL __RPC_FAR *pfSuccess); - virtual HRESULT STDMETHODCALLTYPE put_className(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_className(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_id(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_id(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_tagName(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_style(IHTMLStyle __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_document(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_title(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_language(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_language(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE scrollIntoView(VARIANT varargStart); - virtual HRESULT STDMETHODCALLTYPE contains(IHTMLElement __RPC_FAR *pChild, VARIANT_BOOL __RPC_FAR *pfResult); - virtual HRESULT STDMETHODCALLTYPE get_sourceIndex(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_recordNumber(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_lang(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_lang(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetLeft(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetTop(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetWidth(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetHeight(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_offsetParent(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_innerHTML(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_innerHTML(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_innerText(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_innerText(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_outerHTML(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_outerHTML(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_outerText(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_outerText(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE insertAdjacentHTML(BSTR where, BSTR html); - virtual HRESULT STDMETHODCALLTYPE insertAdjacentText(BSTR where, BSTR text); - virtual HRESULT STDMETHODCALLTYPE get_parentTextEdit(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_isTextEdit(VARIANT_BOOL __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE click(void); - virtual HRESULT STDMETHODCALLTYPE get_filters(IHTMLFiltersCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondatasetchanged(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondatasetchanged(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondataavailable(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondataavailable(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondatasetcomplete(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondatasetcomplete(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onfilterchange(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onfilterchange(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_children(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_all(IDispatch __RPC_FAR *__RPC_FAR *p); - -protected: - IUnknown* m_pNodeAgg; -}; - -#define CIEHTMLELEMENT_INTERFACES \ - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLElement) \ - COM_INTERFACE_ENTRY_IID(IID_IHTMLElement, IHTMLElement) - -typedef CComObject CIEHtmlElementInstance; - -#endif - - diff --git a/embedding/browser/activex/src/common/IEHtmlElementCollection.cpp b/embedding/browser/activex/src/common/IEHtmlElementCollection.cpp deleted file mode 100644 index 8b1c78aac42..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlElementCollection.cpp +++ /dev/null @@ -1,723 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include "nsIDOMDocumentTraversal.h" -#include "nsIDOMTreeWalker.h" -#include "nsIDOMNodeFilter.h" -#include "nsIDOMDocument.h" -#include "nsIDOMHtmlElement.h" - -#include "IEHtmlElement.h" -#include "IEHtmlElementCollection.h" - -CIEHtmlElementCollection::CIEHtmlElementCollection() -{ - mNodeList = NULL; - mNodeListCount = 0; - mNodeListCapacity = 0; -} - -CIEHtmlElementCollection::~CIEHtmlElementCollection() -{ - // Clean the node list - if (mNodeList) - { - for (PRUint32 i = 0; i < mNodeListCount; i++) - { - IDispatch *pDisp = mNodeList[i]; - if (pDisp) - { - pDisp->Release(); - } - } - free(mNodeList); - mNodeList = NULL; - mNodeListCount = 0; - mNodeListCapacity = 0; - } -} - -HRESULT CIEHtmlElementCollection::FindOrCreateIEElement(nsIDOMNode* domNode, IHTMLElement** pIHtmlElement) -{ - CComPtr pNode; - HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(domNode, &pNode); - if (FAILED(hr)) - return hr; - if (FAILED(pNode->QueryInterface(IID_IHTMLElement, (void**)pIHtmlElement))) - return E_UNEXPECTED; - return S_OK; -} - -HRESULT CIEHtmlElementCollection::PopulateFromDOMHTMLCollection(nsIDOMHTMLCollection *pNodeList) -{ - if (pNodeList == nsnull) - { - return S_OK; - } - - // Recurse through the children of the node (and the children of that) - // to populate the collection - - // Iterate through items in list - PRUint32 length = 0; - pNodeList->GetLength(&length); - for (PRUint32 i = 0; i < length; i++) - { - // Get the next item from the list - nsCOMPtr childNode; - pNodeList->Item(i, getter_AddRefs(childNode)); - if (!childNode) - { - // Empty node (unexpected, but try and carry on anyway) - NS_ERROR("Empty node"); - continue; - } - - // Skip nodes representing, text, attributes etc. - PRUint16 nodeType; - childNode->GetNodeType(&nodeType); - if (nodeType != nsIDOMNode::ELEMENT_NODE) - { - continue; - } - - // Create an equivalent IE element - CComQIPtr pHtmlElement; - HRESULT hr = FindOrCreateIEElement(childNode, &pHtmlElement); - if (FAILED(hr)) - return hr; - AddNode(pHtmlElement); - } - return S_OK; -} - -HRESULT CIEHtmlElementCollection::PopulateFromDOMNode(nsIDOMNode *aDOMNode, BOOL bRecurseChildren) -{ - if (aDOMNode == nsnull) - { - NS_ERROR("No dom node"); - return E_INVALIDARG; - } - - PRBool hasChildNodes = PR_FALSE; - aDOMNode->HasChildNodes(&hasChildNodes); - if (hasChildNodes) - { - if (bRecurseChildren) - { - nsresult rv; - - // Search through parent nodes, looking for the DOM document - nsCOMPtr docAsNode = aDOMNode; - nsCOMPtr doc = do_QueryInterface(aDOMNode); - while (!doc) { - nsCOMPtr parentNode; - docAsNode->GetParentNode(getter_AddRefs(parentNode)); - docAsNode = parentNode; - if (!docAsNode) - { - return E_FAIL; - } - doc = do_QueryInterface(docAsNode); - } - - // Walk the DOM - nsCOMPtr trav = do_QueryInterface(doc, &rv); - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - nsCOMPtr walker; - rv = trav->CreateTreeWalker(aDOMNode, - nsIDOMNodeFilter::SHOW_ELEMENT, - nsnull, PR_TRUE, getter_AddRefs(walker)); - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - - // We're not interested in the document node, so we always start - // with the next one, walking through them all to make the collection - nsCOMPtr currentNode; - walker->FirstChild(getter_AddRefs(currentNode)); - while (currentNode) - { - // Create an equivalent IE element - CComQIPtr pHtmlElement; - HRESULT hr = FindOrCreateIEElement(currentNode, &pHtmlElement); - if (FAILED(hr)) - return hr; - AddNode(pHtmlElement); - walker->NextNode(getter_AddRefs(currentNode)); - } - } - else - { - nsCOMPtr nodeList; - aDOMNode->GetChildNodes(getter_AddRefs(nodeList)); - mDOMNodeList = nodeList; - } - } - return S_OK; -} - - -HRESULT CIEHtmlElementCollection::CreateFromDOMHTMLCollection(CNode *pParentNode, nsIDOMHTMLCollection *pNodeList, CIEHtmlElementCollection **pInstance) -{ - if (pInstance == NULL || pParentNode == NULL) - { - NS_ERROR("No instance or parent node"); - return E_INVALIDARG; - } - - // Get the DOM node from the parent node - if (!pParentNode->mDOMNode) - { - NS_ERROR("Parent has no DOM node"); - return E_INVALIDARG; - } - - *pInstance = NULL; - - // Create a collection object - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - NS_ERROR("Could not create collection"); - return E_OUTOFMEMORY; - } - - // Initialise and populate the collection - pCollection->SetParent(pParentNode); - pCollection->PopulateFromDOMHTMLCollection(pNodeList); - - *pInstance = pCollection; - - return S_OK; -} - -HRESULT CIEHtmlElementCollection::CreateFromParentNode(CNode *pParentNode, BOOL bRecurseChildren, CIEHtmlElementCollection **pInstance) -{ - if (pInstance == NULL || pParentNode == NULL) - { - NS_ERROR("No instance or parent node"); - return E_INVALIDARG; - } - - // Get the DOM node from the parent node - if (!pParentNode->mDOMNode) - { - NS_ERROR("Parent has no DOM node"); - return E_INVALIDARG; - } - - *pInstance = NULL; - - // Create a collection object - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - NS_ERROR("Could not create collection"); - return E_OUTOFMEMORY; - } - - // Initialise and populate the collection - pCollection->SetParent(pParentNode); - pCollection->PopulateFromDOMNode(pParentNode->mDOMNode, bRecurseChildren); - - *pInstance = pCollection; - - return S_OK; -} - - -HRESULT CIEHtmlElementCollection::AddNode(IDispatch *pNode) -{ - if (pNode == NULL) - { - NS_ERROR("No node"); - return E_INVALIDARG; - } - - const PRUint32 c_NodeListResizeBy = 100; - - if (mNodeList == NULL) - { - mNodeListCapacity = c_NodeListResizeBy; - mNodeList = (IDispatch **) malloc(sizeof(IDispatch *) * mNodeListCapacity); - mNodeListCount = 0; - } - else if (mNodeListCount == mNodeListCapacity) - { - mNodeListCapacity += c_NodeListResizeBy; - mNodeList = (IDispatch **) realloc(mNodeList, sizeof(IDispatch *) * mNodeListCapacity); - } - - if (mNodeList == NULL) - { - NS_ERROR("Could not realloc node list"); - return E_OUTOFMEMORY; - } - - pNode->AddRef(); - mNodeList[mNodeListCount++] = pNode; - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLElementCollection methods - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::toString(BSTR __RPC_FAR *String) -{ - if (String == NULL) - { - return E_INVALIDARG; - } - *String = SysAllocString(OLESTR("ElementCollection")); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::put_length(long v) -{ - // What is the point of this method? - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::get_length(long __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - // Return the size of the collection - if (mDOMNodeList) - { - // Count the number of elements in the list - PRUint32 elementCount = 0; - PRUint32 length = 0; - mDOMNodeList->GetLength(&length); - for (PRUint32 i = 0; i < length; i++) - { - // Get the next item from the list - nsCOMPtr childNode; - mDOMNodeList->Item(i, getter_AddRefs(childNode)); - if (!childNode) - { - // Empty node (unexpected, but try and carry on anyway) - NS_ERROR("Empty node"); - continue; - } - - // Only count elements - PRUint16 nodeType; - childNode->GetNodeType(&nodeType); - if (nodeType == nsIDOMNode::ELEMENT_NODE) - { - elementCount++; - } - } - *p = elementCount; - } - else - { - *p = mNodeListCount; - } - return S_OK; -} - -typedef CComObject > > CComEnumVARIANT; - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::get__newEnum(IUnknown __RPC_FAR *__RPC_FAR *p) -{ - TRACE_METHOD(CIEHtmlElementCollection::get__newEnum); - - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Create a new IEnumVARIANT object - CComEnumVARIANT *pEnumVARIANT = NULL; - CComEnumVARIANT::CreateInstance(&pEnumVARIANT); - if (pEnumVARIANT == NULL) - { - NS_ERROR("Could not creat Enum"); - return E_OUTOFMEMORY; - } - - int nObject = 0; - long nObjects = 0; - get_length(&nObjects); - - // Create an array of VARIANTs - VARIANT *avObjects = new VARIANT[nObjects]; - if (avObjects == NULL) - { - NS_ERROR("Could not create variant array"); - return E_OUTOFMEMORY; - } - - if (mDOMNodeList) - { - // Fill the variant array with elements from the DOM node list - PRUint32 length = 0; - mDOMNodeList->GetLength(&length); - for (PRUint32 i = 0; i < length; i++) - { - // Get the next item from the list - nsCOMPtr childNode; - mDOMNodeList->Item(i, getter_AddRefs(childNode)); - if (!childNode) - { - // Empty node (unexpected, but try and carry on anyway) - NS_ERROR("Could not get node"); - continue; - } - - // Skip nodes representing, text, attributes etc. - PRUint16 nodeType; - childNode->GetNodeType(&nodeType); - if (nodeType != nsIDOMNode::ELEMENT_NODE) - { - continue; - } - - // Store the element in the array - CComQIPtr pHtmlElement; - HRESULT hr = FindOrCreateIEElement(childNode, &pHtmlElement); - if (FAILED(hr)) - return hr; - VARIANT *pVariant = &avObjects[nObject++]; - VariantInit(pVariant); - pVariant->vt = VT_DISPATCH; - pHtmlElement->QueryInterface(IID_IDispatch, (void **) &pVariant->pdispVal); - } - } - else - { - // Copy the contents of the collection to the array - for (nObject = 0; nObject < nObjects; nObject++) - { - VARIANT *pVariant = &avObjects[nObject]; - IDispatch *pDispObject = mNodeList[nObject]; - VariantInit(pVariant); - pVariant->vt = VT_DISPATCH; - pVariant->pdispVal = pDispObject; - pDispObject->AddRef(); - } - } - - // Copy the variants to the enumeration object - pEnumVARIANT->Init(&avObjects[0], &avObjects[nObjects], NULL, AtlFlagCopy); - - // Cleanup the array - for (nObject = 0; nObject < nObjects; nObject++) - { - VARIANT *pVariant = &avObjects[nObject]; - VariantClear(pVariant); - } - delete []avObjects; - - return pEnumVARIANT->QueryInterface(IID_IUnknown, (void**) p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::item(VARIANT name, VARIANT index, IDispatch __RPC_FAR *__RPC_FAR *pdisp) -{ - TRACE_METHOD(CIEHtmlElementCollection::item); - - if (pdisp == NULL) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - - // Parameter name is either a string or a number - - PRBool searchForName = PR_FALSE; - nsAutoString nameToSearch; - PRInt32 idxForSearch = 0; - - if (name.vt == VT_BSTR && name.bstrVal && wcslen(name.bstrVal) > 0) - { - nameToSearch.Assign(name.bstrVal); - searchForName = PR_TRUE; - } - else switch (name.vt) - { - case VT_UI1: - case VT_UI2: - case VT_UI4: - case VT_I1: - case VT_I2: - case VT_I1 | VT_BYREF: - case VT_I2 | VT_BYREF: - // Coerce the variant into a long - if (FAILED(VariantChangeType(&name, &name, 0, VT_I4))) - { - return E_INVALIDARG; - } - // Fall through - case VT_I4: - idxForSearch = name.lVal; - if (idxForSearch < 0) - return E_INVALIDARG; - break; - default: - // Unknown arg. - // As per documentation, no attempt to be lenient with crappy clients - // for the time being. - return E_INVALIDARG; - } - - CIEHtmlElementCollectionInstance* pCollection = NULL; - - if (mDOMNodeList) - { - CComQIPtr pHtmlElement; - // Search for the Nth element in the list - PRUint32 elementCount = 0; - PRUint32 length = 0; - mDOMNodeList->GetLength(&length); - for (PRUint32 i = 0; i < length; i++) - { - // Get the next item from the list - nsCOMPtr childNode; - mDOMNodeList->Item(i, getter_AddRefs(childNode)); - if (!childNode) - { - // Empty node (unexpected, but try and carry on anyway) - NS_ERROR("Could not get node"); - continue; - } - - // Skip nodes representing, text, attributes etc. - nsCOMPtr nodeAsElement = do_QueryInterface(childNode); - if (!nodeAsElement) - { - continue; - } - - // Have we found the element we need? - PRBool grabThisNode = PR_FALSE; - if (searchForName) - { - nsCOMPtr nodeAsHtmlElement = do_QueryInterface(childNode); - if (nodeAsHtmlElement) - { - NS_NAMED_LITERAL_STRING(nameAttr, "name"); - nsAutoString nodeName; - nsAutoString nodeId; - nodeAsHtmlElement->GetAttribute(nameAttr, nodeName); - nodeAsHtmlElement->GetId(nodeId); - if (nodeName.Equals(nameToSearch) || nodeId.Equals(nameToSearch)) - { - grabThisNode = PR_TRUE; - } - } - } - else if (elementCount == idxForSearch) - { - grabThisNode = PR_TRUE; - } - - if (grabThisNode) - { - if (pHtmlElement) - { - if (pCollection == NULL) - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - // Add existing to collection - pCollection->AddNode(pHtmlElement); - } - // Create new element: - HRESULT hr = FindOrCreateIEElement(childNode, &pHtmlElement); - if (FAILED(hr)) - return hr; - ((CIEHtmlElement*)pHtmlElement.p)->SetParent(mParent); - } - elementCount++; - } - // Return the element or collection : - if (pCollection != NULL) - { - // Add last created element to collection - pCollection->AddNode(pHtmlElement); - pCollection->QueryInterface(IID_IDispatch, (void **) pdisp); - } - else if (pHtmlElement != NULL) - pHtmlElement->QueryInterface(IID_IDispatch, (void **) pdisp); - } - else - { - if (searchForName) - { - CComPtr element = NULL; - for (PRUint32 i = 0; i < mNodeListCount; i++) - { - CComQIPtr currElement = mNodeList[i]; - if (currElement.p) - { - CComVariant elementName; - CComBSTR elementId; - currElement->get_id(&elementId); - currElement->getAttribute(L"name", 0, &elementName); - if ((elementId && wcscmp(elementId, name.bstrVal) == 0) || - (elementName.vt == VT_BSTR && elementName.bstrVal && - wcscmp(elementName.bstrVal, name.bstrVal) == 0)) - { - if (element != NULL) - { - if (!pCollection) - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - pCollection->AddNode(element); - } - element = currElement; - } - } - } - // Return the element or collection : - if (pCollection != NULL) - { - pCollection->AddNode(element); - pCollection->QueryInterface(IID_IDispatch, (void **) pdisp); - } - else if (element != NULL) - element->QueryInterface(IID_IDispatch, (void **) pdisp); - } - else - { - // Test for stupid values - if (idxForSearch >= mNodeListCount) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - IDispatch *pNode = mNodeList[idxForSearch]; - if (pNode == NULL) - { - NS_ERROR("No node"); - return E_UNEXPECTED; - } - pNode->QueryInterface(IID_IDispatch, (void **) pdisp); - } - } - - // Note: As per docs S_OK is fine even if no node is returned - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlElementCollection::tags(VARIANT tagName, IDispatch __RPC_FAR *__RPC_FAR *pdisp) -{ - if (pdisp == NULL || tagName.vt != VT_BSTR) - { - return E_INVALIDARG; - } - - *pdisp = NULL; - - CIEHtmlElementCollectionInstance* pCollection = NULL; - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - if (mNodeList) - { - for (PRUint32 i = 0; i < mNodeListCount; i++) - { - CComQIPtr element = mNodeList[i]; - if (element.p) - { - CComBSTR elementTagName; - element->get_tagName(&elementTagName); - if (elementTagName && _wcsicmp(elementTagName, tagName.bstrVal) == 0) - pCollection->AddNode(element); - } - } - pCollection->QueryInterface(IID_IDispatch, (void**)pdisp); - return S_OK; - } - else if (mDOMNodeList) - { - PRUint32 length = 0; - mDOMNodeList->GetLength(&length); - for (PRUint32 i = 0; i < length; i++) - { - // Get the next item from the list - nsCOMPtr childNode; - mDOMNodeList->Item(i, getter_AddRefs(childNode)); - if (!childNode) - { - // Empty node (unexpected, but try and carry on anyway) - NS_ERROR("Could not get node"); - continue; - } - - // Skip nodes representing, text, attributes etc. - nsCOMPtr nodeAsElement = do_QueryInterface(childNode); - if (!nodeAsElement) - { - continue; - } - - nsCOMPtr nodeAsHtmlElement = do_QueryInterface(childNode); - if (nodeAsHtmlElement) - { - nsAutoString elementTagName; - nodeAsHtmlElement->GetTagName(elementTagName); - if (_wcsicmp(elementTagName.get(), OLE2CW(tagName.bstrVal)) == 0) - { - CComQIPtr pHtmlElement; - HRESULT hr = FindOrCreateIEElement(childNode, &pHtmlElement); - if (FAILED(hr)) - return hr; - //Add to collection : - pCollection->AddNode(pHtmlElement); - } - } - } - pCollection->QueryInterface(IID_IDispatch, (void**)pdisp); - return S_OK; - } - return E_UNEXPECTED; -} - diff --git a/embedding/browser/activex/src/common/IEHtmlElementCollection.h b/embedding/browser/activex/src/common/IEHtmlElementCollection.h deleted file mode 100644 index 999ea41ba26..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlElementCollection.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLNODECOLLECTION_H -#define IEHTMLNODECOLLECTION_H - -#include "nsIDOMHTMLCollection.h" -#include "nsIDOMNodeList.h" - -#include "IEHtmlNode.h" - -class CIEHtmlElement; - -class CIEHtmlElementCollection : - public CNode, - public IDispatchImpl -{ -private: - // Hold a DOM node list - nsCOMPtr mDOMNodeList; - // Or hold a static collection - IDispatch **mNodeList; - PRUint32 mNodeListCount; - PRUint32 mNodeListCapacity; - -public: - CIEHtmlElementCollection(); - -protected: - virtual ~CIEHtmlElementCollection(); - virtual HRESULT FindOrCreateIEElement(nsIDOMNode* domNode, IHTMLElement** pIHtmlElement); - -public: - // Adds a node to the collection - virtual HRESULT AddNode(IDispatch *pNode); - - virtual HRESULT PopulateFromDOMHTMLCollection(nsIDOMHTMLCollection *pNodeList); - - // Populates the collection with items from the DOM node - virtual HRESULT PopulateFromDOMNode(nsIDOMNode *pIDOMNode, BOOL bRecurseChildren); - - // Helper method creates a collection from a parent node - static HRESULT CreateFromParentNode(CNode *pParentNode, BOOL bRecurseChildren, CIEHtmlElementCollection **pInstance); - - // Helper method creates a collection from the specified HTML collection - static HRESULT CreateFromDOMHTMLCollection(CNode *pParentNode, nsIDOMHTMLCollection *pNodeList, CIEHtmlElementCollection **pInstance); - - -BEGIN_COM_MAP(CIEHtmlElementCollection) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLElementCollection) -END_COM_MAP() - - // IHTMLElementCollection methods - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE put_length(long v); - virtual HRESULT STDMETHODCALLTYPE get_length(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get__newEnum(IUnknown __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE item(VARIANT name, VARIANT index, IDispatch __RPC_FAR *__RPC_FAR *pdisp); - virtual HRESULT STDMETHODCALLTYPE tags(VARIANT tagName, IDispatch __RPC_FAR *__RPC_FAR *pdisp); -}; - -typedef CComObject CIEHtmlElementCollectionInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IEHtmlNode.cpp b/embedding/browser/activex/src/common/IEHtmlNode.cpp deleted file mode 100644 index 087580e01ef..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlNode.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include "IEHtmlNode.h" - -#include "plhash.h" - -static PLHashTable *g_NodeLookupTable; - -static PLHashNumber HashFunction(const void *key) -{ - return (PRUint32) key; -} - -PRIntn HashComparator(const void *v1, const void *v2) -{ - if (v1 == v2) - { - return 1; - } - return 0; -} - - -CNode::CNode() : - mParent(NULL),mDOMNode(NULL) -{ -} - -CNode::~CNode() -{ -} - - -HRESULT CNode::SetParent(CNode *pParent) -{ - mParent = pParent; - return S_OK; -} - - -HRESULT CNode::FindFromDOMNode(nsIDOMNode *pIDOMNode, CNode **pNode) -{ - if (pIDOMNode == nsnull) - { - return E_FAIL; - } - - if (g_NodeLookupTable == NULL) - { - return E_FAIL; - } - - nsCOMPtr nodeAsSupports = do_QueryInterface(pIDOMNode); - *pNode = (CNode *) PL_HashTableLookup(g_NodeLookupTable, nodeAsSupports); - - return S_OK; -} - -HRESULT CNode::SetDOMNode(nsIDOMNode *pIDOMNode) -{ - if (pIDOMNode) - { - if (g_NodeLookupTable == NULL) - { - g_NodeLookupTable = PL_NewHashTable(123, HashFunction, HashComparator, HashComparator, NULL, NULL); - } - - mDOMNode = pIDOMNode; - nsCOMPtr nodeAsSupports= do_QueryInterface(mDOMNode); - PL_HashTableAdd(g_NodeLookupTable, nodeAsSupports, this); - } - else if (mDOMNode) - { - // Remove the entry from the hashtable - nsCOMPtr nodeAsSupports = do_QueryInterface(mDOMNode); - PL_HashTableRemove(g_NodeLookupTable, nodeAsSupports); - mDOMNode = nsnull; - - if (g_NodeLookupTable->nentries == 0) - { - PL_HashTableDestroy(g_NodeLookupTable); - g_NodeLookupTable = NULL; - } - } - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// CIEHtmlDomNode methods - -#include "nsIDOMHTMLButtonElement.h" -#include "nsIDOMHTMLElement.h" - -#include "IEHtmlButtonElement.h" -#include "IEHtmlElement.h" - -CIEHtmlDomNode::CIEHtmlDomNode() -{ -} - -CIEHtmlDomNode::~CIEHtmlDomNode() -{ - SetDOMNode(nsnull); -} - -#define CREATE_FROM_DOMNODE(nsInterface, WrapperType, errorMsg) \ - nsCOMPtr domNode_##nsInterface = do_QueryInterface(pIDOMNode); \ - if (domNode_##nsInterface) \ - { \ - WrapperType *pWrapper = NULL; \ - WrapperType::CreateInstance(&pWrapper); \ - if (!pWrapper) \ - { \ - NS_ERROR(errorMsg); \ - return E_OUTOFMEMORY; \ - } \ - if (FAILED(pWrapper->QueryInterface(IID_IUnknown, (void**)pNode))) \ - return E_UNEXPECTED; \ - pWrapper->SetDOMNode(pIDOMNode); \ - return S_OK; \ - } - - -HRESULT CIEHtmlDomNode::CreateFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode) -{ - CREATE_FROM_DOMNODE(nsIDOMHTMLButtonElement, CIEHtmlButtonElementInstance, "") - CREATE_FROM_DOMNODE(nsIDOMHTMLElement, CIEHtmlElementInstance, "Could not create element") - CREATE_FROM_DOMNODE(nsIDOMNode, CIEHtmlDomNodeInstance, "Could not create node") - return E_FAIL; -} - -HRESULT CIEHtmlDomNode::FindFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode) -{ - if (pIDOMNode == nsnull) - { - return E_FAIL; - } - - if (g_NodeLookupTable == NULL) - { - return E_FAIL; - } - - nsCOMPtr nodeAsSupports = do_QueryInterface(pIDOMNode); - *pNode = (IUnknown *) PL_HashTableLookup(g_NodeLookupTable, nodeAsSupports); - - return S_OK; -} - -HRESULT CIEHtmlDomNode::FindOrCreateFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode) -{ - FindFromDOMNode(pIDOMNode,pNode); - - if (*pNode) - { - (*pNode)->AddRef(); - return S_OK; - } - - HRESULT hr = CreateFromDOMNode(pIDOMNode, pNode); - if SUCCEEDED(hr) - return S_OK; - return hr; -} - -HRESULT CIEHtmlDomNode::SetDOMNode(nsIDOMNode *pIDOMNode) -{ - if (pIDOMNode) - { - if (g_NodeLookupTable == NULL) - { - g_NodeLookupTable = PL_NewHashTable(123, HashFunction, HashComparator, HashComparator, NULL, NULL); - } - - mDOMNode = pIDOMNode; - nsCOMPtr nodeAsSupports= do_QueryInterface(mDOMNode); - PL_HashTableAdd(g_NodeLookupTable, nodeAsSupports, (IUnknown *)this ); - } - else if (mDOMNode) - { - // Remove the entry from the hashtable - nsCOMPtr nodeAsSupports = do_QueryInterface(mDOMNode); - PL_HashTableRemove(g_NodeLookupTable, nodeAsSupports); - mDOMNode = nsnull; - - if (g_NodeLookupTable->nentries == 0) - { - PL_HashTableDestroy(g_NodeLookupTable); - g_NodeLookupTable = NULL; - } - } - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLDOMNode methods - -#define SIB_NODE_GET_NUMERIC(function,numtype) \ -{ \ - if (!p) return E_INVALIDARG; \ - if (!mDOMNode) return E_UNEXPECTED; \ - numtype nData; \ - HRESULT rc = mDOMNode->function(&nData); \ - *p=nData; \ - return rc; \ -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeType(long __RPC_FAR *p) - SIB_NODE_GET_NUMERIC(GetNodeType,PRUint16) - -#define SIB_NODE_GET_ELEMENT(function,fn_elt_type) \ -{ \ - return E_NOTIMPL; \ -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_parentNode(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p) - SIB_NODE_GET_ELEMENT(GetParentNode,nsIDOMNode) - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::hasChildNodes(VARIANT_BOOL __RPC_FAR *p) - SIB_NODE_GET_NUMERIC(HasChildNodes,PRBool) - -#define SIB_STD_NOTIMPL \ -{ \ - return E_NOTIMPL; \ -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_childNodes(IDispatch __RPC_FAR *__RPC_FAR *p) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_attributes(IDispatch __RPC_FAR *__RPC_FAR *p) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::insertBefore(IHTMLDOMNode __RPC_FAR *newChild, - VARIANT refChild, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *node) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeChild( - IHTMLDOMNode __RPC_FAR *oldChild, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *node) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceChild( - IHTMLDOMNode __RPC_FAR *newChild, - IHTMLDOMNode __RPC_FAR *oldChild, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *node) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::cloneNode( - VARIANT_BOOL fDeep, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *clonedNode) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeNode( - VARIANT_BOOL fDeep, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *removed) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::swapNode( - IHTMLDOMNode __RPC_FAR *otherNode, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *swappedNode) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceNode( - IHTMLDOMNode __RPC_FAR *replacement, - IHTMLDOMNode __RPC_FAR *__RPC_FAR *replaced) - SIB_STD_NOTIMPL - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::appendChild(IHTMLDOMNode *newChild, IHTMLDOMNode **node) -{ - if (!newChild || !node) - return E_INVALIDARG; - *node = NULL; - if (!mDOMNode) - return E_UNEXPECTED; - nsCOMPtr domNode; - nsresult rv = mDOMNode->AppendChild(((CIEHtmlDomNode*)newChild)->mDOMNode, getter_AddRefs(domNode)); - if (NS_FAILED(rv)) - return E_FAIL; - // Create com object: - CComPtr pNode = NULL; - HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(domNode, &pNode); - if (FAILED(hr)) - return hr; - if (FAILED(pNode->QueryInterface(__uuidof(IHTMLDOMNode), (void**)node))) - return E_UNEXPECTED; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeName(BSTR __RPC_FAR *p) -{ - if (!mDOMNode) return E_UNEXPECTED; - nsString szTagName; - HRESULT rc = mDOMNode->GetNodeName(szTagName); - USES_CONVERSION; - *p = SysAllocString(W2COLE(ToNewUnicode(szTagName))); - return rc; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::put_nodeValue(VARIANT p) -{ - if (!mDOMNode) return E_UNEXPECTED; - CComVariant vValue; - if (FAILED(vValue.ChangeType(VT_BSTR, &p))) { - return E_INVALIDARG; - } - nsString szValue(OLE2W(vValue.bstrVal)); - if (!mDOMNode->SetNodeValue(szValue)) - return E_FAIL; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeValue(VARIANT __RPC_FAR *p) -{ - if (p == NULL) { - return E_INVALIDARG; - } - if (!mDOMNode) return E_UNEXPECTED; - nsString szValue; - nsresult nr = mDOMNode->GetNodeValue(szValue); - if (nr == NS_OK) { - USES_CONVERSION; - p->vt = VT_BSTR; - p->bstrVal = SysAllocString(W2COLE(ToNewUnicode(szValue))); - return S_OK; - } - return E_FAIL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_firstChild(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p) - SIB_NODE_GET_ELEMENT(GetFirstChild,nsIDOMNode) - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_lastChild(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p) - SIB_NODE_GET_ELEMENT(GetLastChild,nsIDOMNode) - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_previousSibling(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nextSibling(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} diff --git a/embedding/browser/activex/src/common/IEHtmlNode.h b/embedding/browser/activex/src/common/IEHtmlNode.h deleted file mode 100644 index 827be1b8841..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlNode.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLNODE_H -#define IEHTMLNODE_H - - -#include "nsCOMPtr.h" -#include "nsIDOMNode.h" - -// NOTE: Nasty hack in case arcane SDK doesn't define IHTMLDOMNode -#ifndef __IHTMLDOMNode_INTERFACE_DEFINED__ -#define __IHTMLDOMNode_INTERFACE_DEFINED__ - MIDL_INTERFACE("3050f5da-98b5-11cf-bb82-00aa00bdce0b") - IHTMLDOMNode : public IDispatch - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeType( - /* [out][retval] */ long *p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( - /* [out][retval] */ IHTMLDOMNode **p) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE hasChildNodes( - /* [out][retval] */ VARIANT_BOOL *fChildren) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_childNodes( - /* [out][retval] */ IDispatch **p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( - /* [out][retval] */ IDispatch **p) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE insertBefore( - /* [in] */ IHTMLDOMNode *newChild, - /* [in][optional] */ VARIANT refChild, - /* [out][retval] */ IHTMLDOMNode **node) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE removeChild( - /* [in] */ IHTMLDOMNode *oldChild, - /* [out][retval] */ IHTMLDOMNode **node) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE replaceChild( - /* [in] */ IHTMLDOMNode *newChild, - /* [in] */ IHTMLDOMNode *oldChild, - /* [out][retval] */ IHTMLDOMNode **node) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE cloneNode( - /* [in] */ VARIANT_BOOL fDeep, - /* [out][retval] */ IHTMLDOMNode **clonedNode) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE removeNode( - /* [in][defaultvalue] */ VARIANT_BOOL fDeep, - /* [out][retval] */ IHTMLDOMNode **removed) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE swapNode( - /* [in] */ IHTMLDOMNode *otherNode, - /* [out][retval] */ IHTMLDOMNode **swappedNode) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE replaceNode( - /* [in] */ IHTMLDOMNode *replacement, - /* [out][retval] */ IHTMLDOMNode **replaced) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE appendChild( - /* [in] */ IHTMLDOMNode *newChild, - /* [out][retval] */ IHTMLDOMNode **node) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeName( - /* [out][retval] */ BSTR *p) = 0; - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_nodeValue( - /* [in] */ VARIANT v) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeValue( - /* [out][retval] */ VARIANT *p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( - /* [out][retval] */ IHTMLDOMNode **p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( - /* [out][retval] */ IHTMLDOMNode **p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( - /* [out][retval] */ IHTMLDOMNode **p) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( - /* [out][retval] */ IHTMLDOMNode **p) = 0; - - }; -#endif - -class CNode : - public CComObjectRootEx -{ -protected: - CNode(); - virtual ~CNode(); - -public: - CNode *mParent; - nsCOMPtr mDOMNode; - - static HRESULT FindFromDOMNode(nsIDOMNode *pIDOMNode, CNode **pNode); - virtual HRESULT SetParent(CNode *pParent); - virtual HRESULT SetDOMNode(nsIDOMNode *pIDOMNode); -}; - -class CIEHtmlDomNode : - public CNode, - public IDispatchImpl -{ -public: - DECLARE_AGGREGATABLE(CIEHtmlDomNode) - CIEHtmlDomNode(); - - static HRESULT FindFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode); - static HRESULT FindOrCreateFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode); - static HRESULT CreateFromDOMNode(nsIDOMNode *pIDOMNode, IUnknown **pNode); - virtual HRESULT SetDOMNode(nsIDOMNode *pIDOMNode); - - DECLARE_GET_CONTROLLING_UNKNOWN() -protected: - virtual ~CIEHtmlDomNode(); - -public: - -BEGIN_COM_MAP(CIEHtmlDomNode) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLDOMNode) - //COM_INTERFACE_ENTRY_FUNC(IID_IHTMLElement, 0, QueryInterfaceOnNode) -END_COM_MAP() - - static HRESULT WINAPI QueryInterfaceOnNode(void* pv, REFIID riid, LPVOID* ppv, DWORD dw); - - //IID_IHTMLDOMNode - virtual HRESULT STDMETHODCALLTYPE get_nodeType(long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_parentNode(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE hasChildNodes(VARIANT_BOOL __RPC_FAR *fChildren); - virtual HRESULT STDMETHODCALLTYPE get_childNodes(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_attributes(IDispatch __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE insertBefore(IHTMLDOMNode __RPC_FAR *newChild, VARIANT refChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node); - virtual HRESULT STDMETHODCALLTYPE removeChild(IHTMLDOMNode __RPC_FAR *oldChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node); - virtual HRESULT STDMETHODCALLTYPE replaceChild(IHTMLDOMNode __RPC_FAR *newChild, IHTMLDOMNode __RPC_FAR *oldChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node); - virtual HRESULT STDMETHODCALLTYPE cloneNode(VARIANT_BOOL fDeep, IHTMLDOMNode __RPC_FAR *__RPC_FAR *clonedNode); - virtual HRESULT STDMETHODCALLTYPE removeNode(VARIANT_BOOL fDeep, IHTMLDOMNode __RPC_FAR *__RPC_FAR *removed); - virtual HRESULT STDMETHODCALLTYPE swapNode(IHTMLDOMNode __RPC_FAR *otherNode, IHTMLDOMNode __RPC_FAR *__RPC_FAR *swappedNode); - virtual HRESULT STDMETHODCALLTYPE replaceNode(IHTMLDOMNode __RPC_FAR *replacement, IHTMLDOMNode __RPC_FAR *__RPC_FAR *replaced); - virtual HRESULT STDMETHODCALLTYPE appendChild(IHTMLDOMNode __RPC_FAR *newChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node); - virtual HRESULT STDMETHODCALLTYPE get_nodeName(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_nodeValue(VARIANT p); - virtual HRESULT STDMETHODCALLTYPE get_nodeValue(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_firstChild(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_lastChild(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_previousSibling(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_nextSibling(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p); -}; - -typedef CComObject CIEHtmlDomNodeInstance; - -#endif diff --git a/embedding/browser/activex/src/common/IEHtmlSelectionObject.cpp b/embedding/browser/activex/src/common/IEHtmlSelectionObject.cpp deleted file mode 100644 index 4ee2a45a24c..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlSelectionObject.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include "IEHtmlSelectionObject.h" -#include "IEHtmlTxtRange.h" - -CIEHtmlSelectionObject::CIEHtmlSelectionObject() -{ -} - -CIEHtmlSelectionObject::~CIEHtmlSelectionObject() -{ -} - -void CIEHtmlSelectionObject::SetSelection(nsISelection *pSelection) -{ - mSelection = pSelection; -} - -void CIEHtmlSelectionObject::SetDOMDocumentRange(nsIDOMDocumentRange *pDOMDocumentRange) { - mDOMDocumentRange = pDOMDocumentRange; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlSelectionObject::createRange(IDispatch __RPC_FAR *__RPC_FAR *range) -{ - if (range == NULL) - return E_INVALIDARG; - *range = NULL; - if (!mSelection) - return E_FAIL; - // get range corresponding to mSelection: - nsCOMPtr domRange; - int rc; - mSelection->GetRangeCount(&rc); - if (rc>0) - mSelection->GetRangeAt(0, getter_AddRefs(domRange)); - else - { - // create empty range - mDOMDocumentRange->CreateRange(getter_AddRefs(domRange)); - } - if (!domRange) - return E_FAIL; - // create com object: - CComBSTR strType; - get_type(&strType); - if (wcscmp(OLE2W(strType), L"Control") == 0) - { - // IHTMLControlRange: - CIEHtmlControlRangeInstance *pControlRange = NULL; - CIEHtmlControlRangeInstance::CreateInstance(&pControlRange); - if (!pControlRange) - return E_FAIL; - // gives the range to the com object: - pControlRange->SetRange(domRange); - // return com object: - pControlRange->QueryInterface(IID_IDispatch, (void **)range); - } else - { - // IHTMLTxtRange: - CIEHtmlTxtRangeInstance *pTxtRange = NULL; - CIEHtmlTxtRangeInstance::CreateInstance(&pTxtRange); - if (!pTxtRange) - return E_FAIL; - // gives the range to the com object: - pTxtRange->SetRange(domRange); - // return com object: - pTxtRange->QueryInterface(IID_IDispatch, (void **)range); - } - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlSelectionObject::get_type(BSTR __RPC_FAR *p) -{ - static NS_NAMED_LITERAL_STRING(strText,"Text"); - static NS_NAMED_LITERAL_STRING(strControl,"Control"); - static NS_NAMED_LITERAL_STRING(strNone,"None"); - nsCOMPtr domRange; - nsCOMPtr domNode; - - if (p == NULL) - return E_INVALIDARG; - *p = NULL; - - // get range corresponding to mSelection: - int rc; - mSelection->GetRangeCount(&rc); - if (rc<1) { - *p = SysAllocString(strNone.get()); - return p ? S_OK : E_OUTOFMEMORY; - } - mSelection->GetRangeAt(0, getter_AddRefs(domRange)); - if (!domRange) - return E_FAIL; - domRange->GetStartContainer(getter_AddRefs(domNode)); - if (!domNode) - return E_FAIL; - unsigned short nodeType; - domNode->GetNodeType(&nodeType); - switch (nodeType) - { - case nsIDOMNode::ELEMENT_NODE: - *p = SysAllocString(strControl.get()); - break; - case nsIDOMNode::TEXT_NODE: - *p = SysAllocString(strText.get()); - break; - default: - return E_UNEXPECTED; - } - return p ? S_OK : E_OUTOFMEMORY; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlSelectionObject::empty() -{ - if (!mSelection) - return E_FAIL; - mSelection->RemoveAllRanges(); - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlSelectionObject::clear() -{ - if (!mSelection) - return E_FAIL; - mSelection->DeleteFromDocument(); - return S_OK; -} - diff --git a/embedding/browser/activex/src/common/IEHtmlSelectionObject.h b/embedding/browser/activex/src/common/IEHtmlSelectionObject.h deleted file mode 100644 index af8984f910e..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlSelectionObject.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLSELECTIONOBJECT_H -#define IEHTMLSELECTIONOBJECT_H - -#include "nsISelection.h" -#include "nsIDOMDocumentRange.h" - -class CIEHtmlSelectionObject : - public IDispatchImpl, - public CComObjectRootEx -{ -public: - CIEHtmlSelectionObject(); - -protected: - virtual ~CIEHtmlSelectionObject(); - -public: - void SetSelection(nsISelection *pSelection); - void SetDOMDocumentRange(nsIDOMDocumentRange *pDOMDocumentRange); - -BEGIN_COM_MAP(CIEHtmlSelectionObject) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLSelectionObject) - COM_INTERFACE_ENTRY(IHTMLSelectionObject) -END_COM_MAP() - - - // Implementation of IHTMLSelectionObject - virtual HRESULT STDMETHODCALLTYPE createRange(IDispatch __RPC_FAR *__RPC_FAR *range); - virtual HRESULT STDMETHODCALLTYPE empty(); - virtual HRESULT STDMETHODCALLTYPE clear(); - virtual HRESULT STDMETHODCALLTYPE get_type(BSTR __RPC_FAR *p); - -protected: - nsCOMPtr mSelection; - // IE does not return null range when selection is empty - // so this reference allows for creating an empty range : - nsCOMPtr mDOMDocumentRange; -}; - -#define CIEHTMLSELECTIONOBJECT_INTERFACES \ - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLSelectionObject \ - COM_INTERFACE_ENTRY_IID(IID_IHTMLSelectionObject, IHTMLSelectionObject) - -typedef CComObject CIEHtmlSelectionObjectInstance; - -#endif //IEHTMLSELECTIONOBJECT_H \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IEHtmlTxtRange.cpp b/embedding/browser/activex/src/common/IEHtmlTxtRange.cpp deleted file mode 100644 index 0ff7e5665d5..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlTxtRange.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include "IEHtmlTxtRange.h" -#include "IEHtmlNode.h" -#include "IEHtmlElement.h" - -#include "nsIDomNsRange.h" -#include "nsIDOMDocumentFragment.h" - -CRange::CRange() -{ -} - -CRange::~CRange() -{ -} - -void CRange::SetRange(nsIDOMRange *pRange) -{ - mRange = pRange; -} - -HRESULT CRange::GetParentElement(IHTMLElement **ppParent) -{ - if (ppParent == NULL) - return E_INVALIDARG; - *ppParent = NULL; - // get common ancestor property: - nsCOMPtr domNode; - mRange->GetCommonAncestorContainer(getter_AddRefs(domNode)); - if (!domNode) - return S_OK; - nsCOMPtr domElement = do_QueryInterface(domNode); - if (!domElement) - { - // domNode can be a nsITextNode. In this case, its parent is a nsIDOMElement: - nsCOMPtr parentNode; - domNode->GetParentNode(getter_AddRefs(parentNode)); - domElement = do_QueryInterface(parentNode); - // Is a textrange always supposed to have a parentElement? Remove 2 lines if not: - if (!domElement) - return E_UNEXPECTED; - domNode = parentNode; - } - // get or create com object: - CComPtr pNode; - HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(domNode, &pNode); - if (FAILED(hr)) - return hr; - if (FAILED(pNode->QueryInterface(IID_IHTMLElement, (void **)ppParent))) - return E_UNEXPECTED; - - return S_OK; -} - -// CIEHtmlTxtRange - -CIEHtmlTxtRange::CIEHtmlTxtRange() -{ -} - -CIEHtmlTxtRange::~CIEHtmlTxtRange() -{ -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::pasteHTML(BSTR html) -{ - nsCOMPtr domDocFragment; - nsAutoString nsStrHtml(OLE2W(html)); - - if (NS_FAILED(mRange->DeleteContents())) - return E_FAIL; - nsCOMPtr domNSRange = do_QueryInterface(mRange); - if (!domNSRange) - return E_FAIL; - domNSRange->CreateContextualFragment(nsStrHtml, getter_AddRefs(domDocFragment)); - if (!domDocFragment) - return E_FAIL; - mRange->InsertNode(domDocFragment); - mRange->Detach(); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::get_text(BSTR __RPC_FAR *p) -{ - if (p == NULL) - return E_INVALIDARG; - *p = NULL; - - nsAutoString strText; - mRange->ToString(strText); - - *p = SysAllocString(strText.get()); - return *p ? S_OK : E_OUTOFMEMORY; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *Parent) -{ - return GetParentElement(Parent); -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::get_htmlText(BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::put_text(BSTR v) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::duplicate(IHTMLTxtRange __RPC_FAR *__RPC_FAR *Duplicate) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::inRange(IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *InRange) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::isEqual(IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *IsEqual) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::scrollIntoView(VARIANT_BOOL fStart/* = -1*/) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::collapse(VARIANT_BOOL Start/* = -1*/) -{ - nsresult rv = mRange->Collapse(Start?PR_TRUE:PR_FALSE); - return FAILED(rv)?E_FAIL:S_OK; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::expand(BSTR Unit,VARIANT_BOOL __RPC_FAR *Success) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::move(BSTR Unit, long Count, long __RPC_FAR *ActualCount) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveStart(BSTR Unit, long Count, long __RPC_FAR *ActualCount) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveEnd(BSTR Unit, long Count, long __RPC_FAR *ActualCount) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::select( void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToElementText(IHTMLElement __RPC_FAR *element) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::setEndPoint(BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::compareEndPoints(BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange, long __RPC_FAR *ret) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::findText(BSTR String, long count, long Flags, VARIANT_BOOL __RPC_FAR *Success) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToPoint(long x, long y) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::getBookmark(BSTR __RPC_FAR *Boolmark) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToBookmark(BSTR Bookmark, VARIANT_BOOL __RPC_FAR *Success) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -// IHTMLControlRange - -CIEHtmlControlRange::CIEHtmlControlRange() -{ -} - -CIEHtmlControlRange::~CIEHtmlControlRange() -{ -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::commonParentElement(IHTMLElement __RPC_FAR *__RPC_FAR *parent) -{ - return GetParentElement(parent); -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::select( void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::add(IHTMLControlElement __RPC_FAR *item) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::remove(long index) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::item(long index, IHTMLElement __RPC_FAR *__RPC_FAR *pdisp) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::scrollIntoView(VARIANT varargStart) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CIEHtmlControlRange::get_length(long __RPC_FAR *p) -{ - return E_NOTIMPL; -} - diff --git a/embedding/browser/activex/src/common/IEHtmlTxtRange.h b/embedding/browser/activex/src/common/IEHtmlTxtRange.h deleted file mode 100644 index 09cc522b29f..00000000000 --- a/embedding/browser/activex/src/common/IEHtmlTxtRange.h +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexandre Trémon - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLTXTRANGE_H -#define IEHTMLTXTRANGE_H - -#include "nsIDOMRange.h" - -class CRange : - public CComObjectRootEx -{ -public: - CRange(); - -protected: - virtual ~CRange(); - -public: - void SetRange(nsIDOMRange *pRange); - - virtual HRESULT GetParentElement(IHTMLElement **ppParent); - -protected: - nsCOMPtr mRange; -}; - -class CIEHtmlTxtRange : - public CRange, - public IDispatchImpl -{ -public: - CIEHtmlTxtRange(); - -protected: - virtual ~CIEHtmlTxtRange(); - -public: - -BEGIN_COM_MAP(CIEHtmlTxtRange) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLTxtRange) -END_COM_MAP() - - - // Implementation of IHTMLTxtRange - virtual HRESULT STDMETHODCALLTYPE pasteHTML(BSTR html); - virtual HRESULT STDMETHODCALLTYPE get_text(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE parentElement(IHTMLElement __RPC_FAR *__RPC_FAR *Parent); - // Not yet implemented - virtual HRESULT STDMETHODCALLTYPE get_htmlText(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_text(BSTR v); - virtual HRESULT STDMETHODCALLTYPE duplicate(IHTMLTxtRange __RPC_FAR *__RPC_FAR *Duplicate); - virtual HRESULT STDMETHODCALLTYPE inRange(IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *InRange); - virtual HRESULT STDMETHODCALLTYPE isEqual(IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *IsEqual); - virtual HRESULT STDMETHODCALLTYPE scrollIntoView(VARIANT_BOOL fStart = -1); - virtual HRESULT STDMETHODCALLTYPE collapse(VARIANT_BOOL Start = -1); - virtual HRESULT STDMETHODCALLTYPE expand(BSTR Unit,VARIANT_BOOL __RPC_FAR *Success); - virtual HRESULT STDMETHODCALLTYPE move(BSTR Unit, long Count, long __RPC_FAR *ActualCount); - virtual HRESULT STDMETHODCALLTYPE moveStart(BSTR Unit, long Count, long __RPC_FAR *ActualCount); - virtual HRESULT STDMETHODCALLTYPE moveEnd(BSTR Unit, long Count, long __RPC_FAR *ActualCount); - virtual HRESULT STDMETHODCALLTYPE select( void); - virtual HRESULT STDMETHODCALLTYPE moveToElementText(IHTMLElement __RPC_FAR *element); - virtual HRESULT STDMETHODCALLTYPE setEndPoint(BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange); - virtual HRESULT STDMETHODCALLTYPE compareEndPoints(BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange, long __RPC_FAR *ret); - virtual HRESULT STDMETHODCALLTYPE findText(BSTR String, long count, long Flags, VARIANT_BOOL __RPC_FAR *Success); - virtual HRESULT STDMETHODCALLTYPE moveToPoint(long x, long y); - virtual HRESULT STDMETHODCALLTYPE getBookmark(BSTR __RPC_FAR *Boolmark); - virtual HRESULT STDMETHODCALLTYPE moveToBookmark(BSTR Bookmark, VARIANT_BOOL __RPC_FAR *Success); - virtual HRESULT STDMETHODCALLTYPE queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText); - virtual HRESULT STDMETHODCALLTYPE queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue); - virtual HRESULT STDMETHODCALLTYPE execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); -}; - -#define CIEHTMLTXTRANGE_INTERFACES \ - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLTxtRange \ - COM_INTERFACE_ENTRY_IID(IID_IHTMLTxtRange, IHTMLTxtRange) - -typedef CComObject CIEHtmlTxtRangeInstance; - -class CIEHtmlControlRange : - public CRange, - public IDispatchImpl -{ -public: - CIEHtmlControlRange(); - -protected: - virtual ~CIEHtmlControlRange(); - -public: - -BEGIN_COM_MAP(CIEHtmlControlRange) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLControlRange) -END_COM_MAP() - - // Implementation of IHTMLControlRange - virtual HRESULT STDMETHODCALLTYPE commonParentElement(IHTMLElement __RPC_FAR *__RPC_FAR *parent); - // Not yet implemented - virtual HRESULT STDMETHODCALLTYPE select( void); - virtual HRESULT STDMETHODCALLTYPE add(IHTMLControlElement __RPC_FAR *item); - virtual HRESULT STDMETHODCALLTYPE remove(long index); - virtual HRESULT STDMETHODCALLTYPE item(long index, IHTMLElement __RPC_FAR *__RPC_FAR *pdisp); - virtual HRESULT STDMETHODCALLTYPE scrollIntoView(VARIANT varargStart); - virtual HRESULT STDMETHODCALLTYPE queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText); - virtual HRESULT STDMETHODCALLTYPE queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue); - virtual HRESULT STDMETHODCALLTYPE execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE get_length(long __RPC_FAR *p); -}; - -typedef CComObject CIEHtmlControlRangeInstance; - -#endif //IEHTMLTXTRANGE_H \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IHTMLLocationImpl.h b/embedding/browser/activex/src/common/IHTMLLocationImpl.h deleted file mode 100644 index 741dfc6613a..00000000000 --- a/embedding/browser/activex/src/common/IHTMLLocationImpl.h +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef IHTMLLOCATIONIMPL_H -#define IHTMLLOCATIONIMPL_H - -#include "nsIDOMLocation.h" - -#define IHTMLLOCATION_GET_IMPL(prop) \ - if (!p) return E_INVALIDARG; \ - nsCOMPtr location; \ - if (NS_FAILED(GetDOMLocation(getter_AddRefs(location))) || !location) \ - return E_UNEXPECTED; \ - nsAutoString value; \ - NS_ENSURE_SUCCESS(location->Get ## prop(value), E_UNEXPECTED); \ - *p = ::SysAllocString(value.get()); \ - return (*p) ? S_OK : E_OUTOFMEMORY; - -#define IHTMLLOCATION_PUT_IMPL(prop) \ - return E_NOTIMPL; // For now - -template -class IHTMLLocationImpl : - public IDispatchImpl -{ -protected: -// Methods to be implemented by the derived class - virtual nsresult GetDOMLocation(nsIDOMLocation **aLocation) = 0; -public: - -// IHTMLLocation - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_href( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Href); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_href( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Href); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_protocol( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Protocol); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_protocol( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Protocol); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_host( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Host); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_host( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Host); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_hostname( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Hostname); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_hostname( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Hostname); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_port( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Port); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_port( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Port); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_pathname( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Pathname); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_pathname( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Pathname); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_search( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Search); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_search( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Search); - } - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_hash( - /* [in] */ BSTR v) - { - IHTMLLOCATION_PUT_IMPL(Hash); - } - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_hash( - /* [out][retval] */ BSTR *p) - { - IHTMLLOCATION_GET_IMPL(Hash); - } - virtual /* [id] */ HRESULT STDMETHODCALLTYPE reload( - /* [in][defaultvalue] */ VARIANT_BOOL flag) - { - nsCOMPtr location; - if (NS_FAILED(GetDOMLocation(getter_AddRefs(location))) || !location) - return E_UNEXPECTED; - return NS_SUCCEEDED(location->Reload(flag)) ? S_OK : E_FAIL; - } - virtual /* [id] */ HRESULT STDMETHODCALLTYPE replace( - /* [in] */ BSTR bstr) - { - nsCOMPtr location; - if (NS_FAILED(GetDOMLocation(getter_AddRefs(location))) || !location) - return E_UNEXPECTED; - nsAutoString value(bstr); - return NS_SUCCEEDED(location->Replace(value)) ? S_OK : E_FAIL; - } - virtual /* [id] */ HRESULT STDMETHODCALLTYPE assign( - /* [in] */ BSTR bstr) - { - nsCOMPtr location; - if (NS_FAILED(GetDOMLocation(getter_AddRefs(location))) || !location) - return E_UNEXPECTED; - nsAutoString value(bstr); - return NS_SUCCEEDED(location->Assign(value)) ? S_OK : E_FAIL; - } - virtual /* [id] */ HRESULT STDMETHODCALLTYPE toString( - /* [out][retval] */ BSTR *string) - { - if (!string) return E_INVALIDARG; - nsCOMPtr location; - if (NS_FAILED(GetDOMLocation(getter_AddRefs(location))) || !location) - return E_UNEXPECTED; - nsAutoString value; - NS_ENSURE_SUCCESS(location->ToString(value), E_UNEXPECTED); - *string = ::SysAllocString(value.get()); - return (*string) ? S_OK : E_OUTOFMEMORY; - } -}; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IOleCommandTargetImpl.h b/embedding/browser/activex/src/common/IOleCommandTargetImpl.h deleted file mode 100644 index f712572d0e9..00000000000 --- a/embedding/browser/activex/src/common/IOleCommandTargetImpl.h +++ /dev/null @@ -1,288 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IOLECOMMANDIMPL_H -#define IOLECOMMANDIMPL_H - -// Implementation of the IOleCommandTarget interface. The template is -// reasonably generic and reusable which is a good thing given how needlessly -// complicated this interface is. Blame Microsoft for that and not me. -// -// To use this class, derive your class from it like this: -// -// class CComMyClass : public IOleCommandTargetImpl -// { -// ... Ensure IOleCommandTarget is listed in the interface map ... -// BEGIN_COM_MAP(CComMyClass) -// COM_INTERFACE_ENTRY(IOleCommandTarget) -// // etc. -// END_COM_MAP() -// ... And then later on define the command target table ... -// BEGIN_OLECOMMAND_TABLE() -// OLECOMMAND_MESSAGE(OLECMDID_PRINT, NULL, ID_PRINT, L"Print", L"Print the page") -// OLECOMMAND_MESSAGE(OLECMDID_SAVEAS, NULL, 0, L"SaveAs", L"Save the page") -// OLECOMMAND_HANDLER(IDM_EDITMODE, &CGID_MSHTML, EditModeHandler, L"EditMode", L"Switch to edit mode") -// END_OLECOMMAND_TABLE() -// ... Now the window that OLECOMMAND_MESSAGE sends WM_COMMANDs to ... -// HWND GetCommandTargetWindow() const -// { -// return m_hWnd; -// } -// ... Now procedures that OLECOMMAND_HANDLER calls ... -// static HRESULT _stdcall EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); -// } -// -// The command table defines which commands the object supports. Commands are -// defined by a command id and a command group plus a WM_COMMAND id or procedure, -// and a verb and short description. -// -// Notice that there are two macros for handling Ole Commands. The first, -// OLECOMMAND_MESSAGE sends a WM_COMMAND message to the window returned from -// GetCommandTargetWindow() (that the derived class must implement if it uses -// this macro). -// -// The second, OLECOMMAND_HANDLER calls a static handler procedure that -// conforms to the OleCommandProc typedef. The first parameter, pThis means -// the static handler has access to the methods and variables in the class -// instance. -// -// The OLECOMMAND_HANDLER macro is generally more useful when a command -// takes parameters or needs to return a result to the caller. -// -template< class T > -class IOleCommandTargetImpl : public IOleCommandTarget -{ - struct OleExecData - { - const GUID *pguidCmdGroup; - DWORD nCmdID; - DWORD nCmdexecopt; - VARIANT *pvaIn; - VARIANT *pvaOut; - }; - -public: - typedef HRESULT (_stdcall *OleCommandProc)(T *pT, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - - struct OleCommandInfo - { - ULONG nCmdID; - const GUID *pCmdGUID; - ULONG nWindowsCmdID; - OleCommandProc pfnCommandProc; - wchar_t *szVerbText; - wchar_t *szStatusText; - }; - - // Query the status of the specified commands (test if is it supported etc.) - virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText) - { - T* pT = static_cast(this); - - if (prgCmds == NULL) - { - return E_INVALIDARG; - } - - OleCommandInfo *pCommands = pT->GetCommandTable(); - ATLASSERT(pCommands); - - BOOL bCmdGroupFound = FALSE; - BOOL bTextSet = FALSE; - - // Iterate through list of commands and flag them as supported/unsupported - for (ULONG nCmd = 0; nCmd < cCmds; nCmd++) - { - // Unsupported by default - prgCmds[nCmd].cmdf = 0; - - // Search the support command list - for (int nSupported = 0; pCommands[nSupported].pCmdGUID != &GUID_NULL; nSupported++) - { - OleCommandInfo *pCI = &pCommands[nSupported]; - - if (pguidCmdGroup && pCI->pCmdGUID && memcmp(pguidCmdGroup, pCI->pCmdGUID, sizeof(GUID)) == 0) - { - continue; - } - bCmdGroupFound = TRUE; - - if (pCI->nCmdID != prgCmds[nCmd].cmdID) - { - continue; - } - - // Command is supported so flag it and possibly enable it - prgCmds[nCmd].cmdf = OLECMDF_SUPPORTED; - if (pCI->nWindowsCmdID != 0) - { - prgCmds[nCmd].cmdf |= OLECMDF_ENABLED; - } - - // Copy the status/verb text for the first supported command only - if (!bTextSet && pCmdText) - { - // See what text the caller wants - wchar_t *pszTextToCopy = NULL; - if (pCmdText->cmdtextf & OLECMDTEXTF_NAME) - { - pszTextToCopy = pCI->szVerbText; - } - else if (pCmdText->cmdtextf & OLECMDTEXTF_STATUS) - { - pszTextToCopy = pCI->szStatusText; - } - - // Copy the text - pCmdText->cwActual = 0; - memset(pCmdText->rgwz, 0, pCmdText->cwBuf * sizeof(wchar_t)); - if (pszTextToCopy) - { - // Don't exceed the provided buffer size - size_t nTextLen = wcslen(pszTextToCopy); - if (nTextLen > pCmdText->cwBuf) - { - nTextLen = pCmdText->cwBuf; - } - - wcsncpy(pCmdText->rgwz, pszTextToCopy, nTextLen); - pCmdText->cwActual = nTextLen; - } - - bTextSet = TRUE; - } - break; - } - } - - // Was the command group found? - if (!bCmdGroupFound) - { - OLECMDERR_E_UNKNOWNGROUP; - } - - return S_OK; - } - - - // Execute the specified command - virtual HRESULT STDMETHODCALLTYPE Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) - { - T* pT = static_cast(this); - BOOL bCmdGroupFound = FALSE; - - OleCommandInfo *pCommands = pT->GetCommandTable(); - ATLASSERT(pCommands); - - // Search the support command list - for (int nSupported = 0; pCommands[nSupported].pCmdGUID != &GUID_NULL; nSupported++) - { - OleCommandInfo *pCI = &pCommands[nSupported]; - - if (pguidCmdGroup && pCI->pCmdGUID && memcmp(pguidCmdGroup, pCI->pCmdGUID, sizeof(GUID)) == 0) - { - continue; - } - bCmdGroupFound = TRUE; - - if (pCI->nCmdID != nCmdID) - { - continue; - } - - // Send ourselves a WM_COMMAND windows message with the associated - // identifier and exec data - OleExecData cData; - cData.pguidCmdGroup = pguidCmdGroup; - cData.nCmdID = nCmdID; - cData.nCmdexecopt = nCmdexecopt; - cData.pvaIn = pvaIn; - cData.pvaOut = pvaOut; - - if (pCI->pfnCommandProc) - { - pCI->pfnCommandProc(pT, pCI->pCmdGUID, pCI->nCmdID, nCmdexecopt, pvaIn, pvaOut); - } - else if (pCI->nWindowsCmdID != 0 && nCmdexecopt != OLECMDEXECOPT_SHOWHELP) - { - HWND hwndTarget = pT->GetCommandTargetWindow(); - if (hwndTarget) - { - ::SendMessage(hwndTarget, WM_COMMAND, LOWORD(pCI->nWindowsCmdID), (LPARAM) &cData); - } - } - else - { - // Command supported but not implemented - continue; - } - - return S_OK; - } - - // Was the command group found? - if (!bCmdGroupFound) - { - OLECMDERR_E_UNKNOWNGROUP; - } - - return OLECMDERR_E_NOTSUPPORTED; - } -}; - -// Macros to be placed in any class derived from the IOleCommandTargetImpl -// class. These define what commands are exposed from the object. - -#define BEGIN_OLECOMMAND_TABLE() \ - OleCommandInfo *GetCommandTable() \ - { \ - static OleCommandInfo s_aSupportedCommands[] = \ - { - -#define OLECOMMAND_MESSAGE(id, group, cmd, verb, desc) \ - { id, group, cmd, NULL, verb, desc }, - -#define OLECOMMAND_HANDLER(id, group, handler, verb, desc) \ - { id, group, 0, handler, verb, desc }, - -#define END_OLECOMMAND_TABLE() \ - { 0, &GUID_NULL, 0, NULL, NULL, NULL } \ - }; \ - return s_aSupportedCommands; \ - }; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/IWebBrowserImpl.h b/embedding/browser/activex/src/common/IWebBrowserImpl.h deleted file mode 100644 index e6227bb97e2..00000000000 --- a/embedding/browser/activex/src/common/IWebBrowserImpl.h +++ /dev/null @@ -1,1189 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef IWEBBROWSERIMPL_H -#define IWEBBROWSERIMPL_H - -#include - -/* this is all kinds of awesome; SHANDLE_PTR is in some basetsd.h but not others */ -typedef long SHANDLE_PTR; - -#include "nsIWebNavigation.h" -#include "nsIPrefBranch.h" -#include "nsIPrefLocalizedString.h" -#include "nsIDOMWindow.h" -#include "nsIBaseWindow.h" -#include "nsIWindowWatcher.h" -#include "nsIInputStream.h" -#include "nsIStringStream.h" -#include "nsIURI.h" -#include "nsComponentManagerUtils.h" -#include "nsServiceManagerUtils.h" - -#include "PropertyList.h" - -// CPMozillaControl.h was autogenerated by the ATL proxy wizard so don't edit it! -#include "CPMozillaControl.h" - -#define ENSURE_BROWSER_IS_VALID() \ - if (!BrowserIsValid()) \ - { \ - NS_ERROR("Browser is not valid"); \ - return SetErrorInfo(E_UNEXPECTED, L"Browser is not in a valid state"); \ - } - -#define ENSURE_GET_WEBNAV() \ - nsCOMPtr webNav; \ - nsresult rv = GetWebNavigation(getter_AddRefs(webNav)); \ - if (NS_FAILED(rv)) \ - { \ - NS_ERROR("Cannot get nsIWebNavigation"); \ - return SetErrorInfo(E_UNEXPECTED, L"Could not obtain nsIWebNavigation interface"); \ - } - -template -class IWebBrowserImpl : - public CStockPropImpl, - public CProxyDWebBrowserEvents, - public CProxyDWebBrowserEvents2 -{ -public: - IWebBrowserImpl() - { - // Ready state of control - mBrowserReadyState = READYSTATE_UNINITIALIZED; - // Flag indicates if the browser is busy - mBusyFlag = PR_FALSE; - } - -public: -// Methods to be implemented by the derived class - // Return the nsIWebNavigation object - virtual nsresult GetWebNavigation(nsIWebNavigation **aWebNav) = 0; - // Return the nsIDOMWindow object - virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow) = 0; - // Return the nsIPrefBranch object - virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch) = 0; - // Return the valid state of the browser - virtual PRBool BrowserIsValid() = 0; - -public: -// Properties related to this interface - // Post data from last navigate operation - CComVariant mLastPostData; - // Ready status of the browser - READYSTATE mBrowserReadyState; - // Controls starts off unbusy - PRBool mBusyFlag; - // Property list - PropertyList mPropertyList; - -// Helper methods - - // - // Sets error information for VB programmers and the like who want to know why - // some method call failed. - // - virtual HRESULT SetErrorInfo(HRESULT hr, LPCOLESTR lpszDesc = NULL) - { - if (lpszDesc == NULL) - { - // Fill in a few generic descriptions - switch (hr) - { - case E_UNEXPECTED: - lpszDesc = L"Method was called while control was uninitialized"; - break; - case E_INVALIDARG: - lpszDesc = L"Method was called with an invalid parameter"; - break; - } - } - AtlSetErrorInfo(*pclsid, lpszDesc, 0, NULL, GUID_NULL, hr, NULL); - return hr; - } - - -// IWebBrowser implementation - virtual HRESULT STDMETHODCALLTYPE GoBack(void) - { - ATLTRACE(_T("IWebBrowserImpl::GoBack()\n")); - ENSURE_BROWSER_IS_VALID(); - ENSURE_GET_WEBNAV(); - - PRBool aCanGoBack = PR_FALSE; - webNav->GetCanGoBack(&aCanGoBack); - if (aCanGoBack) - { - webNav->GoBack(); - } - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE GoForward(void) - { - ATLTRACE(_T("IWebBrowserImpl::GoBack()\n")); - ENSURE_BROWSER_IS_VALID(); - ENSURE_GET_WEBNAV(); - - PRBool aCanGoForward = PR_FALSE; - webNav->GetCanGoForward(&aCanGoForward); - if (aCanGoForward) - { - webNav->GoForward(); - } - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE GoHome(void) - { - ATLTRACE(_T("IWebBrowserImpl::GoHome()\n")); - ENSURE_BROWSER_IS_VALID(); - - CComBSTR bstrUrl(L"http://home.netscape.com/"); - - // Find the home page stored in prefs - nsCOMPtr prefBranch; - if (NS_SUCCEEDED(GetPrefs(getter_AddRefs(prefBranch)))) - { - nsCOMPtr homePage; - prefBranch->GetComplexValue("browser.startup.homepage", - NS_GET_IID(nsIPrefLocalizedString), - getter_AddRefs(homePage)); - - if (homePage) - { - nsString homePageString; - nsresult rv = homePage->ToString(getter_Copies(homePageString)); - if (NS_SUCCEEDED(rv)) - { - bstrUrl = homePageString.get(); - } - } - } - - // Navigate to the home page - Navigate(bstrUrl, NULL, NULL, NULL, NULL); - - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE GoSearch(void) - { - ATLTRACE(_T("IWebBrowserImpl::GoSearch()\n")); - ENSURE_BROWSER_IS_VALID(); - - CComBSTR bstrUrl(L"http://search.netscape.com/"); - - //NOTE: This code has not been implemented yet -#if 0 - // Find the home page stored in prefs - nsCOMPtr prefBranch; - if (NS_SUCCEEDED(GetPrefs(getter_AddRefs(prefBranch)))) - { - // TODO find and navigate to the search page stored in prefs - // and not this hard coded address - } -#endif - // Navigate to the search page - Navigate(bstrUrl, NULL, NULL, NULL, NULL); - - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE Navigate(BSTR URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers) - { - ATLTRACE(_T("IWebBrowserImpl::Navigate()\n")); - ENSURE_BROWSER_IS_VALID(); - - nsresult rv; - - // Extract the URL parameter - if (URL == NULL) - { - NS_ERROR("No URL supplied"); - return SetErrorInfo(E_INVALIDARG); - } - - PRBool openInNewWindow = PR_FALSE; - PRUint32 loadFlags = nsIWebNavigation::LOAD_FLAGS_NONE; - - // Extract the navigate flags parameter - LONG lFlags = 0; - if (Flags && - Flags->vt != VT_ERROR && - Flags->vt != VT_EMPTY && - Flags->vt != VT_NULL) - { - CComVariant vFlags; - if ( vFlags.ChangeType(VT_I4, Flags) != S_OK ) - { - NS_ERROR("Flags param is invalid"); - return SetErrorInfo(E_INVALIDARG); - } - lFlags = vFlags.lVal; - } - if (lFlags & navOpenInNewWindow) - { - openInNewWindow = PR_TRUE; - } - if (lFlags & navNoHistory) - { - // Disable history - loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY; - } - if (lFlags & navNoReadFromCache) - { - // Disable read from cache - loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE; - - } - if (lFlags & navNoWriteToCache) - { - // Disable write to cache - loadFlags |= nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE; - } - - // Extract the target frame parameter - nsCOMPtr targetNav; - if (TargetFrameName && - TargetFrameName->vt == VT_BSTR && - TargetFrameName->bstrVal) - { - // Search for the named frame - nsCOMPtr window; - GetDOMWindow(getter_AddRefs(window)); - if (window) - { - nsCOMPtr windowWatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID); - if (windowWatcher) - { - nsCOMPtr targetWindow; - windowWatcher->GetWindowByName(TargetFrameName->bstrVal, window, - getter_AddRefs(targetWindow)); - if (targetWindow) - { - targetNav = do_GetInterface(targetWindow); - } - } - } - // No target nav? Open in new window - if (!targetNav) - openInNewWindow = PR_TRUE; - } - - // Open in new window - if (openInNewWindow) - { - CComQIPtr 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) - { - CComQIPtr spOther = spDispNew; - if (spOther) - { - CComVariant vURL(URL); - CComVariant vFlags(lFlags); - return spOther->Navigate2(&vURL, &vFlags, TargetFrameName, PostData, Headers); - } - } - - // NOTE: The IE control will launch an instance of iexplore.exe and - // return an interface to that if the client does not respond to - // FireNewWindow2, but the Mozilla control will not. Potentially - // it could also open an instance of IE for such occasions. - // - - // Can't open a new window without client support - return S_OK; - } - - // As documented in MSDN: - // - // The post data specified by PostData is passed as a SAFEARRAY - // structure. The variant should be of type VT_ARRAY and point to - // a SAFEARRAY. The SAFEARRAY should be of element type VT_UI1, - // dimension one, and have an element count equal to the number of - // bytes of post data. - - // Extract the post data parameter - nsCOMPtr postDataStream; - mLastPostData.Clear(); - if (PostData && - PostData->vt == (VT_ARRAY | VT_UI1) && - PostData->parray) - { - mLastPostData.Copy(PostData); - - unsigned long nSizeData = PostData->parray->rgsabound[0].cElements; - if (nSizeData > 0) - { - char szCL[64]; - sprintf(szCL, "Content-Length: %lu\r\n\r\n", nSizeData); - unsigned long nSizeCL = strlen(szCL); - unsigned long nSize = nSizeCL + nSizeData; - - char *tmp = (char *) nsMemory::Alloc(nSize + 1); // byte stream owns this mem - if (tmp) - { - - // Copy the array data into a buffer - SafeArrayLock(PostData->parray); - memcpy(tmp, szCL, nSizeCL); - memcpy(tmp + nSizeCL, PostData->parray->pvData, nSizeData); - tmp[nSize] = '\0'; - SafeArrayUnlock(PostData->parray); - - // Create a byte array input stream object. - nsCOMPtr stream - (do_CreateInstance("@mozilla.org/io/string-input-stream;1")); - rv = stream->AdoptData(tmp, nSize); - if (NS_FAILED(rv) || !stream) - { - NS_ERROR("cannot create byte stream"); - nsMemory::Free(tmp); - return SetErrorInfo(E_UNEXPECTED); - } - - postDataStream = stream; - } - } - } - - // Extract the headers parameter - nsCOMPtr headersStream; - if (Headers && - Headers->vt == VT_BSTR && - Headers->bstrVal) - { - - USES_CONVERSION; - char *headers = OLE2A(Headers->bstrVal); - if (headers) - { - size_t nSize = SysStringLen(Headers->bstrVal) + 1; - char *tmp = (char *) nsMemory::Alloc(nSize); // byteArray stream owns this mem - if (tmp) - { - // Copy BSTR to buffer - WideCharToMultiByte(CP_ACP, 0, Headers->bstrVal, nSize - 1, tmp, nSize, NULL, NULL); - tmp[nSize - 1] = '\0'; - - // Create a byte array input stream object which will own the buffer - headersStream = do_CreateInstance("@mozilla.org/io/string-input-stream;1"); - if (headersStream) - rv = headersStream->AdoptData(tmp, nSize); - - if (NS_FAILED(rv) || !headersStream) - { - NS_ERROR("cannot create byte stream"); - nsMemory::Free(tmp); - } - } - } - } - - // Use the specified target or the top level web navigation - nsCOMPtr webNavToUse; - if (targetNav) - { - webNavToUse = targetNav; - } - else - { - GetWebNavigation(getter_AddRefs(webNavToUse)); - } - - // Load the URL - rv = NS_ERROR_FAILURE; - if (webNavToUse) - { - rv = webNavToUse->LoadURI(URL, - loadFlags, nsnull, postDataStream, headersStream); - } - - return NS_SUCCEEDED(rv) ? S_OK : E_FAIL; - } - - virtual HRESULT STDMETHODCALLTYPE Refresh(void) - { - ATLTRACE(_T("IWebBrowserImpl::Refresh()\n")); - // Reload the page - CComVariant vRefreshType(REFRESH_NORMAL); - return Refresh2(&vRefreshType); - } - - virtual HRESULT STDMETHODCALLTYPE Refresh2(VARIANT __RPC_FAR *Level) - { - ATLTRACE(_T("IWebBrowserImpl::Refresh2()\n")); - - ENSURE_BROWSER_IS_VALID(); - ENSURE_GET_WEBNAV(); - if (Level == NULL) - return E_INVALIDARG; - - // Check the requested refresh type - OLECMDID_REFRESHFLAG iRefreshLevel = OLECMDIDF_REFRESH_NORMAL; - CComVariant vLevelAsInt; - if ( vLevelAsInt.ChangeType(VT_I4, Level) != S_OK ) - { - NS_ERROR("Cannot change refresh type to int"); - return SetErrorInfo(E_UNEXPECTED); - } - iRefreshLevel = (OLECMDID_REFRESHFLAG) vLevelAsInt.iVal; - - // Turn the IE refresh type into the nearest NG equivalent - PRUint32 flags = nsIWebNavigation::LOAD_FLAGS_NONE; - switch (iRefreshLevel & OLECMDIDF_REFRESH_LEVELMASK) - { - case OLECMDIDF_REFRESH_NORMAL: - case OLECMDIDF_REFRESH_IFEXPIRED: - case OLECMDIDF_REFRESH_CONTINUE: - case OLECMDIDF_REFRESH_NO_CACHE: - case OLECMDIDF_REFRESH_RELOAD: - flags = nsIWebNavigation::LOAD_FLAGS_NONE; - break; - case OLECMDIDF_REFRESH_COMPLETELY: - flags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY; - break; - default: - // No idea what refresh type this is supposed to be - NS_ERROR("Unknown refresh type"); - return SetErrorInfo(E_UNEXPECTED); - } - - webNav->Reload(flags); - - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE Stop(void) - { - ATLTRACE(_T("IWebBrowserImpl::Stop()\n")); - ENSURE_BROWSER_IS_VALID(); - ENSURE_GET_WEBNAV(); - webNav->Stop(nsIWebNavigation::STOP_ALL); - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) - { - ATLTRACE(_T("IWebBrowserImpl::get_Application()\n")); - ENSURE_BROWSER_IS_VALID(); - if (!ppDisp) - { - return SetErrorInfo(E_INVALIDARG); - } - // Return a pointer to this controls dispatch interface - *ppDisp = (IDispatch *) this; - (*ppDisp)->AddRef(); - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) - { - // TODO - return E_NOTIMPL; - } - virtual HRESULT STDMETHODCALLTYPE get_Container(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) - { - ATLTRACE(_T("IWebBrowserImpl::get_Container()\n")); - ENSURE_BROWSER_IS_VALID(); - if (!ppDisp) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Implement get_Container: Retrieve a pointer to the IDispatch interface of the container. - *ppDisp = NULL; - return SetErrorInfo(E_UNEXPECTED); - } - virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) - { - ATLTRACE(_T("IWebBrowserImpl::get_Document()\n")); - ENSURE_BROWSER_IS_VALID(); - if (!ppDisp) - { - return SetErrorInfo(E_INVALIDARG); - } - *ppDisp = NULL; - return E_NOTIMPL; - } - virtual HRESULT STDMETHODCALLTYPE get_TopLevelContainer(VARIANT_BOOL __RPC_FAR *pBool) - { - ATLTRACE(_T("IWebBrowserImpl::get_TopLevelContainer()\n")); - ENSURE_BROWSER_IS_VALID(); - if (!pBool) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Implement get_TopLevelContainer - *pBool = VARIANT_TRUE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR __RPC_FAR *Type) - { - ATLTRACE(_T("IWebBrowserImpl::get_Type()\n")); - ENSURE_BROWSER_IS_VALID(); - - //NOTE: This code should work in theory, but can't be verified because GetDoctype - // has not been implemented yet. -#if 0 - nsIDOMDocument *pIDOMDocument = nsnull; - if ( SUCCEEDED(GetDOMDocument(&pIDOMDocument)) ) - { - nsIDOMDocumentType *pIDOMDocumentType = nsnull; - if ( SUCCEEDED(pIDOMDocument->GetDoctype(&pIDOMDocumentType)) ) - { - nsAutoString docName; - pIDOMDocumentType->GetName(docName); - //NG_TRACE("pIDOMDocumentType returns: %s", docName); - //Still need to manipulate docName so that it goes into *Type param of this function. - } - } -#endif - //TODO: Implement get_Type - return SetErrorInfo(E_FAIL, L"get_Type: failed"); - } - - virtual HRESULT STDMETHODCALLTYPE get_Left(long __RPC_FAR *pl) - { - ATLTRACE(_T("IWebBrowserImpl::get_Left()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pl == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //TODO: Implement get_Left - Should return the left position of this control. - *pl = 0; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Left(long Left) - { - ATLTRACE(_T("IWebBrowserImpl::put_Left()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement put_Left - Should set the left position of this control. - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE get_Top(long __RPC_FAR *pl) - { - ATLTRACE(_T("IWebBrowserImpl::get_Top()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pl == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Implement get_Top - Should return the top position of this control. - *pl = 0; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Top(long Top) - { - ATLTRACE(_T("IWebBrowserImpl::put_Top()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement set_Top - Should set the top position of this control. - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE get_Width(long __RPC_FAR *pl) - { - ATLTRACE(_T("IWebBrowserImpl::get_Width()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement get_Width- Should return the width of this control. - if (pl == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - *pl = 0; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Width(long Width) - { - ATLTRACE(_T("IWebBrowserImpl::put_Width()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement put_Width - Should set the width of this control. - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE get_Height(long __RPC_FAR *pl) - { - ATLTRACE(_T("IWebBrowserImpl::get_Height()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pl == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //TODO: Implement get_Height - Should return the hieght of this control. - *pl = 0; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Height(long Height) - { - ATLTRACE(_T("IWebBrowserImpl::put_Height()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement put_Height - Should set the height of this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_LocationName(BSTR __RPC_FAR *LocationName) - { - ATLTRACE(_T("IWebBrowserImpl::get_LocationName()\n")); - ENSURE_BROWSER_IS_VALID(); - if (LocationName == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - // Get the url from the web shell - nsString szLocationName; - ENSURE_GET_WEBNAV(); - nsCOMPtr baseWindow = do_QueryInterface(webNav); - baseWindow->GetTitle(getter_Copies(szLocationName)); - if (!szLocationName.get()) - { - return SetErrorInfo(E_UNEXPECTED); - } - - // Convert the string to a BSTR - USES_CONVERSION; - LPCOLESTR pszConvertedLocationName = W2COLE(szLocationName.get()); - *LocationName = SysAllocString(pszConvertedLocationName); - - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_LocationURL(BSTR __RPC_FAR *LocationURL) - { - ATLTRACE(_T("IWebBrowserImpl::get_LocationURL()\n")); - ENSURE_BROWSER_IS_VALID(); - - if (LocationURL == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - nsCOMPtr uri; - // Get the current url from the browser - nsCOMPtr webNav; - GetWebNavigation(getter_AddRefs(webNav)); - if (webNav) - { - webNav->GetCurrentURI(getter_AddRefs(uri)); - } - if (uri) - { - USES_CONVERSION; - nsCAutoString aURI; - uri->GetAsciiSpec(aURI); - *LocationURL = SysAllocString(A2OLE(aURI.get())); - } - else - { - *LocationURL = NULL; - } - - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Busy(VARIANT_BOOL __RPC_FAR *pBool) - { - ATLTRACE(_T("IWebBrowserImpl::get_Busy()\n")); - ENSURE_BROWSER_IS_VALID(); - if (!pBool) - { - return SetErrorInfo(E_INVALIDARG); - } - *pBool = (mBusyFlag) ? VARIANT_TRUE : VARIANT_FALSE; - return S_OK; - } - -// IWebBrowserApp implementation - virtual HRESULT STDMETHODCALLTYPE Quit(void) - { - ATLTRACE(_T("IWebBrowserImpl::Quit()\n")); - ENSURE_BROWSER_IS_VALID(); - - //This generates an exception in the IE control. - // TODO fire quit event - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy) - { - ATLTRACE(_T("IWebBrowserImpl::ClientToWindow()\n")); - ENSURE_BROWSER_IS_VALID(); - - //This generates an exception in the IE control. - // TODO convert points to be relative to browser - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE PutProperty(BSTR Property, VARIANT vtValue) - { - ATLTRACE(_T("IWebBrowserImpl::PutProperty()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Property == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - mPropertyList.AddOrReplaceNamedProperty(Property, vtValue); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue) - { - ATLTRACE(_T("IWebBrowserImpl::GetProperty()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Property == NULL || pvtValue == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - VariantInit(pvtValue); - for (unsigned long i = 0; i < mPropertyList.GetSize(); i++) - { - if (wcsicmp(mPropertyList.GetNameOf(i), Property) == 0) - { - // Copy the new value - VariantCopy(pvtValue, const_cast(mPropertyList.GetValueOf(i))); - return S_OK; - } - } - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR __RPC_FAR *Name) - { - ATLTRACE(_T("IWebBrowserImpl::get_Name()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Name == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - // TODO: Implement get_Name (get Mozilla's executable name) - *Name = SysAllocString(L"Mozilla Web Browser Control"); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_HWND(SHANDLE_PTR __RPC_FAR *pHWND) - { - ATLTRACE(_T("IWebBrowserImpl::get_HWND()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pHWND == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //This is supposed to return a handle to the IE main window. Since that doesn't exist - //in the control's case, this shouldn't do anything. - *pHWND = NULL; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_FullName(BSTR __RPC_FAR *FullName) - { - ATLTRACE(_T("IWebBrowserImpl::get_FullName()\n")); - ENSURE_BROWSER_IS_VALID(); - if (FullName == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - // TODO: Implement get_FullName (Return the full path of the executable containing this control) - *FullName = SysAllocString(L""); // TODO get Mozilla's executable name - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Path(BSTR __RPC_FAR *Path) - { - ATLTRACE(_T("IWebBrowserImpl::get_Path()\n")); - ENSURE_BROWSER_IS_VALID(); - - if (Path == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - // TODO: Implement get_Path (get Mozilla's path) - *Path = SysAllocString(L""); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Visible(VARIANT_BOOL __RPC_FAR *pBool) - { - ATLTRACE(_T("IWebBrowserImpl::get_Visible()\n")); - ENSURE_BROWSER_IS_VALID(); - - if (pBool == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //TODO: Implement get_Visible? - *pBool = VARIANT_TRUE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_Visible(VARIANT_BOOL Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_Visible()\n")); - ENSURE_BROWSER_IS_VALID(); - - //TODO: Implement put_Visible? - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool) - { - ATLTRACE(_T("IWebBrowserImpl::get_StatusBar()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pBool == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //There is no StatusBar in this control. - *pBool = VARIANT_FALSE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_StatusBar(VARIANT_BOOL Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_StatusBar()\n")); - ENSURE_BROWSER_IS_VALID(); - //There is no StatusBar in this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_StatusText(BSTR __RPC_FAR *StatusText) - { - ATLTRACE(_T("IWebBrowserImpl::get_StatusText()\n")); - ENSURE_BROWSER_IS_VALID(); - if (StatusText == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //TODO: Implement get_StatusText - //NOTE: This function is related to the MS status bar which doesn't exist in this control. Needs more - // investigation, but probably doesn't apply. - *StatusText = SysAllocString(L""); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_StatusText(BSTR StatusText) - { - ATLTRACE(_T("IWebBrowserImpl::put_StatusText()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement put_StatusText - //NOTE: This function is related to the MS status bar which doesn't exist in this control. Needs more - // investigation, but probably doesn't apply. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_ToolBar(int __RPC_FAR *Value) - { - ATLTRACE(_T("IWebBrowserImpl::get_ToolBar()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Value == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //There is no ToolBar in this control. - *Value = FALSE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_ToolBar(int Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_ToolBar()\n")); - ENSURE_BROWSER_IS_VALID(); - //There is no ToolBar in this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_MenuBar(VARIANT_BOOL __RPC_FAR *Value) - { - ATLTRACE(_T("IWebBrowserImpl::get_MenuBar()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Value == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //There is no MenuBar in this control. - *Value = VARIANT_FALSE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_MenuBar(VARIANT_BOOL Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_MenuBar()\n")); - ENSURE_BROWSER_IS_VALID(); - //There is no MenuBar in this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen) - { - ATLTRACE(_T("IWebBrowserImpl::get_FullScreen()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pbFullScreen == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - - //FullScreen mode doesn't really apply to this control. - *pbFullScreen = VARIANT_FALSE; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE put_FullScreen(VARIANT_BOOL bFullScreen) - { - ATLTRACE(_T("IWebBrowserImpl::put_FullScreen()\n")); - ENSURE_BROWSER_IS_VALID(); - //FullScreen mode doesn't really apply to this control. - return S_OK; - } - -// IWebBrowser2 implementation - virtual HRESULT STDMETHODCALLTYPE Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers) - { - ATLTRACE(_T("IWebBrowserImpl::Navigate2()\n")); - CComVariant vURLAsString; - if (vURLAsString.ChangeType(VT_BSTR, URL) != S_OK) - { - return SetErrorInfo(E_INVALIDARG); - } - return Navigate(vURLAsString.bstrVal, Flags, TargetFrameName, PostData, Headers); - } - - virtual HRESULT STDMETHODCALLTYPE QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf) - { - ATLTRACE(_T("IWebBrowserImpl::QueryStatusWB()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pcmdf == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - // Call through to IOleCommandTarget::QueryStatus - CComQIPtr cmdTarget = this; - if (cmdTarget) - { - OLECMD cmd; - HRESULT hr; - - cmd.cmdID = cmdID; - cmd.cmdf = 0; - hr = cmdTarget->QueryStatus(NULL, 1, &cmd, NULL); - if (SUCCEEDED(hr)) - { - *pcmdf = (OLECMDF) cmd.cmdf; - } - return hr; - } - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) - { - ATLTRACE(_T("IWebBrowserImpl::ExecWB()\n")); - ENSURE_BROWSER_IS_VALID(); - // Call through to IOleCommandTarget::Exec - CComQIPtr cmdTarget = this; - if (cmdTarget) - { - return cmdTarget->Exec(NULL, cmdID, cmdexecopt, pvaIn, pvaOut); - } - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize) - { - ATLTRACE(_T("IWebBrowserImpl::ShowBrowserBar()\n")); - ENSURE_BROWSER_IS_VALID(); - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_ReadyState(READYSTATE __RPC_FAR *plReadyState) - { - ATLTRACE(_T("IWebBrowserImpl::get_ReadyState()\n")); - // Note: may be called when browser is not yet initialized so there - // is no validity check here. - if (plReadyState == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - *plReadyState = mBrowserReadyState; - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline) - { - ATLTRACE(_T("IWebBrowserImpl::get_Offline()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pbOffline == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Implement get_Offline - *pbOffline = VARIANT_FALSE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Offline(VARIANT_BOOL bOffline) - { - ATLTRACE(_T("IWebBrowserImpl::put_Offline()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement get_Offline - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent) - { - ATLTRACE(_T("IWebBrowserImpl::get_Silent()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pbSilent == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //Only really applies to the IE app, not a control - *pbSilent = VARIANT_FALSE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Silent(VARIANT_BOOL bSilent) - { - ATLTRACE(_T("IWebBrowserImpl::put_Silent()\n")); - ENSURE_BROWSER_IS_VALID(); - //Only really applies to the IE app, not a control - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister) - { - ATLTRACE(_T("IWebBrowserImpl::get_RegisterAsBrowser()\n")); - ENSURE_BROWSER_IS_VALID(); - - if (pbRegister == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Implement get_RegisterAsBrowser - *pbRegister = VARIANT_FALSE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_RegisterAsBrowser(VARIANT_BOOL bRegister) - { - ATLTRACE(_T("IWebBrowserImpl::put_RegisterAsBrowser()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Implement put_RegisterAsBrowser - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister) - { - // TODO - return E_NOTIMPL; - } - virtual HRESULT STDMETHODCALLTYPE put_RegisterAsDropTarget(VARIANT_BOOL bRegister) - { - // TODO - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister) - { - ATLTRACE(_T("IWebBrowserImpl::get_TheaterMode()\n")); - ENSURE_BROWSER_IS_VALID(); - if (pbRegister == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - // TheaterMode doesn't apply to this control. - *pbRegister = VARIANT_FALSE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_TheaterMode(VARIANT_BOOL bRegister) - { - ATLTRACE(_T("IWebBrowserImpl::put_TheaterMode()\n")); - ENSURE_BROWSER_IS_VALID(); - //There is no TheaterMode in this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_AddressBar(VARIANT_BOOL __RPC_FAR *Value) - { - ATLTRACE(_T("IWebBrowserImpl::get_AddressBar()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Value == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //There is no AddressBar in this control. - *Value = VARIANT_FALSE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_AddressBar(VARIANT_BOOL Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_AddressBar()\n")); - ENSURE_BROWSER_IS_VALID(); - //There is no AddressBar in this control. - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE get_Resizable(VARIANT_BOOL __RPC_FAR *Value) - { - ATLTRACE(_T("IWebBrowserImpl::get_Resizable()\n")); - ENSURE_BROWSER_IS_VALID(); - if (Value == NULL) - { - return SetErrorInfo(E_INVALIDARG); - } - //TODO: Not sure if this should actually be implemented or not. - *Value = VARIANT_TRUE; - return S_OK; - } - virtual HRESULT STDMETHODCALLTYPE put_Resizable(VARIANT_BOOL Value) - { - ATLTRACE(_T("IWebBrowserImpl::put_Resizable()\n")); - ENSURE_BROWSER_IS_VALID(); - //TODO: Not sure if this should actually be implemented or not. - return S_OK; - } -}; - -#endif diff --git a/embedding/browser/activex/src/common/ItemContainer.cpp b/embedding/browser/activex/src/common/ItemContainer.cpp deleted file mode 100644 index 4f1f72a98fd..00000000000 --- a/embedding/browser/activex/src/common/ItemContainer.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include "ItemContainer.h" - -CItemContainer::CItemContainer() -{ -} - -CItemContainer::~CItemContainer() -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// IParseDisplayName implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::ParseDisplayName(/* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ LPOLESTR pszDisplayName, /* [out] */ ULONG __RPC_FAR *pchEaten, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkOut) -{ - // TODO - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleContainer implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::EnumObjects(/* [in] */ DWORD grfFlags, /* [out] */ IEnumUnknown __RPC_FAR *__RPC_FAR *ppenum) -{ - HRESULT hr = E_NOTIMPL; -/* - if (ppenum == NULL) - { - return E_POINTER; - } - - *ppenum = NULL; - typedef CComObject, CNamedObjectList > > enumunk; - enumunk* p = NULL; - p = new enumunk; - if(p == NULL) - { - return E_OUTOFMEMORY; - } - - hr = p->Init(); - if (SUCCEEDED(hr)) - { - hr = p->QueryInterface(IID_IEnumUnknown, (void**) ppenum); - } - if (FAILED(hRes)) - { - delete p; - } -*/ - return hr; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::LockContainer(/* [in] */ BOOL fLock) -{ - // TODO - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleItemContainer implementation - - -HRESULT STDMETHODCALLTYPE CItemContainer::GetObject(/* [in] */ LPOLESTR pszItem, /* [in] */ DWORD dwSpeedNeeded, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) -{ - if (pszItem == NULL) - { - return E_INVALIDARG; - } - if (ppvObject == NULL) - { - return E_INVALIDARG; - } - - *ppvObject = NULL; - - return MK_E_NOOBJECT; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::GetObjectStorage(/* [in] */ LPOLESTR pszItem, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvStorage) -{ - // TODO - return MK_E_NOOBJECT; -} - - -HRESULT STDMETHODCALLTYPE CItemContainer::IsRunning(/* [in] */ LPOLESTR pszItem) -{ - // TODO - return MK_E_NOOBJECT; -} diff --git a/embedding/browser/activex/src/common/ItemContainer.h b/embedding/browser/activex/src/common/ItemContainer.h deleted file mode 100644 index 424d723fd96..00000000000 --- a/embedding/browser/activex/src/common/ItemContainer.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef ITEMCONTAINER_H -#define ITEMCONTAINER_H - -// typedef std::map CNamedObjectList; - -// Class for managing a list of named objects. - -class CItemContainer : public CComObjectRootEx, - public IOleItemContainer -{ -// CNamedObjectList m_cNamedObjectList; -public: - - CItemContainer(); - virtual ~CItemContainer(); - -BEGIN_COM_MAP(CItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IParseDisplayName, IOleItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IOleContainer, IOleItemContainer) - COM_INTERFACE_ENTRY_IID(IID_IOleItemContainer, IOleItemContainer) -END_COM_MAP() - - // IParseDisplayName implementation - virtual HRESULT STDMETHODCALLTYPE ParseDisplayName(/* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ LPOLESTR pszDisplayName, /* [out] */ ULONG __RPC_FAR *pchEaten, /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkOut); - - // IOleContainer implementation - virtual HRESULT STDMETHODCALLTYPE EnumObjects(/* [in] */ DWORD grfFlags, /* [out] */ IEnumUnknown __RPC_FAR *__RPC_FAR *ppenum); - virtual HRESULT STDMETHODCALLTYPE LockContainer(/* [in] */ BOOL fLock); - - // IOleItemContainer implementation - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetObject(/* [in] */ LPOLESTR pszItem, /* [in] */ DWORD dwSpeedNeeded, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetObjectStorage(/* [in] */ LPOLESTR pszItem, /* [unique][in] */ IBindCtx __RPC_FAR *pbc, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvStorage); - virtual HRESULT STDMETHODCALLTYPE IsRunning(/* [in] */ LPOLESTR pszItem); -}; - -typedef CComObject CItemContainerInstance; - - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/Makefile.in b/embedding/browser/activex/src/common/Makefile.in deleted file mode 100644 index b5c60bc3d59..00000000000 --- a/embedding/browser/activex/src/common/Makefile.in +++ /dev/null @@ -1,88 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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/MPL/ -# -# 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 the Mozilla browser. -# -# The Initial Developer of the Original Code is -# Christopher Blizzard. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Adam Lock -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = ax_common -LIBRARY_NAME = ax_common_s -XPIDL_MODULE = ax_common - - -CPPSRCS = \ - IEHtmlNode.cpp \ - IEHtmlElement.cpp \ - IEHtmlElementCollection.cpp \ - ControlSite.cpp \ - ControlSiteIPFrame.cpp \ - ControlEventSink.cpp \ - PropertyBag.cpp \ - ItemContainer.cpp \ - IEHtmlSelectionObject.cpp \ - IEHtmlTxtRange.cpp \ - IEHtmlButtonElement.cpp \ - $(NULL) - -EXPORTS = \ - IEHtmlNode.h \ - IEHtmlElement.h \ - IEHtmlElementCollection.h \ - ControlSite.h \ - ControlSiteIPFrame.h \ - ControlEventSink.h \ - PropertyList.h \ - PropertyBag.h \ - ItemContainer.h \ - IOleCommandTargetImpl.h \ - IWebBrowserImpl.h \ - IHTMLLocationImpl.h \ - CPMozillaControl.h \ - IEHtmlSelectionObject.h \ - IEHtmlTxtRange.h - -# we don't want the shared lib, but we want to force the creation of a -# static lib. -FORCE_STATIC_LIB = 1 - -ENABLE_CXX_EXCEPTIONS = 1 - -include $(topsrcdir)/config/rules.mk diff --git a/embedding/browser/activex/src/common/PropertyBag.cpp b/embedding/browser/activex/src/common/PropertyBag.cpp deleted file mode 100644 index 8d751dfe1a6..00000000000 --- a/embedding/browser/activex/src/common/PropertyBag.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include "PropertyBag.h" - - -CPropertyBag::CPropertyBag() -{ -} - - -CPropertyBag::~CPropertyBag() -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// IPropertyBag implementation - -HRESULT STDMETHODCALLTYPE CPropertyBag::Read(/* [in] */ LPCOLESTR pszPropName, /* [out][in] */ VARIANT __RPC_FAR *pVar, /* [in] */ IErrorLog __RPC_FAR *pErrorLog) -{ - if (pszPropName == NULL) - { - return E_INVALIDARG; - } - if (pVar == NULL) - { - return E_INVALIDARG; - } - - VARTYPE vt = pVar->vt; - VariantInit(pVar); - - for (unsigned long i = 0; i < m_PropertyList.GetSize(); i++) - { - if (wcsicmp(m_PropertyList.GetNameOf(i), pszPropName) == 0) - { - const VARIANT *pvSrc = m_PropertyList.GetValueOf(i); - if (!pvSrc) - { - return E_FAIL; - } - CComVariant vNew; - HRESULT hr = (vt == VT_EMPTY) ? - vNew.Copy(pvSrc) : vNew.ChangeType(vt, pvSrc); - if (FAILED(hr)) - { - return E_FAIL; - } - // Copy the new value - vNew.Detach(pVar); - return S_OK; - } - } - - // Property does not exist in the bag - return E_FAIL; -} - - -HRESULT STDMETHODCALLTYPE CPropertyBag::Write(/* [in] */ LPCOLESTR pszPropName, /* [in] */ VARIANT __RPC_FAR *pVar) -{ - if (pszPropName == NULL) - { - return E_INVALIDARG; - } - if (pVar == NULL) - { - return E_INVALIDARG; - } - - CComBSTR bstrName(pszPropName); - m_PropertyList.AddOrReplaceNamedProperty(bstrName, *pVar); - - return S_OK; -} - diff --git a/embedding/browser/activex/src/common/PropertyBag.h b/embedding/browser/activex/src/common/PropertyBag.h deleted file mode 100644 index 6154e7820f2..00000000000 --- a/embedding/browser/activex/src/common/PropertyBag.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef PROPERTYBAG_H -#define PROPERTYBAG_H - -#include "PropertyList.h" - -// Object wrapper for property list. This class can be set up with a -// list of properties and used to initialise a control with them - -class CPropertyBag : public CComObjectRootEx, - public IPropertyBag -{ - // List of properties in the bag - PropertyList m_PropertyList; - -public: - // Constructor - CPropertyBag(); - // Destructor - virtual ~CPropertyBag(); - -BEGIN_COM_MAP(CPropertyBag) - COM_INTERFACE_ENTRY(IPropertyBag) -END_COM_MAP() - -// IPropertyBag methods - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read(/* [in] */ LPCOLESTR pszPropName, /* [out][in] */ VARIANT __RPC_FAR *pVar, /* [in] */ IErrorLog __RPC_FAR *pErrorLog); - virtual HRESULT STDMETHODCALLTYPE Write(/* [in] */ LPCOLESTR pszPropName, /* [in] */ VARIANT __RPC_FAR *pVar); -}; - -typedef CComObject CPropertyBagInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/PropertyList.h b/embedding/browser/activex/src/common/PropertyList.h deleted file mode 100644 index 4407adb4198..00000000000 --- a/embedding/browser/activex/src/common/PropertyList.h +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef PROPERTYLIST_H -#define PROPERTYLIST_H - -// A simple array class for managing name/value pairs typically fed to controls -// during initialization by IPersistPropertyBag - -class PropertyList -{ - struct Property { - BSTR bstrName; - VARIANT vValue; - } *mProperties; - unsigned long mListSize; - unsigned long mMaxListSize; - - bool EnsureMoreSpace() - { - // Ensure enough space exists to accomodate a new item - const unsigned long kGrowBy = 10; - if (!mProperties) - { - mProperties = (Property *) malloc(sizeof(Property) * kGrowBy); - if (!mProperties) - return false; - mMaxListSize = kGrowBy; - } - else if (mListSize == mMaxListSize) - { - Property *pNewProperties; - pNewProperties = (Property *) realloc(mProperties, sizeof(Property) * (mMaxListSize + kGrowBy)); - if (!pNewProperties) - return false; - mProperties = pNewProperties; - mMaxListSize += kGrowBy; - } - return true; - } - -public: - PropertyList() : - mProperties(NULL), - mListSize(0), - mMaxListSize(0) - { - } - ~PropertyList() - { - } - void Clear() - { - if (mProperties) - { - for (unsigned long i = 0; i < mListSize; i++) - { - SysFreeString(mProperties[i].bstrName); // Safe even if NULL - VariantClear(&mProperties[i].vValue); - } - free(mProperties); - mProperties = NULL; - } - mListSize = 0; - mMaxListSize = 0; - } - unsigned long GetSize() const - { - return mListSize; - } - const BSTR GetNameOf(unsigned long nIndex) const - { - if (nIndex > mListSize) - { - return NULL; - } - return mProperties[nIndex].bstrName; - } - const VARIANT *GetValueOf(unsigned long nIndex) const - { - if (nIndex > mListSize) - { - return NULL; - } - return &mProperties[nIndex].vValue; - } - bool AddOrReplaceNamedProperty(const BSTR bstrName, const VARIANT &vValue) - { - if (!bstrName) - return false; - for (unsigned long i = 0; i < GetSize(); i++) - { - // Case insensitive - if (wcsicmp(mProperties[i].bstrName, bstrName) == 0) - { - return SUCCEEDED( - VariantCopy(&mProperties[i].vValue, const_cast(&vValue))); - } - } - return AddNamedProperty(bstrName, vValue); - } - bool AddNamedProperty(const BSTR bstrName, const VARIANT &vValue) - { - if (!bstrName || !EnsureMoreSpace()) - return false; - Property *pProp = &mProperties[mListSize]; - pProp->bstrName = ::SysAllocString(bstrName); - if (!pProp->bstrName) - { - return false; - } - VariantInit(&pProp->vValue); - if (FAILED(VariantCopy(&pProp->vValue, const_cast(&vValue)))) - { - SysFreeString(pProp->bstrName); - return false; - } - mListSize++; - return true; - } -}; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/common/StdAfx.h b/embedding/browser/activex/src/common/StdAfx.h deleted file mode 100644 index faaeb456673..00000000000 --- a/embedding/browser/activex/src/common/StdAfx.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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 - - // under MSVC shut off copious warnings about debug symbol too long -#ifdef _MSC_VER - #pragma warning( disable: 4786 ) -#endif - -#include "jstypes.h" -#include "prtypes.h" - -// Mozilla headers - -#include "jscompat.h" - -#include "prthread.h" -#include "prprf.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsStringAPI.h" -#include "nsCOMPtr.h" -#include "nsComponentManagerUtils.h" -#include "nsServiceManagerUtils.h" - -#include "nsIDocument.h" -#include "nsIDocumentObserver.h" - -#include "nsIDOMNode.h" -#include "nsIDOMNodeList.h" -#include "nsIDOMDocument.h" -#include "nsIDOMDocumentType.h" -#include "nsIDOMElement.h" - -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0403 -#define _ATL_APARTMENT_THREADED -#define _ATL_STATIC_REGISTRY -// #define _ATL_DEBUG_INTERFACES - -// ATL headers -// The ATL headers that come with the platform SDK have bad for scoping -#if _MSC_VER >= 1400 -#pragma conform(forScope, push, atlhack, off) -#endif - -#include - -//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 -#include - -#if _MSC_VER >= 1400 -#pragma conform(forScope, pop, atlhack) -#endif - -#include -#include -#include - -// New winsock2.h doesn't define this anymore -typedef long int32; - -// Turn off warnings about debug symbols for templates being too long -#pragma warning(disable : 4786) - -#define TRACE_METHOD(fn) \ - { \ - ATLTRACE(_T("0x%04x %s()\n"), (int) GetCurrentThreadId(), _T(#fn)); \ - } -#define TRACE_METHOD_ARGS(fn, pattern, args) \ - { \ - ATLTRACE(_T("0x%04x %s(") _T(pattern) _T(")\n"), (int) GetCurrentThreadId(), _T(#fn), args); \ - } - -//{{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) diff --git a/embedding/browser/activex/src/control/ActiveScriptSite.cpp b/embedding/browser/activex/src/control/ActiveScriptSite.cpp deleted file mode 100644 index 8f5ab6262b8..00000000000 --- a/embedding/browser/activex/src/control/ActiveScriptSite.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include -#include -#include "ActiveScriptSite.h" - - -CActiveScriptSite::CActiveScriptSite() -{ - m_ssScriptState = SCRIPTSTATE_UNINITIALIZED; -} - - -CActiveScriptSite::~CActiveScriptSite() -{ - Detach(); -} - - -HRESULT CActiveScriptSite::Attach(CLSID clsidScriptEngine) -{ - // Detach to anything already attached to - Detach(); - - // Create the new script engine - HRESULT hr = m_spIActiveScript.CoCreateInstance(clsidScriptEngine); - if (FAILED(hr)) - { - return hr; - } - - // Attach the script engine to this site - m_spIActiveScript->SetScriptSite(this); - - // Initialise the script engine - CIPtr(IActiveScriptParse) spActiveScriptParse = m_spIActiveScript; - if (spActiveScriptParse) - { - spActiveScriptParse->InitNew(); - } - else - { - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::Detach() -{ - if (m_spIActiveScript) - { - StopScript(); - m_spIActiveScript->Close(); - m_spIActiveScript.Release(); - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::AttachVBScript() -{ - static const CLSID CLSID_VBScript = - { 0xB54F3741, 0x5B07, 0x11CF, { 0xA4, 0xB0, 0x00, 0xAA, 0x00, 0x4A, 0x55, 0xE8} }; - - return Attach(CLSID_VBScript); -} - - -HRESULT CActiveScriptSite::AttachJScript() -{ - static const CLSID CLSID_JScript = - { 0xF414C260, 0x6AC0, 0x11CF, { 0xB6, 0xD1, 0x00, 0xAA, 0x00, 0xBB, 0xBB, 0x58} }; - - return Attach(CLSID_JScript); -} - - -HRESULT CActiveScriptSite::AddNamedObject(const TCHAR *szName, IUnknown *pObject, BOOL bGlobalMembers) -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - if (pObject == NULL || szName == NULL) - { - return E_INVALIDARG; - } - - // Check for objects of the same name already - CNamedObjectList::iterator i = m_cObjectList.find(szName); - if (i != m_cObjectList.end()) - { - return E_FAIL; - } - - // Add object to the list - m_cObjectList.insert(CNamedObjectList::value_type(szName, pObject)); - - // Tell the script engine about the object - HRESULT hr; - USES_CONVERSION; - DWORD dwFlags = SCRIPTITEM_ISSOURCE | SCRIPTITEM_ISVISIBLE; - if (bGlobalMembers) - { - dwFlags |= SCRIPTITEM_GLOBALMEMBERS; - } - - hr = m_spIActiveScript->AddNamedItem(T2OLE(szName), dwFlags); - - if (FAILED(hr)) - { - m_cObjectList.erase(szName); - return hr; - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::ParseScriptFile(const TCHAR *szFile) -{ - USES_CONVERSION; - const char *pszFileName = T2CA(szFile); - - // Stat the file and get its length; - struct _stat cStat; - _stat(pszFileName, &cStat); - - // Allocate a buffer - size_t nBufSize = cStat.st_size + 1; - char *pBuffer = (char *) malloc(nBufSize); - if (pBuffer == NULL) - { - return E_OUTOFMEMORY; - } - memset(pBuffer, 0, nBufSize); - - // Read the script into the buffer and parse it - HRESULT hr = E_FAIL; - FILE *f = fopen(pszFileName, "rb"); - if (f) - { - fread(pBuffer, 1, nBufSize - 1, f); - hr = ParseScriptText(A2T(pBuffer)); - fclose(f); - } - - free(pBuffer); - - return hr; -} - - -HRESULT CActiveScriptSite::ParseScriptText(const TCHAR *szScript) -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - CIPtr(IActiveScriptParse) spIActiveScriptParse = m_spIActiveScript; - if (spIActiveScriptParse) - { - USES_CONVERSION; - - CComVariant vResult; - DWORD dwCookie = 0; // TODO - DWORD dwFlags = 0; - EXCEPINFO cExcepInfo; - HRESULT hr; - - hr = spIActiveScriptParse->ParseScriptText( - T2OLE(szScript), - NULL, NULL, NULL, dwCookie, 0, dwFlags, - &vResult, &cExcepInfo); - - if (FAILED(hr)) - { - return E_FAIL; - } - } - else - { - CIPtr(IPersistStream) spPersistStream = m_spIActiveScript; - CIPtr(IStream) spStream; - - // Load text into the stream IPersistStream - if (spPersistStream && - SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &spStream))) - { - USES_CONVERSION; - LARGE_INTEGER cPos = { 0, 0 }; - LPOLESTR szText = T2OLE(szScript); - spStream->Write(szText, wcslen(szText) * sizeof(WCHAR), NULL); - spStream->Seek(cPos, STREAM_SEEK_SET, NULL); - spPersistStream->Load(spStream); - } - else - { - return E_UNEXPECTED; - } - } - - return S_OK; -} - - -HRESULT CActiveScriptSite::PlayScript() -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - m_spIActiveScript->SetScriptState(SCRIPTSTATE_CONNECTED); - - return S_OK; -} - - -HRESULT CActiveScriptSite::StopScript() -{ - if (m_spIActiveScript == NULL) - { - return E_UNEXPECTED; - } - - m_spIActiveScript->SetScriptState(SCRIPTSTATE_DISCONNECTED); - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IActiveScriptSite implementation - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetLCID(/* [out] */ LCID __RPC_FAR *plcid) -{ - // Use the system defined locale - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetItemInfo(/* [in] */ LPCOLESTR pstrName, /* [in] */ DWORD dwReturnMask, /* [out] */ IUnknown __RPC_FAR *__RPC_FAR *ppiunkItem, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppti) -{ - if (pstrName == NULL) - { - return E_INVALIDARG; - } - - if (ppiunkItem) - { - *ppiunkItem = NULL; - } - - if (ppti) - { - *ppti = NULL; - } - - USES_CONVERSION; - - // Find object in list - CIUnkPtr spUnkObject; - CNamedObjectList::iterator i = m_cObjectList.find(OLE2T(pstrName)); - if (i != m_cObjectList.end()) - { - spUnkObject = (*i).second; - } - - // Fill in the output values - if (spUnkObject == NULL) - { - return TYPE_E_ELEMENTNOTFOUND; - } - if (dwReturnMask & SCRIPTINFO_IUNKNOWN) - { - spUnkObject->QueryInterface(IID_IUnknown, (void **) ppiunkItem); - } - if (dwReturnMask & SCRIPTINFO_ITYPEINFO) - { - // Return the typeinfo in ptti - CIPtr(IDispatch) spIDispatch = spUnkObject; - if (spIDispatch) - { - HRESULT hr; - hr = spIDispatch->GetTypeInfo(0, GetSystemDefaultLCID(), ppti); - if (FAILED(hr)) - { - *ppti = NULL; - } - } - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::GetDocVersionString(/* [out] */ BSTR __RPC_FAR *pbstrVersion) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnScriptTerminate(/* [in] */ const VARIANT __RPC_FAR *pvarResult, /* [in] */ const EXCEPINFO __RPC_FAR *pexcepinfo) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnStateChange(/* [in] */ SCRIPTSTATE ssScriptState) -{ - m_ssScriptState = ssScriptState; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnScriptError(/* [in] */ IActiveScriptError __RPC_FAR *pscripterror) -{ - BSTR bstrSourceLineText = NULL; - DWORD dwSourceContext = 0; - ULONG pulLineNumber = 0; - LONG ichCharPosition = 0; - EXCEPINFO cExcepInfo; - - memset(&cExcepInfo, 0, sizeof(cExcepInfo)); - - // Get error information - pscripterror->GetSourcePosition(&dwSourceContext, &pulLineNumber, &ichCharPosition); - pscripterror->GetSourceLineText(&bstrSourceLineText); - pscripterror->GetExceptionInfo(&cExcepInfo); - - tstring szDescription(_T("(No description)")); - if (cExcepInfo.bstrDescription) - { - // Dump info - USES_CONVERSION; - szDescription = OLE2T(cExcepInfo.bstrDescription); - } - - ATLTRACE(_T("Script Error: %s, code=0x%08x\n"), szDescription.c_str(), cExcepInfo.scode); - - SysFreeString(bstrSourceLineText); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnEnterScript(void) -{ - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CActiveScriptSite::OnLeaveScript(void) -{ - return S_OK; -} - - diff --git a/embedding/browser/activex/src/control/ActiveScriptSite.h b/embedding/browser/activex/src/control/ActiveScriptSite.h deleted file mode 100644 index 6986fb2973d..00000000000 --- a/embedding/browser/activex/src/control/ActiveScriptSite.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef ACTIVESCRIPTSITE_H -#define ACTIVESCRIPTSITE_H - - -class CActiveScriptSite : public CComObjectRootEx, - public IActiveScriptSite -{ - // Pointer to owned script engine - CComQIPtr m_spIActiveScript; - - // List of registered, named objects - CNamedObjectList m_cObjectList; - - // Current script state - SCRIPTSTATE m_ssScriptState; - -public: - CActiveScriptSite(); - virtual ~CActiveScriptSite(); - -BEGIN_COM_MAP(CActiveScriptSite) - COM_INTERFACE_ENTRY(IActiveScriptSite) -END_COM_MAP() - - // Attach to the specified script engine - virtual HRESULT Attach(CLSID clsidScriptEngine); - // Helper to attach to the VBScript engine - virtual HRESULT AttachVBScript(); - // Helper to attach to the JScript engine - virtual HRESULT AttachJScript(); - // Detach from the script engine - virtual HRESULT Detach(); - // Return the current state of the script engine - virtual SCRIPTSTATE GetScriptState() const - { - return m_ssScriptState; - } - - // Parse the specified script - virtual HRESULT ParseScriptText(const TCHAR *szScript); - // Parse the specified script from a file - virtual HRESULT ParseScriptFile(const TCHAR *szFile); - // Add object to script address space - virtual HRESULT AddNamedObject(const TCHAR *szName, IUnknown *pObject, BOOL bGlobalMembers = FALSE); - // Play the script - virtual HRESULT PlayScript(); - // Stop the script - virtual HRESULT StopScript(); - -public: - // IActiveScriptSite - virtual HRESULT STDMETHODCALLTYPE GetLCID(/* [out] */ LCID __RPC_FAR *plcid); - virtual HRESULT STDMETHODCALLTYPE GetItemInfo(/* [in] */ LPCOLESTR pstrName, /* [in] */ DWORD dwReturnMask, /* [out] */ IUnknown __RPC_FAR *__RPC_FAR *ppiunkItem, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppti); - virtual HRESULT STDMETHODCALLTYPE GetDocVersionString(/* [out] */ BSTR __RPC_FAR *pbstrVersion); - virtual HRESULT STDMETHODCALLTYPE OnScriptTerminate(/* [in] */ const VARIANT __RPC_FAR *pvarResult, /* [in] */ const EXCEPINFO __RPC_FAR *pexcepinfo); - virtual HRESULT STDMETHODCALLTYPE OnStateChange(/* [in] */ SCRIPTSTATE ssScriptState); - virtual HRESULT STDMETHODCALLTYPE OnScriptError(/* [in] */ IActiveScriptError __RPC_FAR *pscripterror); - virtual HRESULT STDMETHODCALLTYPE OnEnterScript(void); - virtual HRESULT STDMETHODCALLTYPE OnLeaveScript(void); -}; - -typedef CComObject CActiveScriptSiteInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/ActiveXTypes.h b/embedding/browser/activex/src/control/ActiveXTypes.h deleted file mode 100644 index 3d9927e9f1a..00000000000 --- a/embedding/browser/activex/src/control/ActiveXTypes.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef ACTIVEXTYPES_H -#define ACTIVEXTYPES_H - -#include -#include - -// STL based class for handling TCHAR strings -typedef std::basic_string tstring; - -// IUnknown smart pointer -typedef CComPtr CIUnkPtr; - -// Smart pointer macro for CComQIPtr -#define CIPtr(iface) CComQIPtr< iface, &IID_ ## iface > - -typedef std::vector CObjectList; -typedef std::map CNamedObjectList; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/BrowserDiagnostics.h b/embedding/browser/activex/src/control/BrowserDiagnostics.h deleted file mode 100644 index 744262fdbf5..00000000000 --- a/embedding/browser/activex/src/control/BrowserDiagnostics.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef BROWSER_DIAGNOSTICS_H -#define BROWSER_DIAGNOSTICS_H - -#ifdef _DEBUG -# include -# define NG_TRACE NgTrace -# define NG_TRACE_METHOD(fn) \ - { \ - NG_TRACE(_T("0x%04x %s()\n"), (int) GetCurrentThreadId(), _T(#fn)); \ - } -# define NG_TRACE_METHOD_ARGS(fn, pattern, args) \ - { \ - NG_TRACE(_T("0x%04x %s(") _T(pattern) _T(")\n"), (int) GetCurrentThreadId(), _T(#fn), args); \ - } -# define NG_ASSERT(expr) assert(expr) -# define NG_ASSERT_POINTER(p, type) \ - NG_ASSERT(((p) != NULL) && NgIsValidAddress((p), sizeof(type), FALSE)) -# define NG_ASSERT_NULL_OR_POINTER(p, type) \ - NG_ASSERT(((p) == NULL) || NgIsValidAddress((p), sizeof(type), FALSE)) -#else -# define NG_TRACE 1 ? (void)0 : NgTrace -# define NG_TRACE_METHOD(fn) -# define NG_TRACE_METHOD_ARGS(fn, pattern, args) -# define NG_ASSERT(X) -# define NG_ASSERT_POINTER(p, type) -# define NG_ASSERT_NULL_OR_POINTER(p, type) -#endif - -#define NG_TRACE_ALWAYS AtlTrace - -inline void _cdecl NgTrace(LPCSTR lpszFormat, ...) -{ - va_list args; - va_start(args, lpszFormat); - - int nBuf; - char szBuffer[512]; - - nBuf = _vsnprintf(szBuffer, sizeof(szBuffer), lpszFormat, args); - NG_ASSERT(nBuf < sizeof(szBuffer)); //Output truncated as it was > sizeof(szBuffer) - - OutputDebugStringA(szBuffer); - va_end(args); -} - -inline BOOL NgIsValidAddress(const void* lp, UINT nBytes, BOOL bReadWrite = TRUE) -{ - return (lp != NULL && !IsBadReadPtr(lp, nBytes) && - (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes))); -} - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/DHTMLCmdIds.h b/embedding/browser/activex/src/control/DHTMLCmdIds.h deleted file mode 100644 index 6f686a1b664..00000000000 --- a/embedding/browser/activex/src/control/DHTMLCmdIds.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef DHTMLCMDIDS_H -#define DHTMLCMDIDS_H - -#ifndef __mshtmcid_h__ -#define IDM_UNKNOWN 0 -#define IDM_ALIGNBOTTOM 1 -#define IDM_ALIGNHORIZONTALCENTERS 2 -#define IDM_ALIGNLEFT 3 -#define IDM_ALIGNRIGHT 4 -#define IDM_ALIGNTOGRID 5 -#define IDM_ALIGNTOP 6 -#define IDM_ALIGNVERTICALCENTERS 7 -#define IDM_ARRANGEBOTTOM 8 -#define IDM_ARRANGERIGHT 9 -#define IDM_BRINGFORWARD 10 -#define IDM_BRINGTOFRONT 11 -#define IDM_CENTERHORIZONTALLY 12 -#define IDM_CENTERVERTICALLY 13 -#define IDM_CODE 14 -#define IDM_DELETE 17 -#define IDM_FONTNAME 18 -#define IDM_FONTSIZE 19 -#define IDM_GROUP 20 -#define IDM_HORIZSPACECONCATENATE 21 -#define IDM_HORIZSPACEDECREASE 22 -#define IDM_HORIZSPACEINCREASE 23 -#define IDM_HORIZSPACEMAKEEQUAL 24 -#define IDM_INSERTOBJECT 25 -#define IDM_MULTILEVELREDO 30 -#define IDM_SENDBACKWARD 32 -#define IDM_SENDTOBACK 33 -#define IDM_SHOWTABLE 34 -#define IDM_SIZETOCONTROL 35 -#define IDM_SIZETOCONTROLHEIGHT 36 -#define IDM_SIZETOCONTROLWIDTH 37 -#define IDM_SIZETOFIT 38 -#define IDM_SIZETOGRID 39 -#define IDM_SNAPTOGRID 40 -#define IDM_TABORDER 41 -#define IDM_TOOLBOX 42 -#define IDM_MULTILEVELUNDO 44 -#define IDM_UNGROUP 45 -#define IDM_VERTSPACECONCATENATE 46 -#define IDM_VERTSPACEDECREASE 47 -#define IDM_VERTSPACEINCREASE 48 -#define IDM_VERTSPACEMAKEEQUAL 49 -#define IDM_JUSTIFYFULL 50 -#define IDM_BACKCOLOR 51 -#define IDM_BOLD 52 -#define IDM_BORDERCOLOR 53 -#define IDM_FLAT 54 -#define IDM_FORECOLOR 55 -#define IDM_ITALIC 56 -#define IDM_JUSTIFYCENTER 57 -#define IDM_JUSTIFYGENERAL 58 -#define IDM_JUSTIFYLEFT 59 -#define IDM_JUSTIFYRIGHT 60 -#define IDM_RAISED 61 -#define IDM_SUNKEN 62 -#define IDM_UNDERLINE 63 -#define IDM_CHISELED 64 -#define IDM_ETCHED 65 -#define IDM_SHADOWED 66 -#define IDM_FIND 67 -#define IDM_SHOWGRID 69 -#define IDM_OBJECTVERBLIST0 72 -#define IDM_OBJECTVERBLIST1 73 -#define IDM_OBJECTVERBLIST2 74 -#define IDM_OBJECTVERBLIST3 75 -#define IDM_OBJECTVERBLIST4 76 -#define IDM_OBJECTVERBLIST5 77 -#define IDM_OBJECTVERBLIST6 78 -#define IDM_OBJECTVERBLIST7 79 -#define IDM_OBJECTVERBLIST8 80 -#define IDM_OBJECTVERBLIST9 81 -#define IDM_OBJECTVERBLISTLAST IDM_OBJECTVERBLIST9 -#define IDM_CONVERTOBJECT 82 -#define IDM_CUSTOMCONTROL 83 -#define IDM_CUSTOMIZEITEM 84 -#define IDM_RENAME 85 -#define IDM_IMPORT 86 -#define IDM_NEWPAGE 87 -#define IDM_MOVE 88 -#define IDM_CANCEL 89 -#define IDM_FONT 90 -#define IDM_STRIKETHROUGH 91 -#define IDM_DELETEWORD 92 -#define IDM_EXECPRINT 93 -#define IDM_JUSTIFYNONE 94 - -#define IDM_BROWSEMODE 2126 -#define IDM_EDITMODE 2127 - -#endif - - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/DropTarget.cpp b/embedding/browser/activex/src/control/DropTarget.cpp deleted file mode 100644 index 49352dfb05a..00000000000 --- a/embedding/browser/activex/src/control/DropTarget.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include -#include - -#include "DropTarget.h" - -#ifndef CFSTR_SHELLURL -#define CFSTR_SHELLURL _T("UniformResourceLocator") -#endif - -#ifndef CFSTR_FILENAME -#define CFSTR_FILENAME _T("FileName") -#endif - -#ifndef CFSTR_FILENAMEW -#define CFSTR_FILENAMEW _T("FileNameW") -#endif - -static const UINT g_cfURL = RegisterClipboardFormat(CFSTR_SHELLURL); -static const UINT g_cfFileName = RegisterClipboardFormat(CFSTR_FILENAME); -static const UINT g_cfFileNameW = RegisterClipboardFormat(CFSTR_FILENAMEW); - -CDropTarget::CDropTarget() -{ - m_pOwner = NULL; -} - - -CDropTarget::~CDropTarget() -{ -} - - -void CDropTarget::SetOwner(CMozillaBrowser *pOwner) -{ - m_pOwner = pOwner; -} - - -HRESULT CDropTarget::GetURLFromFile(const TCHAR *pszFile, tstring &szURL) -{ - USES_CONVERSION; - CIPtr(IUniformResourceLocator) spUrl; - - // Let's see if the file is an Internet Shortcut... - HRESULT hr = CoCreateInstance (CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (void **) &spUrl); - if (spUrl == NULL) - { - return E_FAIL; - } - - // Get the IPersistFile interface - CIPtr(IPersistFile) spFile = spUrl; - if (spFile == NULL) - { - return E_FAIL; - } - - // Initialise the URL object from the filename - LPSTR lpTemp = NULL; - if (FAILED(spFile->Load(T2OLE(pszFile), STGM_READ)) || - FAILED(spUrl->GetURL(&lpTemp))) - { - return E_FAIL; - } - - // Free the memory - CIPtr(IMalloc) spMalloc; - if (FAILED(SHGetMalloc(&spMalloc))) - { - return E_FAIL; - } - - // Copy the URL & cleanup - szURL = A2T(lpTemp); - spMalloc->Free(lpTemp); - - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// IDropTarget implementation - -HRESULT STDMETHODCALLTYPE CDropTarget::DragEnter(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL || pDataObj == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - if (m_spDataObject != NULL) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - // TODO process Internet Shortcuts (*.URL) files - FORMATETC formatetc; - memset(&formatetc, 0, sizeof(formatetc)); - formatetc.dwAspect = DVASPECT_CONTENT; - formatetc.lindex = -1; - formatetc.tymed = TYMED_HGLOBAL; - - // Test if the data object contains a text URL format - formatetc.cfFormat = g_cfURL; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // Test if the data object contains a file name - formatetc.cfFormat = g_cfFileName; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // Test if the data object contains a wide character file name - formatetc.cfFormat = g_cfFileName; - if (pDataObj->QueryGetData(&formatetc) == S_OK) - { - m_spDataObject = pDataObj; - *pdwEffect = DROPEFFECT_LINK; - return S_OK; - } - - // If we got here, then the format is not supported - *pdwEffect = DROPEFFECT_NONE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::DragOver(/* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - *pdwEffect = m_spDataObject ? DROPEFFECT_LINK : DROPEFFECT_NONE; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::DragLeave(void) -{ - if (m_spDataObject) - { - m_spDataObject.Release(); - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CDropTarget::Drop(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect) -{ - if (pdwEffect == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - if (m_spDataObject == NULL) - { - *pdwEffect = DROPEFFECT_NONE; - return S_OK; - } - - *pdwEffect = DROPEFFECT_LINK; - - // Get the URL from the data object - BSTR bstrURL = NULL; - FORMATETC formatetc; - STGMEDIUM stgmedium; - memset(&formatetc, 0, sizeof(formatetc)); - memset(&stgmedium, 0, sizeof(formatetc)); - - formatetc.dwAspect = DVASPECT_CONTENT; - formatetc.lindex = -1; - formatetc.tymed = TYMED_HGLOBAL; - - // Does the data object contain a URL? - formatetc.cfFormat = g_cfURL; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - char *pszURL = (char *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("URL \"%s\" dragged over control\n", pszURL); - // Browse to the URL - if (m_pOwner) - { - USES_CONVERSION; - bstrURL = SysAllocString(A2OLE(pszURL)); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - - // Does the data object point to a file? - formatetc.cfFormat = g_cfFileName; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - USES_CONVERSION; - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - tstring szURL; - char *pszURLFile = (char *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("File \"%s\" dragged over control\n", pszURLFile); - if (SUCCEEDED(GetURLFromFile(A2T(pszURLFile), szURL))) - { - bstrURL = SysAllocString(T2OLE(szURL.c_str())); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - - // Does the data object point to a wide character file? - formatetc.cfFormat = g_cfFileNameW; - if (m_spDataObject->GetData(&formatetc, &stgmedium) == S_OK) - { - USES_CONVERSION; - NG_ASSERT(stgmedium.tymed == TYMED_HGLOBAL); - NG_ASSERT(stgmedium.hGlobal); - tstring szURL; - WCHAR *pszURLFile = (WCHAR *) GlobalLock(stgmedium.hGlobal); - NG_TRACE("File \"%s\" dragged over control\n", W2A(pszURLFile)); - if (SUCCEEDED(GetURLFromFile(W2T(pszURLFile), szURL))) - { - USES_CONVERSION; - bstrURL = SysAllocString(T2OLE(szURL.c_str())); - } - GlobalUnlock(stgmedium.hGlobal); - goto finish; - } - -finish: - // If we got a URL, browse there! - if (bstrURL) - { - m_pOwner->Navigate(bstrURL, NULL, NULL, NULL, NULL); - SysFreeString(bstrURL); - } - - ReleaseStgMedium(&stgmedium); - m_spDataObject.Release(); - - return S_OK; -} - diff --git a/embedding/browser/activex/src/control/DropTarget.h b/embedding/browser/activex/src/control/DropTarget.h deleted file mode 100644 index 0f81c53f366..00000000000 --- a/embedding/browser/activex/src/control/DropTarget.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef DROPTARGET_H -#define DROPTARGET_H - -#include "MozillaBrowser.h" - -// Simple drop target implementation - -class CDropTarget : public CComObjectRootEx, - public IDropTarget -{ -public: - CDropTarget(); - virtual ~CDropTarget(); - -BEGIN_COM_MAP(CDropTarget) - COM_INTERFACE_ENTRY(IDropTarget) -END_COM_MAP() - - // Data object currently being dragged - CIPtr(IDataObject) m_spDataObject; - - // Owner of this object - CMozillaBrowser *m_pOwner; - - // Sets the owner of this object - void SetOwner(CMozillaBrowser *pOwner); - // Helper method to extract a URL from an internet shortcut file - HRESULT CDropTarget::GetURLFromFile(const TCHAR *pszFile, tstring &szURL); - -// IDropTarget - virtual HRESULT STDMETHODCALLTYPE DragEnter(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); - virtual HRESULT STDMETHODCALLTYPE DragOver(/* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); - virtual HRESULT STDMETHODCALLTYPE DragLeave(void); - virtual HRESULT STDMETHODCALLTYPE Drop(/* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ DWORD __RPC_FAR *pdwEffect); -}; - -typedef CComObject CDropTargetInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/HelperAppDlg.cpp b/embedding/browser/activex/src/control/HelperAppDlg.cpp deleted file mode 100644 index 2573df322e8..00000000000 --- a/embedding/browser/activex/src/control/HelperAppDlg.cpp +++ /dev/null @@ -1,557 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include - -// commdlg.h is needed to build with WIN32_LEAN_AND_MEAN -#include - -#include "HelperAppDlg.h" - -#include "nsCOMPtr.h" -#include "nsIExternalHelperAppService.h" -#include "nsILocalFile.h" -#include "nsIMIMEInfo.h" - -#include "nsIHelperAppLauncherDialog.h" - -#include "nsNetError.h" - - -/////////////////////////////////////////////////////////////////////////////// - -class AppLauncherDlg -{ -public: - AppLauncherDlg(); - virtual ~AppLauncherDlg(); - - int Show(nsIHelperAppLauncher* aLauncher, HWND hwndParent); - - PRPackedBool mSaveToDisk; - nsCAutoString mOpenWith; - -private: - static INT_PTR CALLBACK LaunchProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - - void OnInitDialog(); - void OnOK(); - void OnCancel(); - void OnChooseApp(); - - HWND mHwndDlg; - nsCOMPtr mHelperAppLauncher; -}; - -AppLauncherDlg::AppLauncherDlg() : mHwndDlg(NULL), mSaveToDisk(TRUE) -{ -} - -AppLauncherDlg::~AppLauncherDlg() -{ -} - -int -AppLauncherDlg::Show(nsIHelperAppLauncher* aLauncher, HWND hwndParent) -{ - HINSTANCE hInstResource = _Module.m_hInstResource; - - mHelperAppLauncher = aLauncher; - - INT result = DialogBoxParam(hInstResource, - MAKEINTRESOURCE(IDD_HELPERAPP), hwndParent, LaunchProc, (LPARAM) this); - - return result; -} - -void AppLauncherDlg::OnInitDialog() -{ - USES_CONVERSION; - nsCOMPtr mimeInfo; - nsCAutoString url; - if (mHelperAppLauncher) - { - mHelperAppLauncher->GetMIMEInfo(getter_AddRefs(mimeInfo)); - nsCOMPtr uri; - mHelperAppLauncher->GetSource(getter_AddRefs(uri)); - uri->GetSpec(url); - } - nsHandlerInfoAction prefAction = nsIMIMEInfo::saveToDisk; - nsAutoString appName; - nsCAutoString contentType; - if (mimeInfo) - { - mimeInfo->GetPreferredAction(&prefAction); - nsCOMPtr handlerApp; - mimeInfo->GetPreferredApplicationHandler(getter_AddRefs(handlerApp)); - if (handlerApp) - { - handlerApp->GetName(appName); - } - mimeInfo->GetMIMEType(contentType); - } - if (prefAction == nsIMIMEInfo::saveToDisk) - { - CheckRadioButton(mHwndDlg, IDC_OPENWITHAPP, IDC_SAVETOFILE, IDC_SAVETOFILE); - } - else - { - CheckRadioButton(mHwndDlg, IDC_OPENWITHAPP, IDC_SAVETOFILE, IDC_OPENWITHAPP); - } - SetDlgItemText(mHwndDlg, IDC_URL, - url.IsEmpty() ? _T("") : A2CT(url.get())); - SetDlgItemText(mHwndDlg, IDC_APPLICATION, - appName.IsEmpty() ? _T("") : W2CT(appName.get())); - SetDlgItemText(mHwndDlg, IDC_CONTENTTYPE, - contentType.IsEmpty() ? _T("") : A2CT(contentType.get())); -} - -void AppLauncherDlg::OnOK() -{ - mSaveToDisk = IsDlgButtonChecked(mHwndDlg, IDC_SAVETOFILE) ? TRUE : FALSE; - EndDialog(mHwndDlg, IDOK); -} - -void AppLauncherDlg::OnCancel() -{ - EndDialog(mHwndDlg, IDCANCEL); -} - -void AppLauncherDlg::OnChooseApp() -{ - USES_CONVERSION; - - TCHAR szPath[MAX_PATH + 1]; - memset(szPath, 0, sizeof(szPath)); - - TCHAR *lpszFilter = - _T("EXE Files Only (*.exe)\0*.exe\0" - "All Files (*.*)\0*.*\0\0"); - - OPENFILENAME ofn; - memset(&ofn, 0, sizeof(ofn)); -#if _WIN32_WINNT >= 0x0500 - ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; -#else - ofn.lStructSize = sizeof(ofn); -#endif - ofn.Flags = OFN_FILEMUSTEXIST; - ofn.lpstrFilter = lpszFilter; - ofn.lpstrDefExt = _T("exe"); - ofn.lpstrFile = szPath; - ofn.nMaxFile = MAX_PATH; - - if (GetOpenFileName(&ofn)) - { - USES_CONVERSION; - mOpenWith = T2A(szPath); - SetDlgItemText(mHwndDlg, IDC_APPLICATION, szPath); - CheckRadioButton(mHwndDlg, IDC_OPENWITHAPP, IDC_SAVETOFILE, IDC_OPENWITHAPP); - } -} - -INT_PTR CALLBACK -AppLauncherDlg::LaunchProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - AppLauncherDlg *pThis = NULL; - if (uMsg == WM_INITDIALOG) - { - pThis = (AppLauncherDlg *) lParam; - NS_ASSERTION(pThis, "need a pointer to this!"); - pThis->mHwndDlg = hwndDlg; - SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); - } - else - { - pThis = (AppLauncherDlg *) GetWindowLongPtr(hwndDlg, DWLP_USER); - } - switch (uMsg) - { - case WM_INITDIALOG: - pThis->OnInitDialog(); - return TRUE; - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED) - { - NS_ASSERTION(pThis, "Should be non-null!"); - switch (LOWORD(wParam)) - { - case IDC_CHOOSE: - pThis->OnChooseApp(); - break; - case IDOK: - pThis->OnOK(); - break; - case IDCANCEL: - pThis->OnCancel(); - break; - } - } - return TRUE; - } - return FALSE; -} - -/////////////////////////////////////////////////////////////////////////////// - -//***************************************************************************** -// ProgressDlg -//***************************************************************************** - - -class ProgressDlg : - public nsIWebProgressListener, - public nsSupportsWeakReference -{ -public: - ProgressDlg(); - - void Show(nsIHelperAppLauncher *aHelperAppLauncher, HWND hwndParent); - -protected: - virtual ~ProgressDlg(); - - void OnInitDialog(); - void OnCancel(); - - static INT_PTR CALLBACK ProgressProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - - HWND mHwndDlg; - nsCOMPtr mHelperAppLauncher; - -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIWEBPROGRESSLISTENER -}; - - -ProgressDlg::ProgressDlg() -{ -} - -ProgressDlg::~ProgressDlg() -{ -} - -void -ProgressDlg::Show(nsIHelperAppLauncher *aHelperAppLauncher, HWND hwndParent) -{ - HINSTANCE hInstResource = _Module.m_hInstResource; - - mHelperAppLauncher = aHelperAppLauncher; - mHwndDlg = CreateDialogParam(hInstResource, MAKEINTRESOURCE(IDD_PROGRESS), - hwndParent, ProgressProc, (LPARAM) this); -} - - -NS_IMPL_ISUPPORTS2(ProgressDlg, nsIWebProgressListener, nsISupportsWeakReference) - -NS_IMETHODIMP -ProgressDlg::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, PRUint32 aStateFlags, - nsresult aStatus) -{ - if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_DOCUMENT)) - { - // We've completed the download - close the progress window - if(mHelperAppLauncher) - mHelperAppLauncher->CloseProgressWindow(); - - DestroyWindow(mHwndDlg); - } - - return NS_OK; -} - -NS_IMETHODIMP ProgressDlg::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, - PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) -{ - // Update the progress control - if (IsWindow(mHwndDlg)) - { - HWND hwndProgress = GetDlgItem(mHwndDlg, IDC_PROGRESS); - SendMessage(hwndProgress, PBM_SETRANGE32, 0, aMaxTotalProgress); - SendMessage(hwndProgress, PBM_SETPOS, aCurTotalProgress, 0); - } - - return NS_OK; -} - -NS_IMETHODIMP ProgressDlg::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsIURI *location) -{ - return NS_OK; -} - -NS_IMETHODIMP ProgressDlg::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsresult aStatus, - const PRUnichar *aMessage) -{ - return NS_OK; -} - -NS_IMETHODIMP ProgressDlg::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, PRUint32 state) -{ - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// - -INT_PTR CALLBACK -ProgressDlg::ProgressProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - ProgressDlg *pThis = NULL; - if (uMsg == WM_INITDIALOG) - { - pThis = (ProgressDlg *) lParam; - SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); - } - else - { - pThis = (ProgressDlg *) GetWindowLongPtr(hwndDlg, DWLP_USER); - } - switch (uMsg) - { - case WM_INITDIALOG: - NS_ASSERTION(pThis, "Should be non-null!"); - pThis->OnInitDialog(); - return TRUE; - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED) - { - NS_ASSERTION(pThis, "Should be non-null!"); - switch (LOWORD(wParam)) - { - case IDCANCEL: - pThis->OnCancel(); - break; - } - } - return TRUE; - } - - return FALSE; -} - -void ProgressDlg::OnInitDialog() -{ - // Set the "SavingFrom" field - if (mHelperAppLauncher) - { - nsCOMPtr srcUri; - nsresult rv = mHelperAppLauncher->GetSource(getter_AddRefs(srcUri)); - if(NS_SUCCEEDED(rv)) - { - USES_CONVERSION; - nsCAutoString uriString; - srcUri->GetSpec(uriString); - SetDlgItemText(mHwndDlg, IDC_SOURCE, A2CT(uriString.get())); - } - } - - // Set the "Action" field -// if(m_HandleContentOp == CONTENT_SAVE_TO_DISK) -// m_Action.SetWindowText("[Saving file to:] " + m_FileName); -// else if(m_HandleContentOp == CONTENT_LAUNCH_WITH_APP) -// m_Action.SetWindowText("[Opening file with:] " + m_FileName); -} - -void ProgressDlg::OnCancel() -{ - if (mHelperAppLauncher) - mHelperAppLauncher->Cancel(NS_BINDING_ABORTED); - DestroyWindow(mHwndDlg); -} - - - -/////////////////////////////////////////////////////////////////////////////// - -class CHelperAppLauncherDlgFactory : public nsIFactory -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIFACTORY - - CHelperAppLauncherDlgFactory(); - virtual ~CHelperAppLauncherDlgFactory(); -}; - -class CHelperAppLauncherDlg : - public nsIHelperAppLauncherDialog -{ -public: - CHelperAppLauncherDlg(); - -protected: - virtual ~CHelperAppLauncherDlg(); - -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIHELPERAPPLAUNCHERDIALOG - - friend class CHelperAppLauncherDlgFactory; -}; - -NS_IMPL_ISUPPORTS1(CHelperAppLauncherDlg, nsIHelperAppLauncherDialog) - -CHelperAppLauncherDlg::CHelperAppLauncherDlg() -{ -} - -CHelperAppLauncherDlg::~CHelperAppLauncherDlg() -{ -} - -/* void show (in nsIHelperAppLauncher aLauncher, in nsISupports aContext, in unsigned long aReason); */ -NS_IMETHODIMP -CHelperAppLauncherDlg::Show(nsIHelperAppLauncher *aLauncher, nsISupports *aContext, PRUint32 aReason) -{ - NS_ENSURE_ARG_POINTER(aLauncher); - - AppLauncherDlg dlg; - if (dlg.Show(aLauncher, NULL) == IDCANCEL) - { - aLauncher->Cancel(NS_BINDING_ABORTED); - return NS_OK; - } - - if (dlg.mSaveToDisk) - { - return aLauncher->SaveToDisk(nsnull, PR_FALSE); - } - else - { - nsCOMPtr openWith; - nsresult rv = NS_NewNativeLocalFile(dlg.mOpenWith, PR_FALSE, getter_AddRefs(openWith)); - return aLauncher->LaunchWithApplication(openWith, PR_FALSE); - } -} - -/* nsILocalFile promptForSaveToFile (in nsIHelperAppLauncher aLauncher, in nsISupports aWindowContext, in wstring aDefaultFile, in wstring aSuggestedFileExtension); */ -NS_IMETHODIMP -CHelperAppLauncherDlg::PromptForSaveToFile(nsIHelperAppLauncher *aLauncher, - nsISupports *aWindowContext, - const PRUnichar *aDefaultFile, - const PRUnichar *aSuggestedFileExtension, - PRBool aForcePrompt, - nsILocalFile **_retval) -{ - NS_ENSURE_ARG_POINTER(_retval); - USES_CONVERSION; - - TCHAR szPath[MAX_PATH + 1]; - memset(szPath, 0, sizeof(szPath)); - _tcsncpy(szPath, W2T(aDefaultFile), MAX_PATH); - - OPENFILENAME ofn; - memset(&ofn, 0, sizeof(ofn)); -#if _WIN32_WINNT >= 0x0500 - ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; -#else - ofn.lStructSize = sizeof(ofn); -#endif - ofn.Flags = OFN_OVERWRITEPROMPT; - ofn.lpstrFilter = _T("All Files (*.*)\0*.*\0\0"); - ofn.lpstrDefExt = W2T(aSuggestedFileExtension); - ofn.lpstrFile = szPath; - ofn.nMaxFile = MAX_PATH; - - if (GetSaveFileName(&ofn)) - { - return NS_NewNativeLocalFile(nsDependentCString(szPath), PR_FALSE, _retval); - } - - return NS_ERROR_FAILURE; -} - -//***************************************************************************** -// CHelperAppLauncherDlgFactory -//***************************************************************************** - -NS_IMPL_ISUPPORTS1(CHelperAppLauncherDlgFactory, nsIFactory) - -CHelperAppLauncherDlgFactory::CHelperAppLauncherDlgFactory() -{ -} - -CHelperAppLauncherDlgFactory::~CHelperAppLauncherDlgFactory() -{ -} - -NS_IMETHODIMP CHelperAppLauncherDlgFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - - *aResult = NULL; - CHelperAppLauncherDlg *inst = new CHelperAppLauncherDlg; - if (!inst) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = inst->QueryInterface(aIID, aResult); - if (rv != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } - return rv; -} - -NS_IMETHODIMP CHelperAppLauncherDlgFactory::LockFactory(PRBool lock) -{ - return NS_OK; -} - -nsresult NS_NewHelperAppLauncherDlgFactory(nsIFactory** aFactory) -{ - NS_ENSURE_ARG_POINTER(aFactory); - *aFactory = nsnull; - - CHelperAppLauncherDlgFactory *result = new CHelperAppLauncherDlgFactory; - if (!result) - return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(result); - *aFactory = result; - - return NS_OK; -} diff --git a/embedding/browser/activex/src/control/HelperAppDlg.h b/embedding/browser/activex/src/control/HelperAppDlg.h deleted file mode 100644 index cf0503083e4..00000000000 --- a/embedding/browser/activex/src/control/HelperAppDlg.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef HELPERAPPDLG_H -#define HELPERAPPDLG_H - -#include "nsError.h" - -class nsIFactory; - -extern nsresult NS_NewHelperAppLauncherDlgFactory(nsIFactory** aFactory); - -#endif diff --git a/embedding/browser/activex/src/control/IEHtmlDocument.cpp b/embedding/browser/activex/src/control/IEHtmlDocument.cpp deleted file mode 100644 index 11c720b5e20..00000000000 --- a/embedding/browser/activex/src/control/IEHtmlDocument.cpp +++ /dev/null @@ -1,1116 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" -#include "IEHtmlDocument.h" -#include "IEHtmlElementCollection.h" -#include "IEHtmlElement.h" - -#include "nsIDOMHTMLDocument.h" -#include "nsIDOMNSHTMLDocument.h" -#include "nsIDOMNSDocument.h" - -#include "MozillaBrowser.h" - -#include "IEHtmlSelectionObject.h" - -CIEHtmlDocument::CIEHtmlDocument() : - mControl(NULL) -{ -} - - -CIEHtmlDocument::~CIEHtmlDocument() -{ -} - - -void CIEHtmlDocument::SetParent(CMozillaBrowser *parent) -{ - mControl = parent; -} - - -void CIEHtmlDocument::SetNative(nsIDOMHTMLDocument *native) -{ - mDOMDocument = native; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLDocument methods - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_Script(IDispatch __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - -/////////////////////////////////////////////////////////////////////////////// -// IHTMLDocument2 methods - -struct HtmlPos -{ - CComQIPtr m_cpCollection; - long m_nPos; - - HtmlPos(IHTMLElementCollection *pCol, long nPos) : - m_cpCollection(pCol), - m_nPos(nPos) - { - } -}; - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_all(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromParentNode(this, TRUE, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_body(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - *p = NULL; - - nsCOMPtr bodyElement; - - mDOMDocument->GetBody(getter_AddRefs(bodyElement)); - if (bodyElement) - { - nsCOMPtr bodyNode = do_QueryInterface(bodyElement); - - // get or create com object: - CComPtr pNode; - HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(bodyNode, &pNode); - if (FAILED(hr)) - return hr; - if (FAILED(pNode->QueryInterface(IID_IHTMLElement, (void **)p))) - return E_UNEXPECTED; - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_activeElement(IHTMLElement __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_images(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsCOMPtr nodeList; - mDOMDocument->GetImages(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_applets(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsCOMPtr nodeList; - mDOMDocument->GetApplets(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_links(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsCOMPtr nodeList; - mDOMDocument->GetLinks(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_forms(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsCOMPtr nodeList; - mDOMDocument->GetForms(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_anchors(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - nsCOMPtr nodeList; - mDOMDocument->GetAnchors(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_title(BSTR v) -{ - if (mDOMDocument) - { - nsAutoString newTitle((PRUnichar *) v); - mDOMDocument->SetTitle(newTitle); - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_title(BSTR __RPC_FAR *p) -{ - nsAutoString value; - if (mDOMDocument == NULL || mDOMDocument->GetTitle(value)) - { - return E_FAIL; - } - *p = SysAllocString(value.get()); - return p ? S_OK : E_OUTOFMEMORY; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_scripts(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_designMode(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_designMode(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_selection(IHTMLSelectionObject __RPC_FAR *__RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - *p = NULL; - - // create com object: - CIEHtmlSelectionObjectInstance *pSelectionObject = NULL; - CIEHtmlSelectionObjectInstance::CreateInstance(&pSelectionObject); - if (!pSelectionObject) - return E_FAIL; - // get selection: - nsCOMPtr domWindow; - mControl->GetDOMWindow(getter_AddRefs(domWindow)); - if (!domWindow) - return E_FAIL; - nsCOMPtr selection; - domWindow->GetSelection(getter_AddRefs(selection)); - if (!selection) - return E_FAIL; - // gives the selection to the com object: - pSelectionObject->SetSelection(selection); - nsCOMPtr domDocumentRange = do_QueryInterface(mDOMDocument); - pSelectionObject->SetDOMDocumentRange(domDocumentRange); - // return com object: - pSelectionObject->QueryInterface(IID_IHTMLSelectionObject, (void **)p); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_readyState(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_frames(IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_embeds(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - *p = NULL; - - nsCOMPtr htmlDoc = do_QueryInterface(mDOMDocument); - if (!htmlDoc) - return E_FAIL; - - nsCOMPtr nodeList; - htmlDoc->GetEmbeds(getter_AddRefs(nodeList)); - - // Get all elements - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollection::CreateFromDOMHTMLCollection(this, nodeList, (CIEHtmlElementCollection **) &pCollection); - if (pCollection) - { - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_plugins(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - -#define IMPL_SET_COLOR(name, v) \ - CComVariant vStr; \ - if (FAILED(::VariantChangeType(&vStr, &v, 0, VT_BSTR))) \ - return E_INVALIDARG; \ - if (!mDOMDocument) \ - return E_UNEXPECTED; \ - nsCOMPtr htmlDoc = do_QueryInterface(mDOMDocument); \ - if (!htmlDoc) \ - return E_FAIL; \ - USES_CONVERSION; \ - nsAutoString val(OLE2W(vStr.bstrVal)); \ - htmlDoc->Set ## name(val); \ - return S_OK; - -#define IMPL_GET_COLOR(name, v) \ - if (p == NULL) return E_INVALIDARG; \ - if (!mDOMDocument) return E_UNEXPECTED; \ - nsCOMPtr htmlDoc = do_QueryInterface(mDOMDocument); \ - if (!htmlDoc) return E_FAIL; \ - USES_CONVERSION; \ - nsAutoString val; \ - htmlDoc->Get ## name(val); \ - p->vt = VT_BSTR; \ - p->bstrVal = ::SysAllocString(W2COLE(val.get())); \ - return S_OK; - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_alinkColor(VARIANT v) -{ - IMPL_SET_COLOR(AlinkColor, v); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_alinkColor(VARIANT __RPC_FAR *p) -{ - IMPL_GET_COLOR(AlinkColor, p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_bgColor(VARIANT v) -{ - IMPL_SET_COLOR(BgColor, v); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_bgColor(VARIANT __RPC_FAR *p) -{ - IMPL_GET_COLOR(BgColor, p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_fgColor(VARIANT v) -{ - IMPL_SET_COLOR(FgColor, v); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fgColor(VARIANT __RPC_FAR *p) -{ - IMPL_GET_COLOR(FgColor, p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_linkColor(VARIANT v) -{ - IMPL_SET_COLOR(LinkColor, v); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_linkColor(VARIANT __RPC_FAR *p) -{ - IMPL_GET_COLOR(LinkColor, p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_vlinkColor(VARIANT v) -{ - IMPL_SET_COLOR(VlinkColor, v); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_vlinkColor(VARIANT __RPC_FAR *p) -{ - IMPL_GET_COLOR(VlinkColor, p); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_referrer(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_location(IHTMLLocation __RPC_FAR *__RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_lastModified(BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - *p = NULL; - if (!mDOMDocument) - { - return E_UNEXPECTED; - } - nsCOMPtr doc = do_QueryInterface(mDOMDocument); - if (!doc) - { - return E_FAIL; - } - USES_CONVERSION; - nsAutoString val; - doc->GetLastModified(val); - *p = ::SysAllocString(W2COLE(val.get())); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_URL(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_URL(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_domain(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_domain(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_cookie(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_cookie(BSTR __RPC_FAR *p) -{ - if (!p) - return E_INVALIDARG; - *p = NULL; - - nsAutoString strCookie; - nsresult rv = mDOMDocument->GetCookie(strCookie); - NS_ENSURE_SUCCESS(rv,rv); - *p = SysAllocString(strCookie.get()); - return (*p) ? S_OK : E_OUTOFMEMORY; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_expando(VARIANT_BOOL v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_expando(VARIANT_BOOL __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_charset(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_charset(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_defaultCharset(BSTR v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_defaultCharset(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_mimeType(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileSize(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileCreatedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileModifiedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_fileUpdatedDate(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_security(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_protocol(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_nameProp(BSTR __RPC_FAR *p) -{ - *p = NULL; - return E_NOTIMPL; -} - - -HRESULT CIEHtmlDocument::WriteCommon(SAFEARRAY __RPC_FAR * psarray, int bLn) -{ - if (psarray->cDims != 1) - { - return E_INVALIDARG; - } - if (!(psarray->fFeatures & (FADF_BSTR | FADF_VARIANT))) - { - return E_INVALIDARG; - } - - HRESULT hr; - - hr = SafeArrayLock(psarray); - if (FAILED(hr)) - { - return hr; - } - - for (DWORD i = 0; i < psarray->rgsabound[0].cElements; i++) - { - nsAutoString str; - if (psarray->fFeatures & FADF_BSTR) - { - USES_CONVERSION; - BSTR *bstrArray = (BSTR *) psarray->pvData; - str = OLE2W(bstrArray[i]); - } - else if (psarray->fFeatures & FADF_VARIANT) - { - USES_CONVERSION; - VARIANT *vArray = (VARIANT *) psarray->pvData; - VARIANT vStr; - VariantInit(&vStr); - hr = VariantChangeType(&vStr, &vArray[i], 0, VT_BSTR); - if (FAILED(hr)) - { - SafeArrayUnlock(psarray); - return hr; - } - str = OLE2W(vStr.bstrVal); - VariantClear(&vStr); - } - - if (bLn && !i) - { - if (mDOMDocument->Writeln(str)) - { - SafeArrayUnlock(psarray); - return E_FAIL; - } - } - else - { - if (mDOMDocument->Write(str)) - { - SafeArrayUnlock(psarray); - return E_FAIL; - } - } - } - - hr = SafeArrayUnlock(psarray); - if (FAILED(hr)) - { - return hr; - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::write(SAFEARRAY __RPC_FAR * psarray) -{ - return WriteCommon(psarray, 0); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::writeln(SAFEARRAY __RPC_FAR * psarray) -{ - return WriteCommon(psarray, 1); -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::open(BSTR url, VARIANT name, VARIANT features, VARIANT replace, IDispatch __RPC_FAR *__RPC_FAR *pomWindowResult) -{ - if (mDOMDocument == NULL || mDOMDocument->Open()) - { - return E_FAIL; - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::close(void) -{ - if (mDOMDocument == NULL || mDOMDocument->Close()) - { - return E_FAIL; - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::clear(void) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::createElement(BSTR eTag, IHTMLElement __RPC_FAR *__RPC_FAR *newElem) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onhelp(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onhelp(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onclick(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_ondblclick(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_ondblclick(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeyup(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeyup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; - -} - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeydown(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeydown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onkeypress(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onkeypress(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseup(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseup(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmousedown(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmousedown(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmousemove(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmousemove(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseout(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseout(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onmouseover(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onmouseover(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onreadystatechange(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onreadystatechange(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onafterupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onafterupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onrowexit(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onrowexit(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onrowenter(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onrowenter(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_ondragstart(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_ondragstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onselectstart(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onselectstart(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::elementFromPoint(long x, long y, IHTMLElement __RPC_FAR *__RPC_FAR *elementHit) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_parentWindow(IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_styleSheets(IHTMLStyleSheetsCollection __RPC_FAR *__RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onbeforeupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onbeforeupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::put_onerrorupdate(VARIANT v) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::get_onerrorupdate(VARIANT __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::toString(BSTR __RPC_FAR *String) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::createStyleSheet(BSTR bstrHref, long lIndex, IHTMLStyleSheet __RPC_FAR *__RPC_FAR *ppnewStyleSheet) -{ - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IOleCommandTarget implementation - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText) -{ - HRESULT hr = E_NOTIMPL; - if(mControl) - { - hr = mControl->QueryStatus(pguidCmdGroup,cCmds,prgCmds,pCmdText); - } - return hr; -} - - -HRESULT STDMETHODCALLTYPE CIEHtmlDocument::Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) -{ - HRESULT hr = E_NOTIMPL; - if(mControl) - { - hr = mControl->Exec(pguidCmdGroup,nCmdID,nCmdexecopt,pvaIn,pvaOut); - } - return hr; -} - diff --git a/embedding/browser/activex/src/control/IEHtmlDocument.h b/embedding/browser/activex/src/control/IEHtmlDocument.h deleted file mode 100644 index 23c05109ecb..00000000000 --- a/embedding/browser/activex/src/control/IEHtmlDocument.h +++ /dev/null @@ -1,195 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef IEHTMLDOCUMENT_H -#define IEHTMLDOCUMENT_H - -#include "nsIDOMHTMLDocument.h" -#include "nsIDOMHTMLElement.h" - -#include "IEHtmlNode.h" - -class CMozillaBrowser; - -class CIEHtmlDocument : - public CNode, - public IDispatchImpl, - public IOleCommandTarget -{ -public: - CIEHtmlDocument(); -protected: - virtual ~CIEHtmlDocument(); - - // Pointer to browser that owns the document - CMozillaBrowser *mControl; - nsCOMPtr mDOMDocument; - - HRESULT WriteCommon(SAFEARRAY __RPC_FAR * psarray, int bLn); - -public: - virtual void SetParent(CMozillaBrowser *parent); - virtual void SetNative(nsIDOMHTMLDocument *native); - -BEGIN_COM_MAP(CIEHtmlDocument) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IHTMLDocument2) - COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument, IHTMLDocument2) - COM_INTERFACE_ENTRY_IID(IID_IHTMLDocument2, IHTMLDocument2) - COM_INTERFACE_ENTRY(IOleCommandTarget) -END_COM_MAP() - - // IOleCommandTarget methods - virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID __RPC_FAR *pguidCmdGroup, ULONG cCmds, OLECMD __RPC_FAR prgCmds[], OLECMDTEXT __RPC_FAR *pCmdText); - virtual HRESULT STDMETHODCALLTYPE Exec(const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut); - - // IHTMLDocument methods - virtual HRESULT STDMETHODCALLTYPE get_Script(IDispatch __RPC_FAR *__RPC_FAR *p); - - // IHTMLDocument2 methods - virtual HRESULT STDMETHODCALLTYPE get_all(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_body(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_activeElement(IHTMLElement __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_images(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_applets(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_links(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_forms(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_anchors(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_title(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_title(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_scripts(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_designMode(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_designMode(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_selection(IHTMLSelectionObject __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_readyState(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_frames(IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_embeds(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_plugins(IHTMLElementCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_alinkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_alinkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_bgColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_bgColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_fgColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_fgColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_linkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_linkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_vlinkColor(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_vlinkColor(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_referrer(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_location(IHTMLLocation __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_lastModified(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_URL(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_URL(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_domain(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_domain(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_cookie(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_cookie(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_expando(VARIANT_BOOL v); - virtual HRESULT STDMETHODCALLTYPE get_expando(VARIANT_BOOL __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_charset(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_charset(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_defaultCharset(BSTR v); - virtual HRESULT STDMETHODCALLTYPE get_defaultCharset(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_mimeType(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileSize(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileCreatedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileModifiedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_fileUpdatedDate(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_security(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_protocol(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_nameProp(BSTR __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE write(SAFEARRAY __RPC_FAR * psarray); - virtual HRESULT STDMETHODCALLTYPE writeln(SAFEARRAY __RPC_FAR * psarray); - virtual HRESULT STDMETHODCALLTYPE open(BSTR url, VARIANT name, VARIANT features, VARIANT replace, IDispatch __RPC_FAR *__RPC_FAR *pomWindowResult); - virtual HRESULT STDMETHODCALLTYPE close(void); - virtual HRESULT STDMETHODCALLTYPE clear(void); - virtual HRESULT STDMETHODCALLTYPE queryCommandSupported(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandEnabled(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandState(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandIndeterm(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE queryCommandText(BSTR cmdID, BSTR __RPC_FAR *pcmdText); - virtual HRESULT STDMETHODCALLTYPE queryCommandValue(BSTR cmdID, VARIANT __RPC_FAR *pcmdValue); - virtual HRESULT STDMETHODCALLTYPE execCommand(BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE execCommandShowHelp(BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet); - virtual HRESULT STDMETHODCALLTYPE createElement(BSTR eTag, IHTMLElement __RPC_FAR *__RPC_FAR *newElem); - virtual HRESULT STDMETHODCALLTYPE put_onhelp(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onhelp(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondblclick(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondblclick(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeyup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeyup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeydown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeydown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onkeypress(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onkeypress(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseup(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseup(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousedown(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousedown(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmousemove(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmousemove(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseout(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseout(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onmouseover(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onmouseover(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onreadystatechange(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onreadystatechange(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onafterupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onafterupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowexit(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowexit(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onrowenter(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onrowenter(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_ondragstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_ondragstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onselectstart(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onselectstart(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE elementFromPoint(long x, long y, IHTMLElement __RPC_FAR *__RPC_FAR *elementHit); - virtual HRESULT STDMETHODCALLTYPE get_parentWindow(IHTMLWindow2 __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get_styleSheets(IHTMLStyleSheetsCollection __RPC_FAR *__RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onbeforeupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onbeforeupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE put_onerrorupdate(VARIANT v); - virtual HRESULT STDMETHODCALLTYPE get_onerrorupdate(VARIANT __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE toString(BSTR __RPC_FAR *String); - virtual HRESULT STDMETHODCALLTYPE createStyleSheet(BSTR bstrHref, long lIndex, IHTMLStyleSheet __RPC_FAR *__RPC_FAR *ppnewStyleSheet); -}; - -typedef CComObject CIEHtmlDocumentInstance; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/Makefile.in b/embedding/browser/activex/src/control/Makefile.in deleted file mode 100644 index b000d63d68c..00000000000 --- a/embedding/browser/activex/src/control/Makefile.in +++ /dev/null @@ -1,113 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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/MPL/ -# -# 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 the Mozilla browser. -# -# The Initial Developer of the Original Code is -# Netscape Communications, Inc. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Adam Lock -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -LIBRARY_NAME = mozctl -RESFILE = MozillaControl.res -DEFFILE = L_mozctl.def -FORCE_SHARED_LIB= 1 - - -CPPSRCS = \ - StdAfx.cpp \ - MozillaControl.cpp \ - MozillaBrowser.cpp \ - WebBrowserContainer.cpp \ - IEHtmlDocument.cpp \ - DropTarget.cpp \ - PropertyDlg.cpp \ - PromptService.cpp \ - HelperAppDlg.cpp \ - WindowCreator.cpp \ - $(NULL) - - -EXTRA_DSO_LDOPTS = \ - $(DEPTH)/embedding/base/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \ - ../common/$(LIB_PREFIX)ax_common_s.$(LIB_SUFFIX) \ - $(MOZ_UNICHARUTIL_LIBS) \ - $(XPCOM_GLUE_LDOPTS) \ - $(XPCOM_FROZEN_LDOPTS) \ - $(NSPR_LIBS) \ - $(NULL) - -OS_LIBS += \ - comdlg32.lib \ - ole32.lib \ - oleaut32.lib \ - uuid.lib \ - shell32.lib \ - $(NULL) - -MIDL_GENERATED_FILES = MozillaControl_i.c MozillaControl.h -GARBAGE += $(DEFFILE) $(MIDL_GENERATED_FILES) done_gen - -ENABLE_CXX_EXCEPTIONS = 1 - -EMBED_MANIFEST_AT = 2 - -include $(topsrcdir)/config/rules.mk - -CXXFLAGS += -D "WIN32" -U "ClientWallet" -LDFLAGS += -SUBSYSTEM:windows -DLL - -ifdef MOZ_NO_DEBUG_RTL -DEFINES += -DMOZ_NO_DEBUG_RTL -endif - -DEFINES += -DMOZ_ACTIVEX_CONTROL_SUPPORT - -LOCAL_INCLUDES += -I. - -export:: $(DEFFILE) done_gen - -$(DEFFILE): mkctldef.sh - $(srcdir)/mkctldef.sh $@ - -done_gen: MozillaControl.idl - $(MIDL) $(MIDL_FLAGS) -Oicf -h MozillaControl.h -iid MozillaControl_i.c $(srcdir)/MozillaControl.idl - touch $@ - -$(MIDL_GENERATED_FILES): done_gen - diff --git a/embedding/browser/activex/src/control/Master.dsp b/embedding/browser/activex/src/control/Master.dsp deleted file mode 100644 index f99a2f56728..00000000000 --- a/embedding/browser/activex/src/control/Master.dsp +++ /dev/null @@ -1,97 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Master" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=Master - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "Master.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Master.mak" CFG="Master - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Master - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "Master - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "Master - Win32 Release" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f Master.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Master.exe" -# PROP BASE Bsc_Name "Master.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "nmake /f "Master.mak"" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Master.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "Master - Win32 Debug" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Master___Win32_Debug" -# PROP BASE Intermediate_Dir "Master___Win32_Debug" -# PROP BASE Cmd_Line "NMAKE /f Master.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Master.exe" -# PROP BASE Bsc_Name "Master.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Master___Win32_Debug" -# PROP Intermediate_Dir "Master___Win32_Debug" -# PROP Cmd_Line "nmake /f "Master.mak"" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Master.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "Master - Win32 Release" -# Name "Master - Win32 Debug" - -!IF "$(CFG)" == "Master - Win32 Release" - -!ELSEIF "$(CFG)" == "Master - Win32 Debug" - -!ENDIF - -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/embedding/browser/activex/src/control/Master.dsw b/embedding/browser/activex/src/control/Master.dsw deleted file mode 100644 index 5b5cb6ebabf..00000000000 --- a/embedding/browser/activex/src/control/Master.dsw +++ /dev/null @@ -1,92 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "IEPatcher"=..\..\tests\IEPatcher\IEPatcher.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "Master"=.\Master.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cbrowse - End Project Dependency - Begin Project Dependency - Project_Dep_Name MozillaControl - End Project Dependency - Begin Project Dependency - Project_Dep_Name IEPatcher - End Project Dependency - Begin Project Dependency - Project_Dep_Name RegMozCtl - End Project Dependency -}}} - -############################################################################### - -Project: "MozillaControl"=.\MozillaControl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "RegMozCtl"=..\..\tests\RegMozCtl\RegMozCtl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "cbrowse"=..\..\tests\cbrowse\cbrowse.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name MozillaControl - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/embedding/browser/activex/src/control/MozillaBrowser.cpp b/embedding/browser/activex/src/control/MozillaBrowser.cpp deleted file mode 100644 index ba86ec16554..00000000000 --- a/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ /dev/null @@ -1,2167 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" -#include -#include -#include -//#include -#include - -// commdlg.h is needed to build with WIN32_LEAN_AND_MEAN -#include - -#include "MozillaControl.h" -#include "MozillaBrowser.h" -#include "IEHtmlDocument.h" -#include "PropertyDlg.h" -#include "PageSetupDlg.h" -#include "PromptService.h" -#include "HelperAppDlg.h" -#include "WindowCreator.h" - -#include "nsNetUtil.h" -#include "nsCWebBrowser.h" -#include "nsIAtom.h" -#include "nsILocalFile.h" -#include "nsIWebBrowserPersist.h" -#include "nsIClipboardCommands.h" -#include "nsIProfile.h" -#include "nsIWidget.h" -#include "nsIWebBrowserFocus.h" -#include "nsAppDirectoryServiceDefs.h" -#include "nsIComponentRegistrar.h" - -#ifdef NS_PRINTING -#include "nsIPrintOptions.h" -#include "nsIWebBrowserPrint.h" -#endif - -#include "nsIDOMWindow.h" -#include "nsIDOMHTMLAnchorElement.h" -#include "nsIDOMNSDocument.h" - -#include "nsEmbedAPI.h" -#include "nsEmbedCID.h" - -#define HACK_NON_REENTRANCY -#ifdef HACK_NON_REENTRANCY -static HANDLE s_hHackedNonReentrancy = NULL; -#endif - -#define NS_PROMPTSERVICE_CID \ - {0xa2112d6a, 0x0e28, 0x421f, {0xb4, 0x6a, 0x25, 0xc0, 0xb3, 0x8, 0xcb, 0xd0}} - -#define NS_HELPERAPPLAUNCHERDIALOG_CID \ - {0xf68578eb, 0x6ec2, 0x4169, {0xae, 0x19, 0x8c, 0x62, 0x43, 0xf0, 0xab, 0xe1}} - -static NS_DEFINE_CID(kPromptServiceCID, NS_PROMPTSERVICE_CID); -static NS_DEFINE_CID(kHelperAppLauncherDialogCID, NS_HELPERAPPLAUNCHERDIALOG_CID); - -#ifdef NS_PRINTING -class PrintListener : public nsIWebProgressListener -{ - PRBool mComplete; -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIWEBPROGRESSLISTENER - - PrintListener(); - virtual ~PrintListener(); - - void WaitForComplete(); -}; -#endif - -class SimpleDirectoryProvider : - public nsIDirectoryServiceProvider -{ -public: - SimpleDirectoryProvider(); - BOOL IsValid() const; - - - NS_DECL_ISUPPORTS - NS_DECL_NSIDIRECTORYSERVICEPROVIDER - -protected: - virtual ~SimpleDirectoryProvider(); - - nsCOMPtr mApplicationRegistryDir; - nsCOMPtr mApplicationRegistryFile; - nsCOMPtr mUserProfileDir; -}; - -// Default page in design mode. The data protocol may or may not be supported -// so the scheme is checked before the page is loaded. - -static const char kDesignModeScheme[] = "data"; -static const OLECHAR kDesignModeURL[] = - L"data:text/html,

Mozilla Control

"; - -// Registry keys and values - -static const TCHAR kBrowserHelperObjectRegKey[] = - _T("Software\\Mozilla\\ActiveX Control\\Browser Helper Objects"); - - -// Some recent SDKs define these IOleCommandTarget groups, so they're -// postfixed with _Moz to prevent linker errors. - -GUID CGID_IWebBrowser_Moz = - { 0xED016940L, 0xBD5B, 0x11cf, {0xBA, 0x4E, 0x00, 0xC0, 0x4F, 0xD7, 0x08, 0x16} }; - -GUID CGID_MSHTML_Moz = - { 0xED016940L, 0xBD5B, 0x11cf, {0xBA, 0x4E, 0x00, 0xC0, 0x4F, 0xD7, 0x08, 0x16} }; - -///////////////////////////////////////////////////////////////////////////// -// CMozillaBrowser - - -nsTArray CMozillaBrowser::sBrowserList; - -// -// Constructor -// -CMozillaBrowser::CMozillaBrowser() -{ - NG_TRACE_METHOD(CMozillaBrowser::CMozillaBrowser); - - // ATL flags ensures the control opens with a window - m_bWindowOnly = TRUE; - m_bWndLess = FALSE; - - // Initialize layout interfaces - mWebBrowserAsWin = nsnull; - mValidBrowserFlag = FALSE; - - // Create the container that handles some things for us - mWebBrowserContainer = NULL; - - // Control starts off in non-edit mode - mEditModeFlag = FALSE; - - // Control starts off without being a drop target - mHaveDropTargetFlag = FALSE; - - // the IHTMLDocument, lazy allocation. - mIERootDocument = NULL; - - // Browser helpers - mBrowserHelperList = NULL; - mBrowserHelperListCount = 0; - - // Name of the default profile to use - mProfileName.Assign(NS_LITERAL_STRING("MozillaControl")); - - // Initialise the web browser - Initialize(); -} - - -// -// Destructor -// -CMozillaBrowser::~CMozillaBrowser() -{ - NG_TRACE_METHOD(CMozillaBrowser::~CMozillaBrowser); - - // Close the web browser - Terminate(); -} - -// See bug 127982: -// -// Microsoft's InlineIsEqualGUID global function is multiply defined -// in ATL and/or SDKs with varying namespace requirements. To save the control -// from future grief, this method is used instead. -static inline BOOL _IsEqualGUID(REFGUID rguid1, REFGUID rguid2) -{ - return ( - ((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] && - ((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] && - ((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] && - ((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]); -} - -STDMETHODIMP CMozillaBrowser::InterfaceSupportsErrorInfo(REFIID riid) -{ - static const IID* arr[] = - { - &IID_IWebBrowser, - &IID_IWebBrowser2, - &IID_IWebBrowserApp - }; - for (int i = 0; i < (sizeof(arr) / sizeof(arr[0])); i++) - { - if (_IsEqualGUID(*arr[i], riid)) - return S_OK; - } - return S_FALSE; -} - -// -// ShowContextMenu -// -void CMozillaBrowser::ShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) -{ - POINT pt; - GetCursorPos(&pt); - - // Give the client application the chance to show its own menu - // in place of the one the control is about to show. - - CIPtr(IDocHostUIHandler) spIDocHostUIHandler = m_spClientSite; - if (spIDocHostUIHandler) - { - enum IE4MenuContexts - { - ctxMenuDefault = 0, - ctxMenuImage, - ctxMenuControl, - ctxMenuTable, - ctxMenuDebug, - ctxMenu1DSelect, - ctxMenuAnchor, - ctxMenuImgDynSrc - }; - - DWORD dwID = ctxMenuDefault; - if (aContextFlags & nsIContextMenuListener::CONTEXT_DOCUMENT) - { - dwID = ctxMenuDefault; - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_LINK) - { - dwID = ctxMenuAnchor; - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_IMAGE) - { - dwID = ctxMenuImage; - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_TEXT) - { - dwID = ctxMenu1DSelect; - } - else - { - dwID = ctxMenuDefault; - } - - HRESULT hr = spIDocHostUIHandler->ShowContextMenu(dwID, &pt, NULL, NULL); - if (hr == S_OK) - { - // Client handled menu - return; - } - } - - LPTSTR pszMenuResource = NULL; - if (aContextFlags & nsIContextMenuListener::CONTEXT_DOCUMENT) - { - pszMenuResource = MAKEINTRESOURCE(IDR_POPUP_DOCUMENT); - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_LINK) - { - pszMenuResource = MAKEINTRESOURCE(IDR_POPUP_LINK); - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_IMAGE) - { - pszMenuResource = MAKEINTRESOURCE(IDR_POPUP_IMAGE); - } - else if (aContextFlags & nsIContextMenuListener::CONTEXT_TEXT) - { - pszMenuResource = MAKEINTRESOURCE(IDR_POPUP_TEXT); - } - else - { - pszMenuResource = MAKEINTRESOURCE(IDR_POPUP_DOCUMENT); - } - - if (pszMenuResource) - { - HMENU hMenu = LoadMenu(_Module.m_hInstResource, pszMenuResource); - HMENU hPopupMenu = GetSubMenu(hMenu, 0); - mContextNode = do_QueryInterface(aNode); - UINT nCmd = TrackPopupMenu(hPopupMenu, TPM_NONOTIFY | TPM_RETURNCMD, pt.x, pt.y, 0, m_hWnd, NULL); - DestroyMenu(hMenu); - if (nCmd != 0) - { - SendMessage(WM_COMMAND, nCmd); - } - mContextNode = nsnull; - } -} - - -// -// ShowURIPropertyDlg -// -void CMozillaBrowser::ShowURIPropertyDlg(const nsAString &aURI, const nsAString &aContentType) -{ - CPropertyDlg dlg; - CPPageDlg linkDlg; - dlg.AddPage(&linkDlg); - - if (!aURI.IsEmpty()) - { - linkDlg.mType = aContentType; - linkDlg.mURL = aURI; - } - - dlg.DoModal(); -} - - -// -// Displays a message box to the user. If the container provides -// a IDocHostShowUI interface we use that to display messages, otherwise -// a simple message box is shown. -// -int CMozillaBrowser::MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, UINT nType) -{ - // Let the doc host display its own message box if it can - CIPtr(IDocHostShowUI) spIDocHostShowUI = m_spClientSite; - if (spIDocHostShowUI) - { - USES_CONVERSION; - LRESULT lResult = 0; - HRESULT hr = spIDocHostShowUI->ShowMessage(m_hWnd, - T2OLE(lpszText), T2OLE(lpszCaption), nType, NULL, 0, &lResult); - if (hr == S_OK) - { - return lResult; - } - } - - // Do the default message box - return CWindow::MessageBox(lpszText, lpszCaption, nType); -} - - -// -// Sets the startup error message from a resource string -// -HRESULT CMozillaBrowser::SetStartupErrorMessage(UINT nStringID) -{ - TCHAR szMsg[1024]; - ::LoadString(_Module.m_hInstResource, nStringID, szMsg, sizeof(szMsg) / sizeof(szMsg[0])); - mStartupErrorMessage = szMsg; - return S_OK; -} - -// -// Tells the container to change focus to the next control in the dialog. -// -void CMozillaBrowser::NextDlgControl() -{ - HWND hwndParent = GetParent(); - if (::IsWindow(hwndParent)) - { - ::PostMessage(hwndParent, WM_NEXTDLGCTL, 0, 0); - } -} - - -// -// Tells the container to change focus to the previous control in the dialog. -// -void CMozillaBrowser::PrevDlgControl() -{ - HWND hwndParent = GetParent(); - if (::IsWindow(hwndParent)) - { - ::PostMessage(hwndParent, WM_NEXTDLGCTL, 1, 0); - } -} - - -/////////////////////////////////////////////////////////////////////////////// -// Message handlers - - -// Handle WM_CREATE windows message -LRESULT CMozillaBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCreate); - - // Create the web browser - CreateBrowser(); - - // TODO create and register a drop target - - // Control is ready - mBrowserReadyState = READYSTATE_COMPLETE; - FireOnChanged(DISPID_READYSTATE); - - // Load browser helpers - LoadBrowserHelpers(); - - // Browse to a default page - if in design mode - BOOL bUserMode = FALSE; - if (SUCCEEDED(GetAmbientUserMode(bUserMode))) - { - if (!bUserMode) - { - // Load a page in design mode if the specified page is supported - nsCOMPtr ios = do_GetIOService(); - if (ios) - { - // Ensure design page can be loaded by checking for a - // registered protocol handler that supports the scheme - nsCOMPtr ph; - nsCAutoString phScheme; - ios->GetProtocolHandler(kDesignModeScheme, getter_AddRefs(ph)); - if (ph && - NS_SUCCEEDED(ph->GetScheme(phScheme)) && - phScheme.Equals(NS_LITERAL_CSTRING(kDesignModeScheme))) - { - Navigate(const_cast(kDesignModeURL), NULL, NULL, NULL, NULL); - } - } - } - else - { - if (mInitialSrc.Length() > 0) - { - Navigate(mInitialSrc, NULL, NULL, NULL, NULL); - } - } - } - - // Clip the child windows out of paint operations - SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_CLIPCHILDREN | WS_TABSTOP); - - return 0; -} - - -// Handle WM_DESTROY window message -LRESULT CMozillaBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnDestroy); - - // Unload browser helpers - UnloadBrowserHelpers(); - - // Clean up the browser - DestroyBrowser(); - - return 0; -} - - -// Handle WM_SIZE windows message -LRESULT CMozillaBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSize); - - RECT rc; - rc.top = 0; - rc.left = 0; - rc.right = LOWORD(lParam); - rc.bottom = HIWORD(lParam); - - AdjustWindowRectEx(&rc, GetWindowLong(GWL_STYLE), FALSE, GetWindowLong(GWL_EXSTYLE)); - - rc.right -= rc.left; - rc.bottom -= rc.top; - rc.left = 0; - rc.top = 0; - - // Pass resize information down to the browser... - if (mWebBrowserAsWin) - { - mWebBrowserAsWin->SetPosition(rc.left, rc.top); - mWebBrowserAsWin->SetSize(rc.right - rc.left, rc.bottom - rc.top, PR_TRUE); - } - return 0; -} - -// Handle WM_SETFOCUS -LRESULT CMozillaBrowser::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - ATLTRACE(_T("CMozillaBrowser::OnSetFocus()\n")); - nsCOMPtr browserAsFocus = do_QueryInterface(mWebBrowser); - if (browserAsFocus) - { - browserAsFocus->Activate(); - } - CComQIPtr controlSite = m_spClientSite; - if (controlSite) - { - controlSite->OnFocus(TRUE); - } - return 0; -} - -// Handle WM_KILLFOCUS -LRESULT CMozillaBrowser::OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - ATLTRACE(_T("CMozillaBrowser::OnKillFocus()\n")); - nsCOMPtr browserAsFocus = do_QueryInterface(mWebBrowser); - if (browserAsFocus) - { - browserAsFocus->Deactivate(); - } - CComQIPtr controlSite = m_spClientSite; - if (controlSite) - { - controlSite->OnFocus(FALSE); - } - return 0; -} - -// Handle WM_MOUSEACTIVATE messages -LRESULT CMozillaBrowser::OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - return MA_ACTIVATE; -} - -// Handle WM_GETDLGCODE to receive keyboard presses -LRESULT CMozillaBrowser::OnGetDlgCode(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - return DLGC_WANTALLKEYS; -} - -// Handle WM_PAINT windows message (and IViewObject::Draw) -HRESULT CMozillaBrowser::OnDraw(ATL_DRAWINFO& di) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnDraw); - - if (!BrowserIsValid()) - { - RECT& rc = *(RECT*)di.prcBounds; - DrawText(di.hdcDraw, mStartupErrorMessage.c_str(), -1, &rc, DT_TOP | DT_LEFT | DT_WORDBREAK); - } - - return S_OK; -} - -// Handle ID_PAGESETUP command -LRESULT CMozillaBrowser::OnPageSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPageSetup); - - -#ifdef NS_PRINTING - nsCOMPtr print(do_GetInterface(mWebBrowser)); - nsCOMPtr printSettings; - if(!print || - NS_FAILED(print->GetGlobalPrintSettings(getter_AddRefs(printSettings)))) - { - return 0; - } - - // show the page setup dialog - CPageSetupDlg dlg(printSettings); - dlg.DoModal(); -#endif - - return 0; -} - -// Handle ID_PRINT command -LRESULT CMozillaBrowser::OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPrint); - if (!BrowserIsValid()) - { - return 0; - } - PrintDocument(TRUE); - return 0; -} - -LRESULT CMozillaBrowser::OnSaveAs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSaveAs); - - OPENFILENAME SaveFileName; - - char szFile[_MAX_PATH]; - char szFileTitle[256]; - - //TODO: The IE control allows you to also save as "Web Page, complete" - // where all of the page's images are saved in the same directory. - // For the moment, we're not allowing this option. - - memset(&SaveFileName, 0, sizeof(SaveFileName)); - SaveFileName.lStructSize = sizeof(SaveFileName); - SaveFileName.hwndOwner = m_hWnd; - SaveFileName.lpstrFilter = "Web Page, HTML Only (*.htm;*.html)\0*.htm;*.html\0Text File (*.txt)\0*.txt\0"; - SaveFileName.nFilterIndex = 1; - SaveFileName.lpstrFile = szFile; - SaveFileName.nMaxFile = sizeof(szFile); - SaveFileName.lpstrFileTitle = szFileTitle; - SaveFileName.nMaxFileTitle = sizeof(szFileTitle); - SaveFileName.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; - SaveFileName.lpstrDefExt = "htm"; - - //Get the title of the current web page to set as the default filename. - char szTmp[_MAX_FNAME] = "untitled"; - BSTR pageName = NULL; - get_LocationName(&pageName); // Page title - if (pageName) - { - USES_CONVERSION; - strncpy(szTmp, OLE2A(pageName), sizeof(szTmp) - 1); - SysFreeString(pageName); - szTmp[sizeof(szTmp) - 1] = '\0'; - } - - // The SaveAs dialog will fail if szFile contains any "bad" characters. - // This hunk of code attempts to mimick the IE way of replacing "bad" - // characters with "good" characters. - int j = 0; - for (int i=0; szTmp[i]!='\0'; i++) - { - switch(szTmp[i]) - { - case '\\': - case '*': - case '|': - case ':': - case '"': - case '>': - case '<': - case '?': - break; - case '.': - if (szTmp[i+1] != '\0') - { - szFile[j] = '_'; - j++; - } - break; - case '/': - szFile[j] = '-'; - j++; - break; - default: - szFile[j] = szTmp[i]; - j++; - } - } - szFile[j] = '\0'; - - HRESULT hr = S_OK; - if (GetSaveFileName(&SaveFileName)) - { - nsCOMPtr persist(do_QueryInterface(mWebBrowser)); - USES_CONVERSION; - - char szDataFile[_MAX_PATH]; - char szDataPath[_MAX_PATH]; - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - char fname[_MAX_FNAME]; - char ext[_MAX_EXT]; - - _splitpath(szFile, drive, dir, fname, ext); - sprintf(szDataFile, "%s_files", fname); - _makepath(szDataPath, drive, dir, szDataFile, ""); - - nsCOMPtr file; - NS_NewNativeLocalFile(nsDependentCString(T2A(szFile)), TRUE, getter_AddRefs(file)); - - nsCOMPtr dataPath; - NS_NewNativeLocalFile(nsDependentCString(szDataPath), TRUE, getter_AddRefs(dataPath)); - - persist->SaveDocument(nsnull, file, dataPath, nsnull, 0, 0); - } - - return hr; -} - -LRESULT CMozillaBrowser::OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnProperties); - MessageBox(_T("No Properties Yet!"), _T("Control Message"), MB_OK); - // TODO show the properties dialog - return 0; -} - -LRESULT CMozillaBrowser::OnCut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCut); - nsCOMPtr clipboard(do_GetInterface(mWebBrowser)); - if (clipboard) - { - clipboard->CutSelection(); - } - return 0; -} - -LRESULT CMozillaBrowser::OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnCopy); - nsCOMPtr clipboard(do_GetInterface(mWebBrowser)); - if (clipboard) - { - clipboard->CopySelection(); - } - return 0; -} - -LRESULT CMozillaBrowser::OnPaste(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnPaste); - nsCOMPtr clipboard(do_GetInterface(mWebBrowser)); - if (clipboard) - { - clipboard->Paste(); - } - return 0; -} - -LRESULT CMozillaBrowser::OnSelectAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnSelectAll); - nsCOMPtr clipboard(do_GetInterface(mWebBrowser)); - if (clipboard) - { - clipboard->SelectAll(); - } - return 0; -} - -// Handle ID_VIEWSOURCE command -LRESULT CMozillaBrowser::OnViewSource(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnViewSource); - - if (!mWebBrowser) - { - // No webbrowser to view! - NG_ASSERT(0); - return 0; - } - - nsCOMPtr webNav = do_QueryInterface(mWebBrowser); - if (!webNav) - { - // No webnav! - NG_ASSERT(0); - return 0; - } - - nsCOMPtr uri; - webNav->GetCurrentURI(getter_AddRefs(uri)); - if (!uri) - { - // No URI to view! - NG_ASSERT(0); - return 0; - } - - // Get the current URI - nsCAutoString aURI; - uri->GetSpec(aURI); - - NS_ConvertUTF8toUTF16 strURI(aURI); - strURI.Insert(NS_LITERAL_STRING("view-source:"), 0); - - // Ask the client to create a window to view the source in - CIPtr(IDispatch) spDispNew; - VARIANT_BOOL bCancel = VARIANT_FALSE; - Fire_NewWindow2(&spDispNew, &bCancel); - - // Load the view-source into a new url - if ((bCancel == VARIANT_FALSE) && spDispNew) - { - CIPtr(IWebBrowser2) spOther = spDispNew;; - if (spOther) - { - // tack in the viewsource command - CComBSTR bstrURL(strURI.get()); - CComVariant vURL(bstrURL); - VARIANT vNull; - vNull.vt = VT_NULL; - spOther->Navigate2(&vURL, &vNull, &vNull, &vNull, &vNull); - } - } - - return 0; -} - - -/////////////////////////////////////////////////////////////////////////////// -// Document handlers - - -LRESULT CMozillaBrowser::OnDocumentBack(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - GoBack(); - return 0; -} - - -LRESULT CMozillaBrowser::OnDocumentForward(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - GoForward(); - return 0; -} - - -LRESULT CMozillaBrowser::OnDocumentPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - return OnPrint(wNotifyCode, wID, hWndCtl, bHandled); -} - - -LRESULT CMozillaBrowser::OnDocumentRefresh(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - Refresh(); - return 0; -} - - -LRESULT CMozillaBrowser::OnDocumentProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - nsCOMPtr ownerDoc; - if (mContextNode) - { - mContextNode->GetOwnerDocument(getter_AddRefs(ownerDoc)); - } - - // Get the document URL - nsAutoString uri; - nsCOMPtr htmlDoc = do_QueryInterface(ownerDoc); - if (htmlDoc) - { - htmlDoc->GetURL(uri); - } - nsAutoString contentType; - nsCOMPtr doc = do_QueryInterface(ownerDoc); - if (doc) - { - doc->GetContentType(contentType); - } - - ShowURIPropertyDlg(uri, contentType); - - return 0; -} - - -/////////////////////////////////////////////////////////////////////////////// -// Link handlers - - -LRESULT CMozillaBrowser::OnLinkOpen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - nsAutoString uri; - - nsCOMPtr anchorElement = do_QueryInterface(mContextNode); - if (anchorElement) - { - anchorElement->GetHref(uri); - } - - if (!uri.IsEmpty()) - { - CComBSTR bstrURI(uri.get()); - CComVariant vFlags(0); - Navigate(bstrURI, &vFlags, NULL, NULL, NULL); - } - - return 0; -} - - -LRESULT CMozillaBrowser::OnLinkOpenInNewWindow(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - nsAutoString uri; - - nsCOMPtr anchorElement = do_QueryInterface(mContextNode); - if (anchorElement) - { - anchorElement->GetHref(uri); - } - - if (!uri.IsEmpty()) - { - CComBSTR bstrURI(uri.get()); - CComVariant vFlags(navOpenInNewWindow); - Navigate(bstrURI, &vFlags, NULL, NULL, NULL); - } - - return 0; -} - - -LRESULT CMozillaBrowser::OnLinkCopyShortcut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - nsAutoString uri; - - nsCOMPtr anchorElement = do_QueryInterface(mContextNode); - if (anchorElement) - { - anchorElement->GetHref(uri); - } - - if (!uri.IsEmpty() && OpenClipboard()) - { - EmptyClipboard(); - - NS_ConvertUTF16toUTF8 curi(uri); - const char *stringText; - PRUint32 stringLen = NS_CStringGetData(curi, - &stringText); - - // CF_TEXT - HGLOBAL hmemText = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, - stringLen + 1); - char *pszText = (char *) GlobalLock(hmemText); - strncpy(pszText, stringText, stringLen); - pszText[stringLen] = '\0'; - GlobalUnlock(hmemText); - SetClipboardData(CF_TEXT, hmemText); - - // UniformResourceLocator - CFSTR_SHELLURL - const UINT cfShellURL = RegisterClipboardFormat(CFSTR_SHELLURL); - HGLOBAL hmemURL = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, - stringLen + 1); - char *pszURL = (char *) GlobalLock(hmemURL); - strncpy(pszText, stringText, stringLen); - pszText[stringLen] = '\0'; - GlobalUnlock(hmemURL); - SetClipboardData(cfShellURL, hmemURL); - - // TODO - // FileContents - CFSTR_FILECONTENTS - // FileGroupDescriptor - CFSTR_FILEDESCRIPTORA - // FileGroupDescriptorW - CFSTR_FILEDESCRIPTORW - - CloseClipboard(); - } - return 0; -} - - -LRESULT CMozillaBrowser::OnLinkProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - nsAutoString uri; - nsAutoString type; - - nsCOMPtr anchorElement = do_QueryInterface(mContextNode); - if (anchorElement) - { - anchorElement->GetHref(uri); - anchorElement->GetType(type); // How many anchors implement this I wonder - } - - ShowURIPropertyDlg(uri, type); - - return 0; -} - - -/////////////////////////////////////////////////////////////////////////////// - -// Initialises the web browser engine -HRESULT CMozillaBrowser::Initialize() -{ -#ifdef HACK_NON_REENTRANCY - // Attempt to open a named event for this process. If it's not there we - // know this is the first time the control has run in this process, so create - // the named event and do the initialisation. Otherwise do nothing. - TCHAR szHackEvent[255]; - _stprintf(szHackEvent, _T("MozCtlEvent%d"), (int) GetCurrentProcessId()); - s_hHackedNonReentrancy = OpenEvent(EVENT_ALL_ACCESS, FALSE, szHackEvent); - if (s_hHackedNonReentrancy == NULL) - { - s_hHackedNonReentrancy = CreateEvent(NULL, FALSE, FALSE, szHackEvent); -#endif - - // Extract the bin directory path from the control's filename - TCHAR szMozCtlPath[MAX_PATH]; - memset(szMozCtlPath, 0, sizeof(szMozCtlPath)); - GetModuleFileName(_Module.m_hInst, szMozCtlPath, sizeof(szMozCtlPath) / sizeof(szMozCtlPath[0])); - - TCHAR szTmpDrive[_MAX_DRIVE]; - TCHAR szTmpDir[_MAX_DIR]; - TCHAR szTmpFname[_MAX_FNAME]; - TCHAR szTmpExt[_MAX_EXT]; - TCHAR szBinDirPath[MAX_PATH]; - - _tsplitpath(szMozCtlPath, szTmpDrive, szTmpDir, szTmpFname, szTmpExt); - memset(szBinDirPath, 0, sizeof(szBinDirPath)); - _tmakepath(szBinDirPath, szTmpDrive, szTmpDir, NULL, NULL); - if (_tcslen(szBinDirPath) == 0) - { - return E_FAIL; - } - - // Create a simple directory provider. If this fails because the directories are - // invalid or whatever then the control will fallback on the default directory - // provider. - - nsCOMPtr directoryProvider; - SimpleDirectoryProvider *pDirectoryProvider = new SimpleDirectoryProvider; - if (pDirectoryProvider->IsValid()) - directoryProvider = do_QueryInterface(pDirectoryProvider); - - // Create an object to represent the path - nsresult rv; - nsCOMPtr binDir; - USES_CONVERSION; - NS_NewNativeLocalFile(nsDependentCString(T2A(szBinDirPath)), TRUE, getter_AddRefs(binDir)); - rv = NS_InitEmbedding(binDir, directoryProvider); - - // Load preferences service - mPrefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); - if (NS_FAILED(rv)) - { - NG_ASSERT(0); - NG_TRACE_ALWAYS(_T("Could not create preference object rv=%08x\n"), (int) rv); - SetStartupErrorMessage(IDS_CANNOTCREATEPREFS); - return E_FAIL; - } - - // Stuff in here only needs to be done once - static BOOL bRegisterComponents = FALSE; - if (!bRegisterComponents) - { - // Register our own native prompting service for message boxes, login - // prompts etc. - nsCOMPtr promptFactory; - rv = NS_NewPromptServiceFactory(getter_AddRefs(promptFactory)); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr registrar; - rv = NS_GetComponentRegistrar(getter_AddRefs(registrar)); - if (NS_FAILED(rv)) return rv; - - rv = registrar->RegisterFactory(kPromptServiceCID, - "Prompt Service", - NS_PROMPTSERVICE_CONTRACTID, - promptFactory); - if (NS_FAILED(rv)) return rv; - - // Helper app launcher dialog - nsCOMPtr helperAppDlgFactory; - rv = NS_NewHelperAppLauncherDlgFactory(getter_AddRefs(helperAppDlgFactory)); - if (NS_FAILED(rv)) return rv; - - rv = registrar->RegisterFactory(kHelperAppLauncherDialogCID, - "Helper App Launcher Dialog", - "@mozilla.org/helperapplauncherdialog;1", - helperAppDlgFactory); - if (NS_FAILED(rv)) return rv; - - // create our local object - CWindowCreator *creator = new CWindowCreator(); - nsCOMPtr windowCreator; - windowCreator = static_cast(creator); - - // Attach it via the watcher service - nsCOMPtr watcher = - do_GetService(NS_WINDOWWATCHER_CONTRACTID); - if (watcher) - watcher->SetWindowCreator(windowCreator); - } - - // Set the profile which the control will use - nsCOMPtr profileService = - do_GetService(NS_PROFILE_CONTRACTID, &rv); - if (NS_FAILED(rv)) - { - return E_FAIL; - } - - // Make a new default profile - PRBool profileExists = PR_FALSE; - rv = profileService->ProfileExists(mProfileName.get(), &profileExists); - if (NS_FAILED(rv)) - { - return E_FAIL; - } - else if (!profileExists) - { - rv = profileService->CreateNewProfile(mProfileName.get(), nsnull, nsnull, PR_FALSE); - if (NS_FAILED(rv)) - { - return E_FAIL; - } - } - - rv = profileService->SetCurrentProfile(mProfileName.get()); - if (NS_FAILED(rv)) - { - return E_FAIL; - } - -#ifdef HACK_NON_REENTRANCY - } -#endif - - return S_OK; -} - -// Terminates the web browser engine -HRESULT CMozillaBrowser::Terminate() -{ -#ifdef HACK_NON_REENTRANCY - if (0) - { -#endif - - mPrefBranch = nsnull; - NS_TermEmbedding(); - -#ifdef HACK_NON_REENTRANCY - } -#endif - - return S_OK; -} - - -// Create and initialise the web browser -HRESULT CMozillaBrowser::CreateBrowser() -{ - NG_TRACE_METHOD(CMozillaBrowser::CreateBrowser); - - if (mWebBrowser != nsnull) - { - NG_ASSERT(0); - NG_TRACE_ALWAYS(_T("CreateBrowser() called more than once!")); - return SetErrorInfo(E_UNEXPECTED); - } - - RECT rcLocation; - GetClientRect(&rcLocation); - if (IsRectEmpty(&rcLocation)) - { - rcLocation.bottom++; - rcLocation.top++; - } - - nsresult rv; - - // Create the web browser - mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv); - if (NS_FAILED(rv)) - { - NG_ASSERT(0); - NG_TRACE_ALWAYS(_T("Could not create webbrowser object rv=%08x\n"), (int) rv); - SetStartupErrorMessage(IDS_CANNOTCREATEPREFS); - return rv; - } - - // Configure what the web browser can and cannot do - nsCOMPtr webBrowserAsSetup(do_QueryInterface(mWebBrowser)); - - // Allow plugins? - const PRBool kAllowPlugins = PR_TRUE; - webBrowserAsSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_PLUGINS, kAllowPlugins); - - // Host chrome or content? - const PRBool kHostChrome = PR_FALSE; // Hardcoded for now - webBrowserAsSetup->SetProperty(nsIWebBrowserSetup::SETUP_IS_CHROME_WRAPPER, PR_FALSE); - - // Create the webbrowser window - mWebBrowserAsWin = do_QueryInterface(mWebBrowser); - rv = mWebBrowserAsWin->InitWindow(nsNativeWidget(m_hWnd), nsnull, - 0, 0, rcLocation.right - rcLocation.left, rcLocation.bottom - rcLocation.top); - rv = mWebBrowserAsWin->Create(); - - // Create the container object - mWebBrowserContainer = new CWebBrowserContainer(this); - if (mWebBrowserContainer == NULL) - { - NG_ASSERT(0); - NG_TRACE_ALWAYS(_T("Could not create webbrowsercontainer - out of memory\n")); - return NS_ERROR_OUT_OF_MEMORY; - } - mWebBrowserContainer->AddRef(); - - // Set up the browser with its chrome - mWebBrowser->SetContainerWindow(static_cast(mWebBrowserContainer)); - mWebBrowser->SetParentURIContentListener(mWebBrowserContainer); - - // Subscribe for progress notifications - nsCOMPtr listener( - do_GetWeakReference(static_cast(mWebBrowserContainer))); - mWebBrowser->AddWebBrowserListener(listener, NS_GET_IID(nsIWebProgressListener)); - - // Visible - mWebBrowserAsWin->SetVisibility(PR_TRUE); - - // Activated - nsCOMPtr browserAsFocus = do_QueryInterface(mWebBrowser); - browserAsFocus->Activate(); - - // Get an editor session - mEditingSession = do_GetInterface(mWebBrowser); - mCommandManager = do_GetInterface(mWebBrowser); - - // Append browser to browser list - sBrowserList.AppendElement(this); - - mValidBrowserFlag = TRUE; - - return S_OK; -} - -// Clean up the browser -HRESULT CMozillaBrowser::DestroyBrowser() -{ - // TODO unregister drop target - - mValidBrowserFlag = FALSE; - - // Remove browser from browser list - sBrowserList.RemoveElement(this); - - // Destroy the htmldoc - if (mIERootDocument != NULL) - { - mIERootDocument->Release(); - mIERootDocument = NULL; - } - - // Destroy layout... - if (mWebBrowserAsWin) - { - mWebBrowserAsWin->Destroy(); - mWebBrowserAsWin = nsnull; - } - - if (mWebBrowserContainer) - { - mWebBrowserContainer->Release(); - mWebBrowserContainer = NULL; - } - - mEditingSession = nsnull; - mCommandManager = nsnull; - mWebBrowser = nsnull; - - return S_OK; -} - - -// Turns the editor mode on or off -HRESULT CMozillaBrowser::SetEditorMode(BOOL bEnabled) -{ - NG_TRACE_METHOD(CMozillaBrowser::SetEditorMode); - - if (!mEditingSession || !mCommandManager) - return E_FAIL; - - nsCOMPtr domWindow; - nsresult rv = GetDOMWindow(getter_AddRefs(domWindow)); - if (NS_FAILED(rv)) - return E_FAIL; - - rv = mEditingSession->MakeWindowEditable(domWindow, "html", PR_FALSE, - PR_TRUE, PR_FALSE); - - return S_OK; -} - - -HRESULT CMozillaBrowser::OnEditorCommand(DWORD nCmdID) -{ - NG_TRACE_METHOD(CMozillaBrowser::OnEditorCommand); - - nsCOMPtr domWindow; - GetDOMWindow(getter_AddRefs(domWindow)); - - const char *styleCommand = nsnull; - nsICommandParams *commandParams = nsnull; - - switch (nCmdID) - { - case IDM_BOLD: - styleCommand = "cmd_bold"; - break; - case IDM_ITALIC: - styleCommand = "cmd_italic"; - break; - case IDM_UNDERLINE: - styleCommand = "cmd_underline"; - break; - - // TODO add the rest! - - default: - // DO NOTHING - break; - } - - return mCommandManager ? - mCommandManager->DoCommand(styleCommand, commandParams, domWindow) : - NS_ERROR_FAILURE; -} - - -// Return the root DOM document -HRESULT CMozillaBrowser::GetDOMDocument(nsIDOMDocument **pDocument) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetDOMDocument); - - HRESULT hr = E_FAIL; - - // Test for stupid args - if (pDocument == NULL) - { - NG_ASSERT(0); - return E_INVALIDARG; - } - - *pDocument = nsnull; - - if (!BrowserIsValid()) - { - NG_ASSERT(0); - return E_UNEXPECTED; - } - - // Get the DOM window from the webbrowser - nsCOMPtr window; - mWebBrowser->GetContentDOMWindow(getter_AddRefs(window)); - if (window) - { - if (NS_SUCCEEDED(window->GetDocument(pDocument)) && *pDocument) - { - hr = S_OK; - } - } - - return hr; -} - - -// Load any browser helpers -HRESULT CMozillaBrowser::LoadBrowserHelpers() -{ - NG_TRACE_METHOD(CMozillaBrowser::LoadBrowserHelpers); - - UnloadBrowserHelpers(); - - // IE loads browser helper objects from a branch of the registry - // Search the branch looking for objects to load with the control. - - CRegKey cKey; - if (cKey.Open(HKEY_LOCAL_MACHINE, kBrowserHelperObjectRegKey, KEY_ENUMERATE_SUB_KEYS) != ERROR_SUCCESS) - { - NG_TRACE(_T("No browser helper key found\n")); - return S_FALSE; - } - - // Count the number of browser helper object keys - ULONG nHelperKeys = 0; - LONG nResult = ERROR_SUCCESS; - while (nResult == ERROR_SUCCESS) - { - TCHAR szCLSID[50]; - DWORD dwCLSID = sizeof(szCLSID) / sizeof(TCHAR); - FILETIME cLastWrite; - - // Read next subkey - nResult = RegEnumKeyEx(cKey, nHelperKeys, szCLSID, &dwCLSID, NULL, NULL, NULL, &cLastWrite); - if (nResult != ERROR_SUCCESS) - { - break; - } - nHelperKeys++; - } - if (nHelperKeys == 0) - { - NG_TRACE(_T("No browser helper objects found\n")); - return S_FALSE; - } - - // Get the CLSID for each browser helper object - CLSID *pClassList = new CLSID[nHelperKeys]; - DWORD nHelpers = 0; - DWORD nKey = 0; - nResult = ERROR_SUCCESS; - while (nResult == ERROR_SUCCESS) - { - TCHAR szCLSID[50]; - DWORD dwCLSID = sizeof(szCLSID) / sizeof(TCHAR); - FILETIME cLastWrite; - - // Read next subkey - nResult = RegEnumKeyEx(cKey, nKey++, szCLSID, &dwCLSID, NULL, NULL, NULL, &cLastWrite); - if (nResult != ERROR_SUCCESS) - { - break; - } - - NG_TRACE(_T("Reading helper object entry \"%s\"\n"), szCLSID); - - // Turn the key into a CLSID - USES_CONVERSION; - CLSID clsid; - if (CLSIDFromString(T2OLE(szCLSID), &clsid) != NOERROR) - { - continue; - } - - pClassList[nHelpers++] = clsid; - } - - mBrowserHelperList = new CComUnkPtr[nHelpers]; - - // Create each object in turn - for (ULONG i = 0; i < nHelpers; i++) - { - CLSID clsid = pClassList[i]; - HRESULT hr; - CComQIPtr cpObjectWithSite; - - hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IObjectWithSite, (LPVOID *) &cpObjectWithSite); - if (FAILED(hr)) - { - NG_TRACE(_T("Registered browser helper object cannot be created\n"));; - } - else - { - // Set the object to point at the browser - cpObjectWithSite->SetSite((IWebBrowser2 *) this); - - // Store in the list - CComUnkPtr cpUnk = cpObjectWithSite; - mBrowserHelperList[mBrowserHelperListCount++] = cpUnk; - } - } - - delete []pClassList; - - return S_OK; -} - -// Release browser helpers -HRESULT CMozillaBrowser::UnloadBrowserHelpers() -{ - NG_TRACE_METHOD(CMozillaBrowser::UnloadBrowserHelpers); - - if (mBrowserHelperList == NULL) - { - return S_OK; - } - - // Destroy each helper - for (ULONG i = 0; i < mBrowserHelperListCount; i++) - { - CComUnkPtr cpUnk = mBrowserHelperList[i]; - if (cpUnk) - { - CComQIPtr cpObjectWithSite = cpUnk; - if (cpObjectWithSite) - { - cpObjectWithSite->SetSite(NULL); - } - } - } - - // Cleanup the array - mBrowserHelperListCount = 0; - delete []mBrowserHelperList; - mBrowserHelperList = NULL; - - return S_OK; -} - -// Print document -HRESULT CMozillaBrowser::PrintDocument(BOOL promptUser) -{ -#ifdef NS_PRINTING - // Print the contents - nsCOMPtr browserAsPrint = do_GetInterface(mWebBrowser); - NS_ASSERTION(browserAsPrint, "No nsIWebBrowserPrint!"); - - PRBool oldPrintSilent = PR_FALSE; - nsCOMPtr printSettings; - browserAsPrint->GetGlobalPrintSettings(getter_AddRefs(printSettings)); - if (printSettings) - { - printSettings->GetPrintSilent(&oldPrintSilent); - printSettings->SetPrintSilent(promptUser ? PR_FALSE : PR_TRUE); - } - - // Disable print progress dialog (XUL) - PRBool oldShowPrintProgress = FALSE; - const char *kShowPrintProgressPref = "print.show_print_progress"; - mPrefBranch->GetBoolPref(kShowPrintProgressPref, &oldShowPrintProgress); - mPrefBranch->SetBoolPref(kShowPrintProgressPref, PR_FALSE); - - // Print - PrintListener *listener = new PrintListener; - nsCOMPtr printListener = do_QueryInterface(listener); - nsresult rv = browserAsPrint->Print(printSettings, printListener); - if (NS_SUCCEEDED(rv)) - { - listener->WaitForComplete(); - } - - // Cleanup - if (printSettings) - { - printSettings->SetPrintSilent(oldPrintSilent); - } - mPrefBranch->SetBoolPref(kShowPrintProgressPref, oldShowPrintProgress); -#endif - return S_OK; -} - -///////////////////////////////////////////////////////////////////////////// -// IOleObject overrides - -// This is an almost verbatim copy of the standard ATL implementation of -// IOleObject::InPlaceActivate but with a few lines commented out. - -HRESULT CMozillaBrowser::InPlaceActivate(LONG iVerb, const RECT* prcPosRect) -{ - NG_TRACE_METHOD(CMozillaBrowser::InPlaceActivate); - - HRESULT hr; - - if (m_spClientSite == NULL) - return S_OK; - - CComPtr pIPO; - ControlQueryInterface(IID_IOleInPlaceObject, (void**)&pIPO); - _ASSERTE(pIPO != NULL); - if (prcPosRect != NULL) - pIPO->SetObjectRects(prcPosRect, prcPosRect); - - if (!m_bNegotiatedWnd) - { - if (!m_bWindowOnly) - // Try for windowless site - hr = m_spClientSite->QueryInterface(IID_IOleInPlaceSiteWindowless, (void **)&m_spInPlaceSite); - - if (m_spInPlaceSite) - { - m_bInPlaceSiteEx = TRUE; - m_bWndLess = SUCCEEDED(m_spInPlaceSite->CanWindowlessActivate()); - m_bWasOnceWindowless = TRUE; - } - else - { - m_spClientSite->QueryInterface(IID_IOleInPlaceSiteEx, (void **)&m_spInPlaceSite); - if (m_spInPlaceSite) - m_bInPlaceSiteEx = TRUE; - else - hr = m_spClientSite->QueryInterface(IID_IOleInPlaceSite, (void **)&m_spInPlaceSite); - } - } - - _ASSERTE(m_spInPlaceSite); - if (!m_spInPlaceSite) - return E_FAIL; - - m_bNegotiatedWnd = TRUE; - - if (!m_bInPlaceActive) - { - - BOOL bNoRedraw = FALSE; - if (m_bWndLess) - m_spInPlaceSite->OnInPlaceActivateEx(&bNoRedraw, ACTIVATE_WINDOWLESS); - else - { - if (m_bInPlaceSiteEx) - m_spInPlaceSite->OnInPlaceActivateEx(&bNoRedraw, 0); - else - { - HRESULT hr = m_spInPlaceSite->CanInPlaceActivate(); - if (FAILED(hr)) - return hr; - m_spInPlaceSite->OnInPlaceActivate(); - } - } - } - - m_bInPlaceActive = TRUE; - - // get location in the parent window, - // as well as some information about the parent - // - OLEINPLACEFRAMEINFO frameInfo; - RECT rcPos, rcClip; - CComPtr spInPlaceFrame; - CComPtr spInPlaceUIWindow; - frameInfo.cb = sizeof(OLEINPLACEFRAMEINFO); - HWND hwndParent; - if (m_spInPlaceSite->GetWindow(&hwndParent) == S_OK) - { - m_spInPlaceSite->GetWindowContext(&spInPlaceFrame, - &spInPlaceUIWindow, &rcPos, &rcClip, &frameInfo); - - if (!m_bWndLess) - { - if (m_hWndCD) - { - ::ShowWindow(m_hWndCD, SW_SHOW); - ::SetFocus(m_hWndCD); - } - else - { - HWND h = CreateControlWindow(hwndParent, rcPos); - _ASSERTE(h == m_hWndCD); - } - } - - pIPO->SetObjectRects(&rcPos, &rcClip); - } - - CComPtr spActiveObject; - ControlQueryInterface(IID_IOleInPlaceActiveObject, (void**)&spActiveObject); - - // Gone active by now, take care of UIACTIVATE - if (DoesVerbUIActivate(iVerb)) - { - if (!m_bUIActive) - { - m_bUIActive = TRUE; - hr = m_spInPlaceSite->OnUIActivate(); - if (FAILED(hr)) - return hr; - - SetControlFocus(TRUE); - // set ourselves up in the host. - // - if (spActiveObject) - { - if (spInPlaceFrame) - spInPlaceFrame->SetActiveObject(spActiveObject, NULL); - if (spInPlaceUIWindow) - spInPlaceUIWindow->SetActiveObject(spActiveObject, NULL); - } - -// These lines are deliberately commented out to demonstrate what breaks certain -// control containers. - -// if (spInPlaceFrame) -// spInPlaceFrame->SetBorderSpace(NULL); -// if (spInPlaceUIWindow) -// spInPlaceUIWindow->SetBorderSpace(NULL); - } - } - - m_spClientSite->ShowObject(); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetClientSite(IOleClientSite **ppClientSite) -{ - NG_TRACE_METHOD(CMozillaBrowser::GetClientSite); - - NG_ASSERT(ppClientSite); - - // This fixes a problem in the base class which asserts if the client - // site has not been set when this method is called. - - HRESULT hRes = E_POINTER; - if (ppClientSite != NULL) - { - *ppClientSite = NULL; - if (m_spClientSite == NULL) - { - return S_OK; - } - } - - return IOleObjectImpl::GetClientSite(ppClientSite); -} - - -///////////////////////////////////////////////////////////////////////////// -// IMozControlBridge - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetWebBrowser(/* [out] */ void __RPC_FAR *__RPC_FAR *aBrowser) -{ - if (!NgIsValidAddress(aBrowser, sizeof(void *))) - { - NG_ASSERT(0); - return SetErrorInfo(E_INVALIDARG); - } - - *aBrowser = NULL; - if (mWebBrowser) - { - nsIWebBrowser *browser = mWebBrowser.get(); - NS_ADDREF(browser); - *aBrowser = (void *) browser; - } - return S_OK; -} - -///////////////////////////////////////////////////////////////////////////// -// IWebBrowserImpl - -nsresult CMozillaBrowser::GetWebNavigation(nsIWebNavigation **aWebNav) -{ - NS_ENSURE_ARG_POINTER(aWebNav); - if (!mWebBrowser) return NS_ERROR_FAILURE; - return mWebBrowser->QueryInterface(NS_GET_IID(nsIWebNavigation), (void **) aWebNav); -} - -nsresult CMozillaBrowser::GetDOMWindow(nsIDOMWindow **aDOMWindow) -{ - NS_ENSURE_ARG_POINTER(aDOMWindow); - if (!mWebBrowser) return NS_ERROR_FAILURE; - return mWebBrowser->GetContentDOMWindow(aDOMWindow); -} - -nsresult CMozillaBrowser::GetPrefs(nsIPrefBranch **aPrefBranch) -{ - if (mPrefBranch) - *aPrefBranch = mPrefBranch; - NS_IF_ADDREF(*aPrefBranch); - return (*aPrefBranch) ? NS_OK : NS_ERROR_FAILURE; -} - -PRBool CMozillaBrowser::BrowserIsValid() -{ - NG_TRACE_METHOD(CMozillaBrowser::BrowserIsValid); - return mValidBrowserFlag ? PR_TRUE : PR_FALSE; -} - -// Overrides of IWebBrowser / IWebBrowserApp / IWebBrowser2 methods - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Parent); - ENSURE_BROWSER_IS_VALID(); - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - return SetErrorInfo(E_INVALIDARG); - } - - // Attempt to get the parent object of this control - HRESULT hr = E_FAIL; - if (m_spClientSite) - { - hr = m_spClientSite->QueryInterface(IID_IDispatch, (void **) ppDisp); - } - - return (SUCCEEDED(hr)) ? S_OK : E_NOINTERFACE; -} - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_Document); - ENSURE_BROWSER_IS_VALID(); - - if (!NgIsValidAddress(ppDisp, sizeof(IDispatch *))) - { - NG_ASSERT(0); - return SetErrorInfo(E_UNEXPECTED); - } - - *ppDisp = NULL; - - // Get hold of the DOM document - nsIDOMDocument *pIDOMDocument = nsnull; - if (FAILED(GetDOMDocument(&pIDOMDocument)) || pIDOMDocument == nsnull) - { - return S_OK; // return NULL pointer - } - - if (mIERootDocument == NULL) - { - nsCOMPtr pIDOMHTMLDocument = - do_QueryInterface(pIDOMDocument); - - if (!pIDOMDocument) - { - return SetErrorInfo(E_FAIL, L"get_Document: not HTML"); - } - - CIEHtmlDocumentInstance::CreateInstance(&mIERootDocument); - if (mIERootDocument == NULL) - { - return SetErrorInfo(E_OUTOFMEMORY, L"get_Document: can't create IERootDocument"); - } - - // addref it so it doesn't go away on us. - mIERootDocument->AddRef(); - - // give it a pointer to us. note that we shouldn't be addref'd by this call, or it would be - // a circular reference. - mIERootDocument->SetParent(this); - mIERootDocument->SetDOMNode(pIDOMDocument); - mIERootDocument->SetNative(pIDOMHTMLDocument); - } - - mIERootDocument->QueryInterface(IID_IDispatch, (void **) ppDisp); - pIDOMDocument->Release(); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::get_RegisterAsDropTarget); - ENSURE_BROWSER_IS_VALID(); - - if (pbRegister == NULL) - { - NG_ASSERT(0); - return SetErrorInfo(E_INVALIDARG); - } - - *pbRegister = mHaveDropTargetFlag ? VARIANT_TRUE : VARIANT_FALSE; - return S_OK; -} - - - -static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) -{ - ::RevokeDragDrop(hwnd); - return TRUE; -} - - -HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsDropTarget(VARIANT_BOOL bRegister) -{ - NG_TRACE_METHOD(CMozillaBrowser::put_RegisterAsDropTarget); - ENSURE_BROWSER_IS_VALID(); - - // Register the window as a drop target - if (bRegister == VARIANT_TRUE) - { - if (!mHaveDropTargetFlag) - { - CDropTargetInstance *pDropTarget = NULL; - CDropTargetInstance::CreateInstance(&pDropTarget); - if (pDropTarget) - { - pDropTarget->AddRef(); - pDropTarget->SetOwner(this); - - - // Ask the site if it wants to replace this drop target for another one - CIPtr(IDropTarget) spDropTarget; - CIPtr(IDocHostUIHandler) spDocHostUIHandler = m_spClientSite; - if (spDocHostUIHandler) - { - //if (spDocHostUIHandler->GetDropTarget(pDropTarget, &spDropTarget) != S_OK) - if (spDocHostUIHandler->GetDropTarget(pDropTarget, &spDropTarget) == S_OK) - { - mHaveDropTargetFlag = TRUE; - ::RegisterDragDrop(m_hWnd, spDropTarget); - //spDropTarget = pDropTarget; - } - } - else - //if (spDropTarget) - { - mHaveDropTargetFlag = TRUE; - ::RegisterDragDrop(m_hWnd, pDropTarget); - //::RegisterDragDrop(m_hWnd, spDropTarget); - } - pDropTarget->Release(); - } - // Now revoke any child window drop targets and pray they aren't - // reset by the layout engine. - ::EnumChildWindows(m_hWnd, EnumChildProc, (LPARAM) this); - } - } - else - { - if (mHaveDropTargetFlag) - { - mHaveDropTargetFlag = FALSE; - ::RevokeDragDrop(m_hWnd); - } - } - - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// Ole Command Handlers - - -HRESULT _stdcall CMozillaBrowser::PrintHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) -{ - BOOL promptUser = (nCmdexecopt & OLECMDEXECOPT_DONTPROMPTUSER) ? FALSE : TRUE; - pThis->PrintDocument(promptUser); - return S_OK; -} - - -HRESULT _stdcall CMozillaBrowser::EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) -{ - BOOL bEditorMode = (nCmdID == IDM_EDITMODE) ? TRUE : FALSE; - pThis->SetEditorMode(bEditorMode); - return S_OK; -} - - -HRESULT _stdcall CMozillaBrowser::EditCommandHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) -{ - pThis->OnEditorCommand(nCmdID); - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// SimpleDirectoryProvider implementation - -SimpleDirectoryProvider::SimpleDirectoryProvider() -{ - nsCOMPtr appDataDir; - - // Attempt to fill appDataDir with a meaningful value. Any error in the process - // will cause the constructor to return and IsValid() to return FALSE, - - CComPtr shellMalloc; - SHGetMalloc(&shellMalloc); - if (shellMalloc) - { - LPITEMIDLIST pitemidList = NULL; - SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pitemidList); - if (pitemidList) - { - TCHAR szBuffer[MAX_PATH + 1]; - if (SUCCEEDED(SHGetPathFromIDList(pitemidList, szBuffer))) - { - szBuffer[MAX_PATH] = TCHAR('\0'); - USES_CONVERSION; - NS_NewNativeLocalFile(nsDependentCString(T2A(szBuffer)), TRUE, getter_AddRefs(appDataDir)); - } - shellMalloc->Free(pitemidList); - } - } - if (!appDataDir) - { - return; - } - - // Mozilla control paths are - // App data - {Application Data}/MozillaControl - // App registry - {Application Data}/MozillaControl/registry.dat - // Profiles - {Application Data}/MozillaControl/profiles - - nsresult rv; - - // Create the root directory - PRBool exists; - rv = appDataDir->Exists(&exists); - if (NS_FAILED(rv) || !exists) return; - - // MozillaControl application data - rv = appDataDir->AppendRelativePath(NS_LITERAL_STRING("MozillaControl")); - if (NS_FAILED(rv)) return; - rv = appDataDir->Exists(&exists); - if (NS_SUCCEEDED(rv) && !exists) - rv = appDataDir->Create(nsIFile::DIRECTORY_TYPE, 0775); - if (NS_FAILED(rv)) return; - - // Registry.dat file - nsCOMPtr appDataRegAsFile; - rv = appDataDir->Clone(getter_AddRefs(appDataRegAsFile)); - if (NS_FAILED(rv)) return; - nsCOMPtr appDataRegistry = do_QueryInterface(appDataRegAsFile, &rv); - if (NS_FAILED(rv)) return; - appDataRegistry->AppendRelativePath(NS_LITERAL_STRING("registry.dat")); - - // Profiles directory - nsCOMPtr profileDirAsFile; - rv = appDataDir->Clone(getter_AddRefs(profileDirAsFile)); - if (NS_FAILED(rv)) return; - nsCOMPtr profileDir = do_QueryInterface(profileDirAsFile, &rv); - if (NS_FAILED(rv)) return; - profileDir->AppendRelativePath(NS_LITERAL_STRING("profiles")); - rv = profileDir->Exists(&exists); - if (NS_SUCCEEDED(rv) && !exists) - rv = profileDir->Create(nsIFile::DIRECTORY_TYPE, 0775); - if (NS_FAILED(rv)) return; - - // Store the member values - mApplicationRegistryDir = appDataDir; - mApplicationRegistryFile = appDataRegistry; - mUserProfileDir = profileDir; -} - -SimpleDirectoryProvider::~SimpleDirectoryProvider() -{ -} - -BOOL -SimpleDirectoryProvider::IsValid() const -{ - return (mApplicationRegistryDir && mApplicationRegistryFile && mUserProfileDir) ? - TRUE : FALSE; -} - -NS_IMPL_ISUPPORTS1(SimpleDirectoryProvider, nsIDirectoryServiceProvider) - -/////////////////////////////////////////////////////////////////////////////// -// nsIDirectoryServiceProvider - -/* nsIFile getFile (in string prop, out PRBool persistent); */ -NS_IMETHODIMP SimpleDirectoryProvider::GetFile(const char *prop, PRBool *persistent, nsIFile **_retval) -{ - NS_ENSURE_ARG_POINTER(prop); - NS_ENSURE_ARG_POINTER(persistent); - NS_ENSURE_ARG_POINTER(_retval); - - *_retval = nsnull; - *persistent = PR_TRUE; - - // Only need to support NS_APP_APPLICATION_REGISTRY_DIR, NS_APP_APPLICATION_REGISTRY_FILE, and - // NS_APP_USER_PROFILES_ROOT_DIR. Unsupported keys fallback to the default service provider - - nsCOMPtr localFile; - nsresult rv = NS_ERROR_FAILURE; - - if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0) - { - localFile = mApplicationRegistryDir; - } - else if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0) - { - localFile = mApplicationRegistryFile; - } - else if (strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0) - { - localFile = mUserProfileDir; - } - - if (localFile) - return CallQueryInterface(localFile, _retval); - - return rv; -} - - -/////////////////////////////////////////////////////////////////////////////// -// PrintListener implementation - - -#ifdef NS_PRINTING - -NS_IMPL_ISUPPORTS1(PrintListener, nsIWebProgressListener) - -PrintListener::PrintListener() : mComplete(PR_FALSE) -{ - /* member initializers and constructor code */ -} - -PrintListener::~PrintListener() -{ - /* destructor code */ -} - -void PrintListener::WaitForComplete() -{ - MSG msg; - HANDLE hFakeEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - - while (!mComplete) - { - // Process pending messages - while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (!::GetMessage(&msg, NULL, 0, 0)) - { - ::CloseHandle(hFakeEvent); - return; - } - - PRBool wasHandled = PR_FALSE; - ::NS_HandleEmbeddingEvent(msg, wasHandled); - if (wasHandled) - continue; - - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - if (mComplete) - break; - - // Do idle stuff - ::MsgWaitForMultipleObjects(1, &hFakeEvent, FALSE, 500, QS_ALLEVENTS); - } - - ::CloseHandle(hFakeEvent); -} - -/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */ -NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) -{ - if (aStateFlags & nsIWebProgressListener::STATE_STOP && - aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT) - { - mComplete = PR_TRUE; - } - return NS_OK; -} - -/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */ -NS_IMETHODIMP PrintListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) -{ - return NS_OK; -} - -/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */ -NS_IMETHODIMP PrintListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location) -{ - return NS_OK; -} - -/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */ -NS_IMETHODIMP PrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) -{ - return NS_OK; -} - -/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */ -NS_IMETHODIMP PrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state) -{ - return NS_OK; -} -#endif diff --git a/embedding/browser/activex/src/control/MozillaBrowser.h b/embedding/browser/activex/src/control/MozillaBrowser.h deleted file mode 100644 index 3b00d5dcdc1..00000000000 --- a/embedding/browser/activex/src/control/MozillaBrowser.h +++ /dev/null @@ -1,448 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -// MozillaBrowser.h : Declaration of the CMozillaBrowser - -#ifndef __MOZILLABROWSER_H_ -#define __MOZILLABROWSER_H_ - -#include "IWebBrowserImpl.h" - -// Commands sent via WM_COMMAND -enum { - ID_PRINT = 1, - ID_PAGESETUP, - ID_VIEWSOURCE, - ID_SAVEAS, - ID_PROPERTIES, - ID_CUT, - ID_COPY, - ID_PASTE, - ID_SELECTALL -}; - -// Command group and IDs exposed through IOleCommandTarget -extern GUID CGID_IWebBrowser_Moz; -extern GUID CGID_MSHTML_Moz; - -enum { - HTMLID_FIND = 1, - HTMLID_VIEWSOURCE, - HTMLID_OPTIONS -}; - -// A list of objects -typedef CComPtr CComUnkPtr; - -class CWebBrowserContainer; -class CPromptService; - -///////////////////////////////////////////////////////////////////////////// -// CMozillaBrowser -class ATL_NO_VTABLE CMozillaBrowser : - public CComObjectRootEx, - public CComCoClass, - public CComControl, - public IPropertyNotifySinkCP, - public IWebBrowserImpl, - public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents2, &LIBID_MOZILLACONTROLLib>, - public IPersistStreamInitImpl, - public IPersistStorageImpl, - public IPersistPropertyBagImpl, - public IQuickActivateImpl, - public IOleControlImpl, - public IOleObjectImpl, - public IOleInPlaceActiveObjectImpl, - public IViewObjectExImpl, - public IOleInPlaceObjectWindowlessImpl, - public IDataObjectImpl, - public ISupportErrorInfo, - public IOleCommandTargetImpl, - public IConnectionPointContainerImpl, - public ISpecifyPropertyPagesImpl, - public IObjectSafetyImpl, - public IMozControlBridge -{ - friend CWebBrowserContainer; - friend CPromptService; - -public: - CMozillaBrowser(); - virtual ~CMozillaBrowser(); - -DECLARE_REGISTRY_RESOURCEID(IDR_MOZILLABROWSER) - -BEGIN_COM_MAP(CMozillaBrowser) - // Mozilla control interfaces - COM_INTERFACE_ENTRY(IMozControlBridge) - // IE web browser interface - COM_INTERFACE_ENTRY(IWebBrowser2) - COM_INTERFACE_ENTRY_IID(IID_IDispatch, IWebBrowser2) - COM_INTERFACE_ENTRY_IID(IID_IWebBrowser, IWebBrowser2) - COM_INTERFACE_ENTRY_IID(IID_IWebBrowserApp, IWebBrowser2) - // Outgoing IE event interfaces - COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents, - CProxyDWebBrowserEvents) - COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, - CProxyDWebBrowserEvents2) - // Other ActiveX/OLE interfaces - COM_INTERFACE_ENTRY(IViewObjectEx) - COM_INTERFACE_ENTRY_IID(IID_IViewObject2, IViewObjectEx) - COM_INTERFACE_ENTRY_IID(IID_IViewObject, IViewObjectEx) - COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY(IOleInPlaceActiveObject) - COM_INTERFACE_ENTRY(IOleControl) - COM_INTERFACE_ENTRY(IOleObject) - COM_INTERFACE_ENTRY(IQuickActivate) // This causes size assertion in ATL - COM_INTERFACE_ENTRY2(IPersist, IPersistPropertyBag) - COM_INTERFACE_ENTRY(IPersistPropertyBag) - COM_INTERFACE_ENTRY(IPersistStreamInit) - COM_INTERFACE_ENTRY(IPersistStorage) - COM_INTERFACE_ENTRY(ISpecifyPropertyPages) - COM_INTERFACE_ENTRY(IDataObject) - COM_INTERFACE_ENTRY(IOleCommandTarget) - COM_INTERFACE_ENTRY(IProvideClassInfo) - COM_INTERFACE_ENTRY(IProvideClassInfo2) - COM_INTERFACE_ENTRY(ISupportErrorInfo) - COM_INTERFACE_ENTRY(IConnectionPointContainer) - COM_INTERFACE_ENTRY(IObjectSafety) -END_COM_MAP() - -// Properties supported by the control that map onto property -// pages that the user may be able to configure from tools like VB. - -BEGIN_PROPERTY_MAP(CMozillaBrowser) - // Example entries - // PROP_ENTRY("Property Description", dispid, clsid) - PROP_PAGE(CLSID_StockColorPage) - PROP_DATA_ENTRY("SRC", mInitialSrc, VT_BSTR) -END_PROPERTY_MAP() - -// Table of outgoing connection points. Anyone subscribing -// to events from the control should do so through one of these -// connect points. - -BEGIN_CONNECTION_POINT_MAP(CMozillaBrowser) - CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink) - // Fires IE events - CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents2) - CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents) -END_CONNECTION_POINT_MAP() - -// Table of window messages and their associate handlers - -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) - MESSAGE_HANDLER(WM_GETDLGCODE, OnGetDlgCode) - MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) - COMMAND_ID_HANDLER(ID_PRINT, OnPrint) - COMMAND_ID_HANDLER(ID_PAGESETUP, OnPageSetup) - COMMAND_ID_HANDLER(ID_SAVEAS, OnSaveAs) - COMMAND_ID_HANDLER(ID_PROPERTIES, OnProperties) - COMMAND_ID_HANDLER(ID_CUT, OnCut) - COMMAND_ID_HANDLER(ID_COPY, OnCopy) - COMMAND_ID_HANDLER(ID_PASTE, OnPaste) - COMMAND_ID_HANDLER(ID_SELECTALL, OnSelectAll) - COMMAND_ID_HANDLER(ID_DOCUMENT_BACK, OnDocumentBack) - COMMAND_ID_HANDLER(ID_DOCUMENT_FORWARD, OnDocumentForward) - COMMAND_ID_HANDLER(ID_DOCUMENT_PRINT, OnDocumentPrint) - COMMAND_ID_HANDLER(ID_DOCUMENT_REFRESH, OnDocumentRefresh) - COMMAND_ID_HANDLER(ID_DOCUMENT_PROPERTIES, OnDocumentProperties) - COMMAND_ID_HANDLER(ID_DOCUMENT_VIEWSOURCE, OnViewSource) - COMMAND_ID_HANDLER(ID_LINK_OPEN, OnLinkOpen) - COMMAND_ID_HANDLER(ID_LINK_OPENINNEWWINDOW, OnLinkOpenInNewWindow) - COMMAND_ID_HANDLER(ID_LINK_COPYSHORTCUT, OnLinkCopyShortcut) - COMMAND_ID_HANDLER(ID_LINK_PROPERTIES, OnLinkProperties) -END_MSG_MAP() - - static HRESULT _stdcall PrintHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - static HRESULT _stdcall EditModeHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - static HRESULT _stdcall EditCommandHandler(CMozillaBrowser *pThis, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); - -// Table of OLE commands (invoked through IOleCommandTarget and their -// associated command groups and command handlers. - -BEGIN_OLECOMMAND_TABLE() - // Standard "common" commands - OLECOMMAND_HANDLER(OLECMDID_PRINT, NULL, PrintHandler, L"Print", L"Print the page") - OLECOMMAND_MESSAGE(OLECMDID_PAGESETUP, NULL, ID_PAGESETUP, L"Page Setup", L"Page Setup") - OLECOMMAND_MESSAGE(OLECMDID_UNDO, NULL, 0, L"Undo", L"Undo") - OLECOMMAND_MESSAGE(OLECMDID_REDO, NULL, 0, L"Redo", L"Redo") - OLECOMMAND_MESSAGE(OLECMDID_REFRESH, NULL, 0, L"Refresh", L"Refresh") - OLECOMMAND_MESSAGE(OLECMDID_STOP, NULL, 0, L"Stop", L"Stop") - OLECOMMAND_MESSAGE(OLECMDID_ONUNLOAD, NULL, 0, L"OnUnload", L"OnUnload") - OLECOMMAND_MESSAGE(OLECMDID_SAVEAS, NULL, ID_SAVEAS, L"SaveAs", L"Save the page") - OLECOMMAND_MESSAGE(OLECMDID_CUT, NULL, ID_CUT, L"Cut", L"Cut selection") - OLECOMMAND_MESSAGE(OLECMDID_COPY, NULL, ID_COPY, L"Copy", L"Copy selection") - OLECOMMAND_MESSAGE(OLECMDID_PASTE, NULL, ID_PASTE, L"Paste", L"Paste as selection") - OLECOMMAND_MESSAGE(OLECMDID_SELECTALL, NULL, ID_SELECTALL, L"SelectAll", L"Select all") - OLECOMMAND_MESSAGE(OLECMDID_PROPERTIES, NULL, ID_PROPERTIES, L"Properties", L"Show page properties") - // Unsupported IE 4.x command group - OLECOMMAND_MESSAGE(HTMLID_FIND, &CGID_IWebBrowser_Moz, 0, L"Find", L"Find") - OLECOMMAND_MESSAGE(HTMLID_VIEWSOURCE, &CGID_IWebBrowser_Moz, ID_VIEWSOURCE, L"ViewSource", L"View Source") - OLECOMMAND_MESSAGE(HTMLID_OPTIONS, &CGID_IWebBrowser_Moz, 0, L"Options", L"Options") - // DHTML editor command group - OLECOMMAND_HANDLER(IDM_EDITMODE, &CGID_MSHTML_Moz, EditModeHandler, L"EditMode", L"Switch to edit mode") - OLECOMMAND_HANDLER(IDM_BROWSEMODE, &CGID_MSHTML_Moz, EditModeHandler, L"UserMode", L"Switch to user mode") - OLECOMMAND_HANDLER(IDM_BOLD, &CGID_MSHTML_Moz, EditCommandHandler, L"Bold", L"Toggle Bold") - OLECOMMAND_HANDLER(IDM_ITALIC, &CGID_MSHTML_Moz, EditCommandHandler, L"Italic", L"Toggle Italic") - OLECOMMAND_HANDLER(IDM_UNDERLINE, &CGID_MSHTML_Moz, EditCommandHandler, L"Underline", L"Toggle Underline") - OLECOMMAND_HANDLER(IDM_UNKNOWN, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNBOTTOM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNHORIZONTALCENTERS, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNLEFT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNRIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNTOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNTOP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ALIGNVERTICALCENTERS, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ARRANGEBOTTOM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ARRANGERIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BRINGFORWARD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BRINGTOFRONT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CENTERHORIZONTALLY, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CENTERVERTICALLY, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CODE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_DELETE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONTNAME, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONTSIZE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_GROUP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACECONCATENATE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEDECREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEINCREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_HORIZSPACEMAKEEQUAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_INSERTOBJECT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MULTILEVELREDO, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SENDBACKWARD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SENDTOBACK, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHOWTABLE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROLHEIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOCONTROLWIDTH, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOFIT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SIZETOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SNAPTOGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_TABORDER, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_TOOLBOX, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MULTILEVELUNDO, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_UNGROUP, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACECONCATENATE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEDECREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEINCREASE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_VERTSPACEMAKEEQUAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYFULL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BACKCOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_BORDERCOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FLAT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FORECOLOR, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYCENTER, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYGENERAL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYLEFT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYRIGHT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_RAISED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SUNKEN, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CHISELED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_ETCHED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHADOWED, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FIND, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_SHOWGRID, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST0, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST1, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST2, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST3, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST4, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST5, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST6, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST7, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST8, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLIST9, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_OBJECTVERBLISTLAST, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CONVERTOBJECT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CUSTOMCONTROL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CUSTOMIZEITEM, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_RENAME, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_IMPORT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_NEWPAGE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_MOVE, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_CANCEL, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_FONT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_STRIKETHROUGH, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_DELETEWORD, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_EXECPRINT, &CGID_MSHTML_Moz, NULL, L"", L"") - OLECOMMAND_HANDLER(IDM_JUSTIFYNONE, &CGID_MSHTML_Moz, NULL, L"", L"") -END_OLECOMMAND_TABLE() - - HWND GetCommandTargetWindow() const - { - return m_hWnd; - } - -// 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); - LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnGetDlgCode(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - - LRESULT OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnPageSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnViewSource(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - - LRESULT OnSaveAs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnCut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnPaste(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnSelectAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - - LRESULT OnDocumentBack(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnDocumentForward(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnDocumentPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnDocumentRefresh(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnDocumentProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - - LRESULT OnLinkOpen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnLinkOpenInNewWindow(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnLinkCopyShortcut(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnLinkProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, 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: - - // List of browsers - static nsTArray sBrowserList; - - // Name of profile to use - nsString mProfileName; - - // Pointer to web browser manager - CWebBrowserContainer * mWebBrowserContainer; - // CComObject to IHTMLDocument implementer - CIEHtmlDocumentInstance * mIERootDocument; - - // Mozilla interfaces - nsCOMPtr mWebBrowser; - nsCOMPtr mWebBrowserAsWin; - nsCOMPtr mEditingSession; - nsCOMPtr mCommandManager; - - // Context menu - nsCOMPtr mContextNode; - - // Prefs service - nsCOMPtr mPrefBranch; - - // Flag to indicate if browser is created or not - BOOL mValidBrowserFlag; - // Flag to indicate if browser is in edit mode or not - BOOL mEditModeFlag; - // Flag to indicate if the browser has a drop target - BOOL mHaveDropTargetFlag; - // Contains an error message if startup went wrong - tstring mStartupErrorMessage; - // Initial source url passed in via the container - CComBSTR mInitialSrc; - // List of registered browser helper objects - CComUnkPtr *mBrowserHelperList; - ULONG mBrowserHelperListCount; - - virtual HRESULT Initialize(); - virtual HRESULT Terminate(); - virtual HRESULT CreateBrowser(); - virtual HRESULT DestroyBrowser(); - virtual HRESULT SetStartupErrorMessage(UINT nStringID); - virtual HRESULT GetDOMDocument(nsIDOMDocument **pDocument); - virtual HRESULT SetEditorMode(BOOL bEnabled); - virtual HRESULT OnEditorCommand(DWORD nCmdID); - virtual HRESULT PrintDocument(BOOL promptUser); - - virtual HRESULT LoadBrowserHelpers(); - virtual HRESULT UnloadBrowserHelpers(); - - // User interface methods - virtual int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = _T(""), UINT nType = MB_OK); - virtual void ShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode); - virtual void ShowURIPropertyDlg(const nsAString &aURI, const nsAString &aContentType); - virtual void NextDlgControl(); - virtual void PrevDlgControl(); - -public: -// IOleObjectImpl overrides - HRESULT InPlaceActivate(LONG iVerb, const RECT* prcPosRect); - -// IOleObject overrides - virtual HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetClientSite(IOleClientSite **ppClientSite); - -// IMozControlBridge implementation - virtual HRESULT STDMETHODCALLTYPE GetWebBrowser(/* [out] */ void __RPC_FAR *__RPC_FAR *aBrowser); - -// IWebBrowserImpl overrides - virtual nsresult GetWebNavigation(nsIWebNavigation **aWebNav); - virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow); - virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch); - virtual PRBool BrowserIsValid(); - -// IWebBrowser - virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister); - virtual HRESULT STDMETHODCALLTYPE put_RegisterAsDropTarget(VARIANT_BOOL bRegister); - -public: - HRESULT OnDraw(ATL_DRAWINFO& di); - -}; - -#endif //__MOZILLABROWSER_H_ diff --git a/embedding/browser/activex/src/control/MozillaBrowser.ico b/embedding/browser/activex/src/control/MozillaBrowser.ico deleted file mode 100644 index 01c6f785d3e..00000000000 Binary files a/embedding/browser/activex/src/control/MozillaBrowser.ico and /dev/null differ diff --git a/embedding/browser/activex/src/control/MozillaBrowser.rgs b/embedding/browser/activex/src/control/MozillaBrowser.rgs deleted file mode 100644 index deec131285f..00000000000 --- a/embedding/browser/activex/src/control/MozillaBrowser.rgs +++ /dev/null @@ -1,66 +0,0 @@ -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' - ForceRemove 'EnableFullPage' - { - ForceRemove .xul - ForceRemove .svg - } - } - } - NoRemove MIME - { - NoRemove Database - { - NoRemove 'Content Type' - { - ForceRemove 'application/vnd.mozilla.xul+xml' - { - val Extension = s '.xul' - val CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}' - } - ForceRemove 'image/svg+xml' - { - val Extension = s '.svg' - val CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}' - } - } - } - } - ForceRemove .xul = s 'Mozilla.Browser' - { - ForceRemove val 'Content Type' = s 'application/vnd.mozilla.xul+xml' - } - ForceRemove .svg = s 'Mozilla.Browser' - { - ForceRemove val 'Content Type' = s 'image/svg+xml' - } -} diff --git a/embedding/browser/activex/src/control/MozillaControl.cpp b/embedding/browser/activex/src/control/MozillaControl.cpp deleted file mode 100644 index 7d274ca6763..00000000000 --- a/embedding/browser/activex/src/control/MozillaControl.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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*/) -{ - NG_TRACE_METHOD(DllMain); - - if (dwReason == DLL_PROCESS_ATTACH) - { - NG_TRACE(_T("Mozilla ActiveX - DLL_PROCESS_ATTACH\n")); - _Module.Init(ObjectMap, hInstance); - DisableThreadLibraryCalls(hInstance); - } - else if (dwReason == DLL_PROCESS_DETACH) - { - NG_TRACE(_T("Mozilla ActiveX - DLL_PROCESS_DETACH\n")); - _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; -} - - diff --git a/embedding/browser/activex/src/control/MozillaControl.dsp b/embedding/browser/activex/src/control/MozillaControl.dsp deleted file mode 100644 index ed4fb74b30f..00000000000 --- a/embedding/browser/activex/src/control/MozillaControl.dsp +++ /dev/null @@ -1,335 +0,0 @@ -# Microsoft Developer Studio Project File - Name="MozillaControl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=MozillaControl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "MozillaControl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "MozillaControl.mak" CFG="MozillaControl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "MozillaControl - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "MozillaControl - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "MozillaControl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f MozillaControl.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "MozillaControl.exe" -# PROP BASE Bsc_Name "MozillaControl.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "nmake /f makefile.win" -# PROP Rebuild_Opt "/a" -# PROP Target_File "win32_o.obj\mozctl.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "MozillaControl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f MozillaControl.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "MozillaControl.exe" -# PROP BASE Bsc_Name "MozillaControl.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "nmake /f makefile.win" -# PROP Rebuild_Opt "/a" -# PROP Target_File "M:\source\mozilla\dist\WIN32_D.OBJ\bin\mozctl.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "MozillaControl - Win32 Release" -# Name "MozillaControl - Win32 Debug" - -!IF "$(CFG)" == "MozillaControl - Win32 Release" - -!ELSEIF "$(CFG)" == "MozillaControl - Win32 Debug" - -!ENDIF - -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ActiveScriptSite.cpp -# End Source File -# Begin Source File - -SOURCE=.\DropTarget.cpp -# End Source File -# Begin Source File - -SOURCE=.\HelperAppDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlDocument.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.cpp -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.idl -# End Source File -# Begin Source File - -SOURCE=.\PromptService.cpp -# End Source File -# Begin Source File - -SOURCE=.\PropertyDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# End Source File -# Begin Source File - -SOURCE=.\WebBrowserContainer.cpp -# End Source File -# Begin Source File - -SOURCE=.\WindowCreator.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\ActiveScriptSite.h -# End Source File -# Begin Source File - -SOURCE=.\ActiveXTypes.h -# End Source File -# Begin Source File - -SOURCE=.\BrowserDiagnostics.h -# End Source File -# Begin Source File - -SOURCE=.\DHTMLCmdIds.h -# End Source File -# Begin Source File - -SOURCE=.\DropTarget.h -# End Source File -# Begin Source File - -SOURCE=.\HelperAppDlg.h -# End Source File -# Begin Source File - -SOURCE=.\IEHtmlDocument.h -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.h -# End Source File -# Begin Source File - -SOURCE=.\PromptService.h -# End Source File -# Begin Source File - -SOURCE=.\PropertyDlg.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# Begin Source File - -SOURCE=.\WebBrowserContainer.h -# End Source File -# Begin Source File - -SOURCE=.\WindowCreator.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\MozillaBrowser.ico -# End Source File -# Begin Source File - -SOURCE=.\MozillaBrowser.rgs -# End Source File -# Begin Source File - -SOURCE=.\MozillaControl.rc -# End Source File -# End Group -# Begin Group "Common Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\common\ControlEventSink.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\ControlSite.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\ControlSiteIPFrame.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlButtonElement.cpp -# End Source File -# Begin Source File -SOURCE=..\common\IEHtmlElement.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlElementCollection.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlNode.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlSelectionObject.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlTxtRange.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\ItemContainer.cpp -# End Source File -# Begin Source File - -SOURCE=..\common\PropertyBag.cpp -# End Source File -# End Group -# Begin Group "Common Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\common\ControlEventSink.h -# End Source File -# Begin Source File - -SOURCE=..\common\ControlSite.h -# End Source File -# Begin Source File - -SOURCE=..\common\ControlSiteIPFrame.h -# End Source File -# Begin Source File - -SOURCE=..\common\CPMozillaControl.h -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlButtonElement.h -# End Source File -# Begin Source File -SOURCE=..\common\IEHtmlElement.h -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlElementCollection.h -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlNode.h -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlSelectionObject.h -# End Source File -# Begin Source File - -SOURCE=..\common\IEHtmlTxtRange.h -# End Source File -# Begin Source File - -SOURCE=..\common\IHTMLLocationImpl.h -# End Source File -# Begin Source File - -SOURCE=..\common\IOleCommandTargetImpl.h -# End Source File -# Begin Source File - -SOURCE=..\common\ItemContainer.h -# End Source File -# Begin Source File - -SOURCE=..\common\IWebBrowserImpl.h -# End Source File -# Begin Source File - -SOURCE=..\common\PropertyBag.h -# End Source File -# Begin Source File - -SOURCE=..\common\PropertyList.h -# End Source File -# Begin Source File - -SOURCE=..\common\StdAfx.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\Makefile.in -# End Source File -# End Target -# End Project diff --git a/embedding/browser/activex/src/control/MozillaControl.idl b/embedding/browser/activex/src/control/MozillaControl.idl deleted file mode 100644 index 6675aeaa6a1..00000000000 --- a/embedding/browser/activex/src/control/MozillaControl.idl +++ /dev/null @@ -1,483 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include - -// 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"; -import "docobj.idl"; - -// See note below for why IWebBrowser is not imported this way -// import "exdisp.idl"; - -#include - -[ - uuid(1339B53E-3453-11D2-93B9-000000000000), - version(1.0), - helpstring("MozillaControl 1.0 Type Library") -] -library MOZILLACONTROLLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - // Stop interfaces and other bits from being redefined by the IE header file - - cpp_quote("#ifndef __exdisp_h__") - cpp_quote("#define __exdisp_h__") - - // NOTE: There is a very specific reason for repeating the IWebBrowser - // and other bits verbatim rather than import'ing exdisp.idl - - // MIDL fails with a MIDL2020 error if we try that! - - [ - 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 hierarchy... - [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(0002DF05-0000-0000-C000-000000000046), // IID_IWebBrowserApp - helpstring("Web Browser Application Interface."), - helpcontext(0x0000), - hidden, - oleautomation, - dual - ] - interface IWebBrowserApp : IWebBrowser - { - [id(300), helpstring("Exits application and closes the open document."), helpcontext(0x0000)] - HRESULT Quit(); - - [id(301), helpstring("Converts client sizes into window sizes."), helpcontext(0x0000)] - HRESULT ClientToWindow([in,out] int* pcx, [in,out] int* pcy); - - [id(302), helpstring("Associates vtValue with the name szProperty in the context of the object."), helpcontext(0x0000)] - HRESULT PutProperty([in] BSTR Property, [in] VARIANT vtValue); - - [id(303), helpstring("Retrieve the Associated value for the property vtValue in the context of the object."), helpcontext(0x0000)] - HRESULT GetProperty([in] BSTR Property, [out, retval] VARIANT *pvtValue); - - [id(0), propget, helpstring("Returns name of the application."), helpcontext(0x0000)] - HRESULT Name([out,retval] BSTR* Name); - - [id(DISPID_HWND), propget, helpstring("Returns the HWND of the current IE window."), helpcontext(0x0000)] - HRESULT HWND([out,retval] SHANDLE_PTR *pHWND); - - [id(400), propget, helpstring("Returns file specification of the application, including path."), helpcontext(0x0000)] - HRESULT FullName([out,retval] BSTR* FullName); - - [id(401), propget, helpstring("Returns the path to the application."), helpcontext(0x0000)] - HRESULT Path([out,retval] BSTR* Path); - - [id(402), propget, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)] - HRESULT Visible([out, retval] VARIANT_BOOL* pBool); - [id(402), propput, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)] - HRESULT Visible([in] VARIANT_BOOL Value); - - [id(403), propget, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)] - HRESULT StatusBar([out, retval] VARIANT_BOOL* pBool); - [id(403), propput, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)] - HRESULT StatusBar([in] VARIANT_BOOL Value); - - [id(404), propget, helpstring("Text of Status window."), helpcontext(0x0000)] - HRESULT StatusText([out, retval] BSTR *StatusText); - [id(404), propput, helpstring("Text of Status window."), helpcontext(0x0000)] - HRESULT StatusText([in] BSTR StatusText); - - [id(405), propget, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)] - HRESULT ToolBar([out, retval] int * Value); - [id(405), propput, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)] - HRESULT ToolBar([in] int Value); - - [id(406), propget, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)] - HRESULT MenuBar([out, retval] VARIANT_BOOL * Value); - [id(406), propput, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)] - HRESULT MenuBar([in] VARIANT_BOOL Value); - - [id(407), propget, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)] - HRESULT FullScreen([out, retval] VARIANT_BOOL * pbFullScreen); - [id(407), propput, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)] - HRESULT FullScreen([in] VARIANT_BOOL bFullScreen); - } - - [ - uuid(D30C1661-CDAF-11d0-8A3E-00C04FC9E26E), // IID_IWebBrowser2 - helpstring("Web Browser Interface for IE4."), - helpcontext(0x0000), - hidden, - oleautomation, - dual - ] - interface IWebBrowser2 : IWebBrowserApp - { - [id(500), helpstring("Navigates to a URL or file or pidl."), helpcontext(0x0000)] - HRESULT Navigate2([in] VARIANT * URL, - [in, optional] VARIANT * Flags, - [in, optional] VARIANT * TargetFrameName, - [in, optional] VARIANT * PostData, - [in, optional] VARIANT * Headers); - - - [id(501), helpstring("IOleCommandTarget::QueryStatus"), helpcontext(0x0000)] - HRESULT QueryStatusWB([in] OLECMDID cmdID, [out, retval] OLECMDF * pcmdf); - [id(502), helpstring("IOleCommandTarget::Exec"), helpcontext(0x0000)] - HRESULT ExecWB([in] OLECMDID cmdID, [in] OLECMDEXECOPT cmdexecopt, [in, optional] VARIANT * pvaIn, [out, in, optional] VARIANT * pvaOut); - [id(503), helpstring("Set BrowserBar to Clsid"), helpcontext(0x0000)] - HRESULT ShowBrowserBar( [in] VARIANT * pvaClsid, - [in, optional] VARIANT * pvarShow, - [in, optional] VARIANT * pvarSize ); - - [id(DISPID_READYSTATE), propget, bindable] - HRESULT ReadyState([retval, out] READYSTATE * plReadyState); - - [id(550), propget, helpstring("Controls if the frame is offline (read from cache)"), helpcontext(0x0000)] - HRESULT Offline([out, retval] VARIANT_BOOL * pbOffline); - [id(550), propput, helpstring("Controls if the frame is offline (read from cache)"), helpcontext(0x0000)] - HRESULT Offline([in] VARIANT_BOOL bOffline); - - [id(551), propget, helpstring("Controls if any dialog boxes can be shown"), helpcontext(0x0000)] - HRESULT Silent([out, retval] VARIANT_BOOL * pbSilent); - [id(551), propput, helpstring("Controls if any dialog boxes can be shown"), helpcontext(0x0000)] - HRESULT Silent([in] VARIANT_BOOL bSilent); - - [id(552), propget, helpstring("Registers OC as a top-level browser (for target name resolution)"), helpcontext(0x0000)] - HRESULT RegisterAsBrowser([out, retval] VARIANT_BOOL * pbRegister); - [id(552), propput, helpstring("Registers OC as a top-level browser (for target name resolution)"), helpcontext(0x0000)] - HRESULT RegisterAsBrowser([in] VARIANT_BOOL bRegister); - - [id(553), propget, helpstring("Registers OC as a drop target for navigation"), helpcontext(0x0000)] - HRESULT RegisterAsDropTarget([out, retval] VARIANT_BOOL * pbRegister); - [id(553), propput, helpstring("Registers OC as a drop target for navigation"), helpcontext(0x0000)] - HRESULT RegisterAsDropTarget([in] VARIANT_BOOL bRegister); - - [id(554), propget, helpstring("Controls if the browser is in theater mode"), helpcontext(0x0000)] - HRESULT TheaterMode([out, retval] VARIANT_BOOL * pbRegister); - [id(554), propput, helpstring("Controls if the browser is in theater mode"), helpcontext(0x0000)] - HRESULT TheaterMode([in] VARIANT_BOOL bRegister); - - [id(555), propget, helpstring("Controls whether address bar is shown"), helpcontext(0x0000)] - HRESULT AddressBar([out, retval] VARIANT_BOOL * Value); - [id(555), propput, helpstring("Controls whether address bar is shown"), helpcontext(0x0000)] - HRESULT AddressBar([in] VARIANT_BOOL Value); - - [id(556), propget, helpstring("Controls whether the window is resizable"), helpcontext(0x0000)] - HRESULT Resizable([out, retval] VARIANT_BOOL * Value); - [id(556), propput, helpstring("Controls whether the window is resizable"), helpcontext(0x0000)] - HRESULT Resizable([in] VARIANT_BOOL Value); - } - - [ - 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(34A715A0-6587-11D0-924A-0020AFC7AC4D), // IID_DWebBrowserEvents2 - helpstring("Web Browser Control events interface"), - hidden - ] - dispinterface DWebBrowserEvents2 - { - properties: - methods: - [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_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_DOWNLOADCOMPLETE), helpstring("Download of page complete."), helpcontext(0x0000)] - void DownloadComplete(); - - [id(DISPID_TITLECHANGE), helpstring("Document title changed."), helpcontext(0x0000)] - void TitleChange([in] BSTR Text); - - [id(DISPID_PROPERTYCHANGE), helpstring("Fired when the PutProperty method has been called."), helpcontext(0x0000)] - void PropertyChange([in] BSTR szProperty); - - // New events for IE40: - // - [id(DISPID_BEFORENAVIGATE2), helpstring("Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified."), helpcontext(0x0000)] - void BeforeNavigate2([in] IDispatch* pDisp, - [in] VARIANT * URL, [in] VARIANT * Flags, [in] VARIANT * TargetFrameName, [in] VARIANT * PostData, [in] VARIANT * Headers, - [in,out] VARIANT_BOOL * Cancel); - - [id(DISPID_NEWWINDOW2), helpstring("A new, hidden, non-navigated WebBrowser window is needed."), helpcontext(0x0000)] - void NewWindow2([in, out] IDispatch** ppDisp, [in, out] VARIANT_BOOL * Cancel); - - [id(DISPID_NAVIGATECOMPLETE2), helpstring("Fired when the document being navigated to becomes visible and enters the navigation stack."), helpcontext(0x0000)] - void NavigateComplete2([in] IDispatch* pDisp, [in] VARIANT * URL ); - - [id(DISPID_DOCUMENTCOMPLETE), helpstring("Fired when the document being navigated to reaches ReadyState_Complete."), helpcontext(0x0000)] - void DocumentComplete([in] IDispatch* pDisp, [in] VARIANT * URL ); - - [id(DISPID_ONQUIT), helpstring("Fired when application is quiting."), helpcontext(0x0000)] - void OnQuit(); - - [id(DISPID_ONVISIBLE), helpstring("Fired when the window should be shown/hidden"), helpcontext(0x0000)] - void OnVisible([in] VARIANT_BOOL Visible); - - [id(DISPID_ONTOOLBAR), helpstring("Fired when the toolbar should be shown/hidden"), helpcontext(0x0000)] - void OnToolBar([in] VARIANT_BOOL ToolBar); - - [id(DISPID_ONMENUBAR), helpstring("Fired when the menubar should be shown/hidden"), helpcontext(0x0000)] - void OnMenuBar([in] VARIANT_BOOL MenuBar); - - [id(DISPID_ONSTATUSBAR), helpstring("Fired when the statusbar should be shown/hidden"), helpcontext(0x0000)] - void OnStatusBar([in] VARIANT_BOOL StatusBar); - - [id(DISPID_ONFULLSCREEN), helpstring("Fired when fullscreen mode should be on/off"), helpcontext(0x0000)] - void OnFullScreen([in] VARIANT_BOOL FullScreen); - - [id(DISPID_ONTHEATERMODE), helpstring("Fired when theater mode should be on/off"), helpcontext(0x0000)] - void OnTheaterMode([in] VARIANT_BOOL TheaterMode); - } - - // Now a private interface for those ActiveX programmers who want to get - // their hands on the Mozilla internal interfaces. Note that XPCOM - // interfaces are cast into void * parameters but they follow - // the normal COM refcounting rules for in, in-out & out parameters. - - [ - uuid(D6131E69-4A89-4ab5-B916-5A581D66C84F), - ] - interface IMozControlBridge : IUnknown - { - // Method to get the nsIWebBrowser interface (refcounted but cast into a void) - HRESULT GetWebBrowser([out] void **aBrowser); - } - - typedef - [ - uuid(34A226E0-DF30-11CF-89A9-00A0C9054129), - helpstring("Constants for WebBrowser CommandStateChange") - ] - enum CommandStateChangeConstants { - [helpstring("Command Change")] CSC_UPDATECOMMANDS = 0xFFFFFFFF, - [helpstring("Navigate Forward")] CSC_NAVIGATEFORWARD = 0x00000001, - [helpstring("Navigate Back")] CSC_NAVIGATEBACK = 0x00000002, - } CommandStateChangeConstants; - - [ - uuid(1339B54C-3453-11D2-93B9-000000000000), - helpstring("MozillaBrowser Class") - ] - coclass MozillaBrowser - { - [default] interface IWebBrowser2; - interface IWebBrowser; - interface IWebBrowserApp; - interface IDispatch; - [source] dispinterface DWebBrowserEvents; - [default, source] dispinterface DWebBrowserEvents2; - }; - - cpp_quote("#endif") -}; diff --git a/embedding/browser/activex/src/control/MozillaControl.rc b/embedding/browser/activex/src/control/MozillaControl.rc deleted file mode 100644 index 47bcdab2fd9..00000000000 --- a/embedding/browser/activex/src/control/MozillaControl.rc +++ /dev/null @@ -1,553 +0,0 @@ -// Microsoft Visual C++ 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 -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "1 TYPELIB ""MozillaControl.tlb""\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// 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 "040904e4" - BEGIN - VALUE "FileDescription", "Mozilla ActiveX control and plugin module" - VALUE "FileExtents", "*|*|*.axs" - VALUE "FileOpenName", "ActiveX (*.*)|ActiveX (*.*)|ActiveScript(*.axs)" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "MOZCTL" - VALUE "LegalCopyright", "Copyright 1999" - VALUE "MIMEType", "application/x-oleobject|application/oleobject|text/x-activescript" - VALUE "OriginalFilename", "MOZCTL.DLL" - VALUE "ProductName", "Mozilla ActiveX control and plugin support" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_MOZILLABROWSER REGISTRY "MozillaBrowser.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MOZILLABROWSER ICON "MozillaBrowser.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_POPUP_DOCUMENT MENU -BEGIN - POPUP "Page Popup" - BEGIN - MENUITEM "&Back", ID_DOCUMENT_BACK - MENUITEM "&Forward", ID_DOCUMENT_FORWARD - MENUITEM SEPARATOR - MENUITEM "Select &All", ID_DOCUMENT_SELECTALL - MENUITEM "&Paste", ID_DOCUMENT_PASTE - MENUITEM SEPARATOR - MENUITEM "&View Source", ID_DOCUMENT_VIEWSOURCE - , GRAYED - MENUITEM SEPARATOR - MENUITEM "Pr&int", ID_DOCUMENT_PRINT - MENUITEM "&Refresh", ID_DOCUMENT_REFRESH - MENUITEM SEPARATOR - MENUITEM "&Properties", ID_DOCUMENT_PROPERTIES - END -END - -IDR_POPUP_LINK MENU -BEGIN - POPUP "Link Popup" - BEGIN - MENUITEM "&Open", ID_LINK_OPEN - MENUITEM "Open in &New Window", ID_LINK_OPENINNEWWINDOW - MENUITEM SEPARATOR - MENUITEM "Copy Shor&tcut", ID_LINK_COPYSHORTCUT - MENUITEM SEPARATOR - MENUITEM "&Properties", ID_LINK_PROPERTIES - END -END - -IDR_POPUP_TEXT MENU -BEGIN - POPUP "Selection Popup" - BEGIN - MENUITEM "Cu&t", ID_TEXT_CUT, GRAYED - MENUITEM "&Copy", ID_TEXT_COPY - MENUITEM "&Paste", ID_TEXT_PASTE, GRAYED - MENUITEM "Select &All", ID_TEXT_SELECTALL - MENUITEM "Print", ID_TEXT_PRINT - END -END - -IDR_POPUP_IMAGE MENU -BEGIN - POPUP "Image Popup" - BEGIN - MENUITEM "Cu&t", ID_EDIT_CUT, GRAYED - MENUITEM "&Copy", ID_EDIT_COPY, GRAYED - MENUITEM "&Paste", ID_EDIT_PASTE, GRAYED - MENUITEM "Select &All", ID_EDIT_SELECTALL - MENUITEM "Print", ID_SELECTIONPOPUP_PRINT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PROMPT DIALOG 0, 0, 263, 113 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Enter Value" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Value:",IDC_STATIC,7,71,21,8 - EDITTEXT IDC_VALUE,32,71,224,14,ES_AUTOHSCROLL - CONTROL "Check msg",IDC_CHECKMSG,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,50,249,19 - DEFPUSHBUTTON "OK",IDOK,152,92,50,14 - PUSHBUTTON "Cancel",IDCANCEL,206,92,50,14 - LTEXT "Message",IDC_MESSAGE,36,7,220,41 - ICON IDI_MOZILLABROWSER,IDC_QUESTION,7,7,20,20 -END - -IDD_PROMPTUSERPASS DIALOG 0, 0, 263, 135 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Authentication Required" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Username:",IDC_STATIC,7,71,35,8 - EDITTEXT IDC_USERNAME,44,71,212,14,ES_AUTOHSCROLL - LTEXT "Password:",IDC_STATIC,7,92,34,8 - EDITTEXT IDC_PASSWORD,44,92,212,14,ES_PASSWORD | ES_AUTOHSCROLL - CONTROL "CheckMsg",IDC_CHECKMSG,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,50,249,19 - PUSHBUTTON "OK",IDOK,153,114,50,14 - PUSHBUTTON "Cancel",IDCANCEL,206,114,50,14 - LTEXT "Message",IDC_MESSAGE,36,7,220,41 - ICON IDI_MOZILLABROWSER,IDC_QUESTION,7,7,20,20 -END - -IDD_CONFIRMEX DIALOG 0, 0, 263, 95 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Confirmation" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "0",IDC_BUTTON0,195,75,65,14 - PUSHBUTTON "2",IDC_BUTTON2,55,75,65,14 - PUSHBUTTON "1",IDC_BUTTON1,125,75,65,14 - ICON IDI_MOZILLABROWSER,IDC_QUESTION,7,7,20,20 - LTEXT "Message",IDC_MESSAGE,36,7,220,41 - CONTROL "Check Msg",IDC_CHECKMSG,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,52,249,19 -END - -IDD_PPAGE_LINK DIALOG 0, 0, 185, 170 -STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Address: (URL)",IDC_STATIC,0,68,27,20 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,32,185,1 - LTEXT "type",IDC_TYPE,35,53,149,8 - LTEXT "Type:",IDC_STATIC,0,38,19,8 - LTEXT "protocol",IDC_PROTOCOL,35,38,149,8 - EDITTEXT IDC_ADDRESS,35,68,149,61,ES_MULTILINE | ES_AUTOVSCROLL | - ES_READONLY - ICON IDI_MOZILLABROWSER,IDC_STATIC,5,6,20,20 -END - -IDD_PAGESETUP DIALOGEX 0, 0, 276, 221 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Page Setup" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,167,200,50,14 - PUSHBUTTON "Cancel",IDCANCEL,219,200,50,14 - CONTROL "",IDC_TAB,"SysTabControl32",TCS_TOOLTIPS,7,7,262,191 - CONTROL "",IDC_PAGE_MARKER,"Static",SS_BLACKFRAME | NOT - WS_VISIBLE,10,23,255,170 -END - -IDD_PPAGE_MARGINS DIALOGEX 0, 0, 255, 170 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Margins (in millimeters)",IDC_STATIC,0,0,255,104 - GROUPBOX "Headers && Footers",IDC_STATIC,0,105,255,59 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,101,30,51,51 - RTEXT "Top:",IDC_STATIC,84,16,16,8 - EDITTEXT IDC_MARGIN_TOP,107,13,40,14,ES_AUTOHSCROLL - LTEXT "Left:",IDC_STATIC,56,36,16,8 - EDITTEXT IDC_MARGIN_LEFT,56,48,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_MARGIN_BOTTOM,107,84,40,14,ES_AUTOHSCROLL - RTEXT "Bottom:",IDC_STATIC,74,87,26,8 - LTEXT "Right:",IDC_STATIC,157,36,20,8 - EDITTEXT IDC_MARGIN_RIGHT,157,48,40,14,ES_AUTOHSCROLL - COMBOBOX IDC_HDR_LEFT,26,117,61,126,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - COMBOBOX IDC_HDR_MIDDLE,96,117,61,155,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_HDR_RIGHT,164,117,61,157,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_FTR_LEFT,26,144,61,99,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - COMBOBOX IDC_FTR_MIDDLE,96,144,61,104,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_FTR_RIGHT,164,144,61,138,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Left:",IDC_STATIC,48,133,16,8 - LTEXT "Center:",IDC_STATIC,113,133,26,8 - LTEXT "Right:",IDC_STATIC,184,133,20,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_PROMPT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 256 - TOPMARGIN, 7 - BOTTOMMARGIN, 106 - END - - IDD_PROMPTUSERPASS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 256 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_CONFIRMEX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 256 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 - END - - IDD_PAGESETUP, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 269 - TOPMARGIN, 7 - BOTTOMMARGIN, 214 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_PROJNAME "MozillaControl" - IDS_HEADERFOOTER_OPTIONS - "-- Blank --|Title|URL|Date/Time|Page #|Page # of #||Custom..." -END - -STRINGTABLE -BEGIN - IDS_LOCATEMOZILLA "The browser control does not know where Mozilla is installed and may not function correctly.\nDo you want to locate Mozilla now?" - IDS_LOCATEMOZILLATITLE "Cannot locate Mozilla bin directory" - IDS_CANNOTCREATEPREFS "The Mozilla control cannot create a critical component. This prevents the control from functioning correctly. Possible reasons for the problem are:\n\n1. The PATH environment variable does not point to the Mozilla bin directory.\n2. The registry key HKEY_LOCAL_MACHINE\\Software\\Mozilla\\BinDirectoryPath registry key has not been set or is incorrect\n3. The file component.reg has not been generated or is empty.\n\nPlease refer to http://www.iol.ie/~locka/mozilla/mozilla.htm for guidance on how to resolve these problems." -END - -STRINGTABLE -BEGIN - IDS_CONFIRMEX_OK "OK" - IDS_CONFIRMEX_CANCEL "Cancel" - IDS_CONFIRMEX_YES "Yes" - IDS_CONFIRMEX_NO "No" - IDS_CONFIRMEX_SAVE "Save" - IDS_CONFIRMEX_DONTSAVE "Don't Save" - IDS_CONFIRMEX_REVERT "Revert" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PROPERTIES DIALOG 0, 0, 199, 204 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Properties" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,88,183,50,14 - PUSHBUTTON "Close",IDCLOSE,142,183,50,14 - CONTROL "",IDC_PPAGE_MARKER,"Static",SS_BLACKFRAME | NOT - WS_VISIBLE,7,7,185,170 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_PROPERTIES, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 192 - TOPMARGIN, 7 - BOTTOMMARGIN, 197 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (Ireland) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENI) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_EIRE -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_HELPERAPP DIALOG 0, 0, 285, 161 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Downloading" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDI_MOZILLABROWSER,IDC_STATIC,7,7,21,20 - LTEXT "You have chosen to download a file that requires special handling. What would you like to do with this file?", - IDC_MESSAGE,34,7,244,21 - CONTROL "Open with the specified application",IDC_OPENWITHAPP, - "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,40, - 219,10 - PUSHBUTTON "&Choose...",IDC_CHOOSE,228,38,50,14 - CONTROL "Save to file",IDC_SAVETOFILE,"Button", - BS_AUTORADIOBUTTON,7,53,51,10 - GROUPBOX "Details",IDC_STATIC,7,68,271,67 - DEFPUSHBUTTON "OK",IDOK,173,139,50,14 - PUSHBUTTON "Cancel",IDCANCEL,228,139,50,14 - LTEXT "Location:",IDC_STATIC,13,82,30,8 - EDITTEXT IDC_URL,63,79,208,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Content Type:",IDC_STATIC,13,99,46,8 - EDITTEXT IDC_CONTENTTYPE,63,96,208,14,ES_AUTOHSCROLL | - ES_READONLY - LTEXT "Application:",IDC_STATIC,13,116,38,8 - EDITTEXT IDC_APPLICATION,63,113,208,14,ES_AUTOHSCROLL | - ES_READONLY -END - -IDD_PROGRESS DIALOG 0, 0, 244, 102 -STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | - WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Download progress:",IDC_STATIC,7,7,150,8 - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7, - 23,230,10 - LTEXT "Source:",IDC_STATIC,7,44,26,8 - EDITTEXT IDC_SOURCE,50,42,187,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Destination:",IDC_STATIC,7,64,38,8 - EDITTEXT IDC_DESTINATION,50,62,187,14,ES_AUTOHSCROLL | - ES_READONLY - PUSHBUTTON "Cancel",IDCANCEL,96,81,50,14 -END - -IDD_PPAGE_FORMAT DIALOGEX 0, 0, 255, 170 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Format",IDC_STATIC,0,0,255,91 - GROUPBOX "Options",IDC_STATIC,0,95,255,35 - CONTROL "Print Background (colors && images)", - IDC_PRINTBACKGROUND,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,109,127,10 - LTEXT "Orientation:",IDC_STATIC,7,13,40,8 - CONTROL "Portrait",IDC_PORTRAIT,"Button",BS_AUTORADIOBUTTON,91, - 13,40,10 - CONTROL "Landscape",IDC_LANDSCAPE,"Button",BS_AUTORADIOBUTTON,91, - 30,50,10 - LTEXT "Scale:",IDC_STATIC,7,67,20,8 - EDITTEXT IDC_SCALE,37,64,30,14,ES_AUTOHSCROLL - LTEXT "%",IDC_STATIC,73,67,8,8 - CONTROL "Shrink to fit page width",IDC_SHRINKTOFIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,87,67,90,10 -END - -IDD_CUSTOM_FIELD DIALOGEX 0, 0, 262, 96 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Custom Value" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Value:",IDC_STATIC,7,37,21,8 - EDITTEXT IDC_VALUE,7,48,248,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,151,75,50,14 - PUSHBUTTON "Cancel",IDCANCEL,205,75,50,14 - LTEXT "Type the value you wish to show in the page.", - IDC_MESSAGE,35,7,220,35 - ICON IDI_MOZILLABROWSER,IDC_QUESTION,7,7,21,20 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_HELPERAPP, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 278 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_PROGRESS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 237 - TOPMARGIN, 7 - BOTTOMMARGIN, 95 - END - - IDD_CUSTOM_FIELD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 255 - TOPMARGIN, 7 - BOTTOMMARGIN, 89 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (Ireland) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -1 TYPELIB "MozillaControl.tlb" - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/src/control/PageSetupDlg.h b/embedding/browser/activex/src/control/PageSetupDlg.h deleted file mode 100644 index 2c12930d375..00000000000 --- a/embedding/browser/activex/src/control/PageSetupDlg.h +++ /dev/null @@ -1,503 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef PAGESETUPDLG_H -#define PAGESETUPDLG_H - -#include "resource.h" - -#include "nsIPrintSettings.h" - -/* VC98 doesn't define _tstof() */ -#if defined(_MSC_VER) && _MSC_VER < 1300 -#ifndef UNICODE -#define _tstof atof -#else -inline double _wtof(const wchar_t *string) -{ - USES_CONVERSION; - return atof(W2CA(string)); -} -#define _tstof _wtof -#endif -#endif - -class CCustomFieldDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_CUSTOM_FIELD }; - - BEGIN_MSG_MAP(CCustomFieldDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDOK, OnOK) - COMMAND_ID_HANDLER(IDCANCEL, OnCancel) - END_MSG_MAP() - - nsString m_field; - - CCustomFieldDlg(const nsAString &str) : - m_field(str) - { - } - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) - { - USES_CONVERSION; - SetDlgItemText(IDC_VALUE, W2CT(m_field.get())); - return 0; - } - - LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - TCHAR szBuf[128]; - GetDlgItemText(IDC_VALUE, szBuf, sizeof(szBuf) / sizeof(szBuf[0])); - USES_CONVERSION; - m_field = T2CW(szBuf); - EndDialog(IDOK); - return 0; - } - - LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - EndDialog(IDCANCEL); - return 0; - } -}; - -class CPageSetupFormatDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_PPAGE_FORMAT }; - - BEGIN_MSG_MAP(CPageSetupFormatDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDC_SHRINKTOFIT, OnClickShrinkToFit) - END_MSG_MAP() - - CPageSetupFormatDlg() - { - } - - void Init(nsIPrintSettings *aPrintSettings) - { - // Set landscape / portrait mode - PRInt32 orientation = nsIPrintSettings::kPortraitOrientation; - aPrintSettings->GetOrientation(&orientation); - SendDlgItemMessage( - (orientation == nsIPrintSettings::kPortraitOrientation) - ? IDC_PORTRAIT : IDC_LANDSCAPE, - BM_SETCHECK, - BST_CHECKED, 0); - - // Set scaling - TCHAR szBuf[10]; - double scaling = 1.0; - aPrintSettings->GetScaling(&scaling); - _stprintf(szBuf, _T("%.1f"), scaling * 100.0); - SetDlgItemText(IDC_SCALE, szBuf); - - // Set shrink to fit (& disable scale field) - PRBool shrinkToFit = PR_FALSE; - aPrintSettings->GetShrinkToFit(&shrinkToFit); - CheckDlgButton(IDC_SHRINKTOFIT, shrinkToFit ? BST_CHECKED : BST_UNCHECKED); - ::EnableWindow(GetDlgItem(IDC_SCALE), shrinkToFit ? FALSE : TRUE); - - // Print background - we use PrintBGColors to control both images & colours - PRBool printBGColors = PR_TRUE; - aPrintSettings->GetPrintBGColors(&printBGColors); - CheckDlgButton(IDC_PRINTBACKGROUND, printBGColors ? BST_CHECKED : BST_UNCHECKED); - } - - void Apply(nsIPrintSettings *aPrintSettings) - { - - // Background options are tied to a single checkbox - PRBool boolVal = - (SendDlgItemMessage(IDC_PRINTBACKGROUND, BM_GETCHECK) == BST_CHECKED) ? - PR_TRUE : PR_FALSE; - aPrintSettings->SetPrintBGColors(boolVal); - aPrintSettings->SetPrintBGImages(boolVal); - - // Print scale - TCHAR szBuf[128]; - GetDlgItemText(IDC_SCALE, szBuf, sizeof(szBuf) / sizeof(szBuf[0])); - double scale = _tstof(szBuf) / 100.0; - aPrintSettings->SetScaling(scale); - - // Shrink to fit - PRBool shrinkToFit = - (IsDlgButtonChecked(IDC_SHRINKTOFIT) == BST_CHECKED) ? PR_TRUE : PR_FALSE; - aPrintSettings->SetShrinkToFit(shrinkToFit); - - // Landscape or portrait - PRInt32 orientation = nsIPrintSettings::kLandscapeOrientation; - if (SendDlgItemMessage(IDC_PORTRAIT, BM_GETCHECK) == BST_CHECKED) - { - orientation = nsIPrintSettings::kPortraitOrientation; - } - aPrintSettings->SetOrientation(orientation); - } - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) - { - return 0; - } - - LRESULT OnClickShrinkToFit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - BOOL bEnableScale = TRUE; - if (IsDlgButtonChecked(IDC_SHRINKTOFIT) == BST_CHECKED) - bEnableScale = FALSE; - ::EnableWindow(GetDlgItem(IDC_SCALE), bEnableScale); - return 0; - } -}; - -class CPageSetupMarginsDlg : public CDialogImpl -{ -public: - nsString mHdrLeft; - nsString mHdrCenter; - nsString mHdrRight; - nsString mFtrLeft; - nsString mFtrCenter; - nsString mFtrRight; - - enum { IDD = IDD_PPAGE_MARGINS }; - - BEGIN_MSG_MAP(CPageSetupMarginsDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_RANGE_HANDLER(IDC_HDR_LEFT, IDC_FTR_RIGHT, OnHeaderFooterChange) - END_MSG_MAP() - - CPageSetupMarginsDlg() - { - } - - const wchar_t * const * GetHeaderFooterValues(size_t &aNumValues) const - { - static const wchar_t *szValues[] = { - L"", - L"&T", - L"&U", - L"&D", - L"&P", - L"&PT" - }; - aNumValues = sizeof(szValues) / sizeof(szValues[0]); - return szValues; - } - - const TCHAR * const * GetHeaderFooterOptions(size_t &aNumOptions) const - { - static const TCHAR *szOptions[] = - { - _T("-- Blank --"), - _T("Title"), - _T("URL"), - _T("Date/Time"), - _T("Page #"), - _T("Page # of #"), - _T("Custom...") - }; - aNumOptions = sizeof(szOptions) / sizeof(szOptions[0]); - return szOptions; - } - - void Init(nsIPrintSettings *aPrintSettings) - { - double top = 0.0; - double left = 0.0; - double right = 0.0; - double bottom = 0.0; - aPrintSettings->GetMarginTop(&top); - aPrintSettings->GetMarginLeft(&left); - aPrintSettings->GetMarginRight(&right); - aPrintSettings->GetMarginBottom(&bottom); - - // Get the margins - TCHAR szBuf[16]; - _stprintf(szBuf, _T("%5.2f"), top); - SetDlgItemText(IDC_MARGIN_TOP, szBuf); - _stprintf(szBuf, _T("%5.2f"), left); - SetDlgItemText(IDC_MARGIN_LEFT, szBuf); - _stprintf(szBuf, _T("%5.2f"), right); - SetDlgItemText(IDC_MARGIN_RIGHT, szBuf); - _stprintf(szBuf, _T("%5.2f"), bottom); - SetDlgItemText(IDC_MARGIN_BOTTOM, szBuf); - - // Get the header & footer settings - PRUnichar* uStr = nsnull; - aPrintSettings->GetHeaderStrLeft(&uStr); - mHdrLeft = uStr; - SetComboIndex(IDC_HDR_LEFT, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - - aPrintSettings->GetHeaderStrCenter(&uStr); - mHdrCenter = uStr; - SetComboIndex(IDC_HDR_MIDDLE, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - - aPrintSettings->GetHeaderStrRight(&uStr); - mHdrRight = uStr; - SetComboIndex(IDC_HDR_RIGHT, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - - aPrintSettings->GetFooterStrLeft(&uStr); - mFtrLeft = uStr; - SetComboIndex(IDC_FTR_LEFT, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - - aPrintSettings->GetFooterStrCenter(&uStr); - mFtrCenter = uStr; - SetComboIndex(IDC_FTR_MIDDLE, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - - aPrintSettings->GetFooterStrRight(&uStr); - mFtrRight = uStr; - SetComboIndex(IDC_FTR_RIGHT, uStr); - if (uStr != nsnull) nsMemory::Free(uStr); - } - - void SetComboIndex(int aID, const wchar_t *szValue) - { - size_t nValues; - const wchar_t * const * szValues = GetHeaderFooterValues(nValues); - - int nCurSel = 0; - if (szValue[0] != L'\0') - { - while (nCurSel < nValues) - { - if (wcscmp(szValue, szValues[nCurSel]) == 0) - { - break; - } - ++nCurSel; - } - // nCurSel might contain nValues but that just means the - // Custom... field gets selected. - } - SendDlgItemMessage(aID, CB_SETCURSEL, nCurSel); - } - - void Apply(nsIPrintSettings *aPrintSettings) - { - TCHAR szBuf[128]; - const size_t kBufSize = sizeof(szBuf) / sizeof(szBuf[0]); - - GetDlgItemText(IDC_MARGIN_TOP, szBuf, kBufSize); - aPrintSettings->SetMarginTop(_tstof(szBuf)); - GetDlgItemText(IDC_MARGIN_LEFT, szBuf, kBufSize); - aPrintSettings->SetMarginLeft(_tstof(szBuf)); - GetDlgItemText(IDC_MARGIN_BOTTOM, szBuf, kBufSize); - aPrintSettings->SetMarginBottom(_tstof(szBuf)); - GetDlgItemText(IDC_MARGIN_RIGHT, szBuf, kBufSize); - aPrintSettings->SetMarginRight(_tstof(szBuf)); - - aPrintSettings->SetHeaderStrLeft(mHdrLeft.get()); - aPrintSettings->SetHeaderStrCenter(mHdrCenter.get()); - aPrintSettings->SetHeaderStrRight(mHdrRight.get()); - aPrintSettings->SetFooterStrLeft(mFtrLeft.get()); - aPrintSettings->SetFooterStrCenter(mFtrCenter.get()); - aPrintSettings->SetFooterStrRight(mFtrRight.get()); - } - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) - { - size_t nOptions; - const TCHAR * const *szOptions = GetHeaderFooterOptions(nOptions); - - // Fill out the drop down choices - for (size_t i = 0; i < nOptions; ++i) - { - const TCHAR *szOption = szOptions[i]; - SendDlgItemMessage(IDC_HDR_LEFT, CB_ADDSTRING, 0, LPARAM(szOption)); - SendDlgItemMessage(IDC_HDR_MIDDLE, CB_ADDSTRING, 0, LPARAM(szOption)); - SendDlgItemMessage(IDC_HDR_RIGHT, CB_ADDSTRING, 0, LPARAM(szOption)); - SendDlgItemMessage(IDC_FTR_LEFT, CB_ADDSTRING, 0, LPARAM(szOption)); - SendDlgItemMessage(IDC_FTR_MIDDLE, CB_ADDSTRING, 0, LPARAM(szOption)); - SendDlgItemMessage(IDC_FTR_RIGHT, CB_ADDSTRING, 0, LPARAM(szOption)); - } - return 0; - } - - LRESULT OnHeaderFooterChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - if (wNotifyCode != CBN_SELCHANGE) - { - bHandled = FALSE; - return 0; - } - - // One of the header / footer combos has changed, so set the string - // to the updated value. - - nsString *pStr = nsnull; - switch (wID) - { - case IDC_HDR_LEFT: pStr = &mHdrLeft; break; - case IDC_HDR_MIDDLE: pStr = &mHdrCenter; break; - case IDC_HDR_RIGHT: pStr = &mHdrRight; break; - case IDC_FTR_LEFT: pStr = &mFtrLeft; break; - case IDC_FTR_MIDDLE: pStr = &mFtrCenter; break; - case IDC_FTR_RIGHT: pStr = &mFtrRight; break; - } - if (!pStr) - { - return 0; - } - - size_t nValues; - const wchar_t * const * szValues = GetHeaderFooterValues(nValues); - - int nCurSel = SendDlgItemMessage(wID, CB_GETCURSEL); - if (nCurSel == nValues) // Custom... - { - CCustomFieldDlg dlg(*pStr); - if (dlg.DoModal() == IDOK) - { - *pStr = dlg.m_field; - } - // Update combo in case their custom value is not custom at all - // For example, if someone opens the custom dlg and types "&P" - // (i.e. "Page #"), we should select that since it is already a - // choice in the combo. - SetComboIndex(wID, pStr->get()); - } - else - { - *pStr = szValues[nCurSel]; - } - - return 0; - } - -}; -class CPageSetupDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_PAGESETUP }; - - CPPageDlg *mPPage; - - BEGIN_MSG_MAP(CPageSetupDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - NOTIFY_HANDLER(IDC_TAB, TCN_SELCHANGE, OnTabSelChange) - COMMAND_ID_HANDLER(IDOK, OnOK) - COMMAND_ID_HANDLER(IDCANCEL, OnCancel) - END_MSG_MAP() - - nsCOMPtr mPrintSettings; - CPageSetupFormatDlg mFormatDlg; - CPageSetupMarginsDlg mMarginsDlg; - - CPageSetupDlg(nsIPrintSettings *aPrintSettings) : - mPrintSettings(aPrintSettings) - { - } - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) - { - // The marker tells us where to stick the pages - RECT rcMarker; - ::GetWindowRect(GetDlgItem(IDC_PAGE_MARKER), &rcMarker); - ScreenToClient(&rcMarker); - - // Create the two pages, the first is shown, the second is not - mFormatDlg.Create(m_hWnd); - mFormatDlg.Init(mPrintSettings); - mFormatDlg.SetWindowPos(HWND_TOP, &rcMarker, SWP_SHOWWINDOW); - - mMarginsDlg.Create(m_hWnd); - mMarginsDlg.Init(mPrintSettings); - mMarginsDlg.SetWindowPos(HWND_TOP, &rcMarker, SWP_HIDEWINDOW); - - // Get the tab control - HWND hwndTab = GetDlgItem(IDC_TAB); - - TCITEM tcItem; - - memset(&tcItem, 0, sizeof(tcItem)); - tcItem.mask = TCIF_TEXT; - - tcItem.pszText = _T("Format && Options"); - TabCtrl_InsertItem(hwndTab, 0, &tcItem); - - tcItem.pszText = _T("Margins && Header / Footer"); - TabCtrl_InsertItem(hwndTab, 1, &tcItem); - - TabCtrl_SetCurSel(hwndTab, 0); - - return 0; - } - - LRESULT OnTabSelChange(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) - { - HWND hwndTab = GetDlgItem(IDC_TAB); - if (TabCtrl_GetCurSel(hwndTab) == 0) - { - mFormatDlg.SetWindowPos(HWND_TOP, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - mMarginsDlg.ShowWindow(SW_HIDE); - } - else - { - mMarginsDlg.SetWindowPos(HWND_TOP, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - mFormatDlg.ShowWindow(SW_HIDE); - } - return 0; - } - - LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - mFormatDlg.Apply(mPrintSettings); - mMarginsDlg.Apply(mPrintSettings); - EndDialog(IDOK); - return 0; - } - - LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) - { - EndDialog(IDCANCEL); - return 0; - } -}; - -#endif diff --git a/embedding/browser/activex/src/control/PromptService.cpp b/embedding/browser/activex/src/control/PromptService.cpp deleted file mode 100644 index 64247188626..00000000000 --- a/embedding/browser/activex/src/control/PromptService.cpp +++ /dev/null @@ -1,899 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "StdAfx.h" - -#include "MozillaBrowser.h" -#include "PromptService.h" - -#include "nsCOMPtr.h" - -#include "nsIPromptService.h" -#include "nsIFactory.h" -#include "nsIDOMWindow.h" - -class PromptDlg -{ -public: - PromptDlg(); - virtual ~PromptDlg(); - - nsresult ConfirmCheck( - HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval); - - nsresult ConfirmEx( - HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUint32 buttonFlags, - const PRUnichar *button0Title, - const PRUnichar *button1Title, - const PRUnichar *button2Title, - const PRUnichar *checkMsg, PRBool *checkValue, - PRInt32 *buttonPressed); - - nsresult Prompt(HWND hwndParent, const PRUnichar *dialogTitle, - const PRUnichar *text, PRUnichar **value, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval); - - nsresult PromptUsernameAndPassword(HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **username, PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval); - - nsresult PromptPassword(HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval); - -protected: - static INT_PTR CALLBACK ConfirmProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - static INT_PTR CALLBACK PromptProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - - TCHAR *mTitle; - TCHAR *mMessage; - TCHAR *mCheckMessage; - BOOL mCheckValue; - TCHAR *mButtonTitles[3]; - TCHAR *mUsername; - TCHAR *mPassword; - TCHAR *mValue; - - enum { - PROMPT_USERPASS, - PROMPT_PASS, - PROMPT_VALUE - } mPromptMode; -}; - -PromptDlg::PromptDlg() : - mMessage(NULL), - mCheckMessage(NULL), - mCheckValue(FALSE), - mUsername(NULL), - mPassword(NULL), - mValue(NULL), - mTitle(NULL), - mPromptMode(PROMPT_USERPASS) -{ - for (int i = 0; i < 3; i++) - { - mButtonTitles[i] = NULL; - } -} - -PromptDlg::~PromptDlg() -{ - if (mTitle) - free(mTitle); - if (mMessage) - free(mMessage); - if (mCheckMessage) - free(mCheckMessage); - if (mUsername) - free(mUsername); - if (mPassword) - free(mPassword); - if (mValue) - free(mValue); - for (int i = 0; i < 3; i++) - { - if (mButtonTitles[i]) - { - free(mButtonTitles[i]); - } - } -} - -nsresult PromptDlg::ConfirmCheck( - HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - NS_ENSURE_ARG_POINTER(_retval); - - PRInt32 buttonPressed = 0; - PRUint32 buttonFlags = nsIPromptService::BUTTON_TITLE_YES + - (nsIPromptService::BUTTON_TITLE_NO << 8); - - // Use the extended confirmation dialog with Yes & No buttons - nsresult rv = ConfirmEx(hwndParent, dialogTitle, text, - buttonFlags, NULL, NULL, NULL, - checkMsg, checkValue, &buttonPressed); - - if (NS_SUCCEEDED(rv)) - { - *_retval = (buttonPressed == 0) ? PR_TRUE : PR_FALSE; - } - - return rv; -} - -nsresult PromptDlg::ConfirmEx( - HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUint32 buttonFlags, - const PRUnichar *button0Title, - const PRUnichar *button1Title, - const PRUnichar *button2Title, - const PRUnichar *checkMsg, PRBool *checkValue, - PRInt32 *buttonPressed) -{ - NS_ENSURE_ARG_POINTER(dialogTitle); - NS_ENSURE_ARG_POINTER(text); - NS_ENSURE_ARG_POINTER(buttonPressed); - - HINSTANCE hInstResource = _Module.m_hInstResource; - - USES_CONVERSION; - - // Duplicate all strings, turning them into TCHARs - - mTitle = _tcsdup(W2T(dialogTitle)); - mMessage = _tcsdup(W2T(text)); - if (checkMsg) - { - NS_ENSURE_ARG_POINTER(checkValue); - mCheckMessage = _tcsdup(W2T(checkMsg)); - mCheckValue = *checkValue ? TRUE : FALSE; - } - - // Turn the button flags into strings. The nsIPromptService flags - // are scary bit shifted values which explains the masks and bit - // shifting happening in this loop. - - for (int i = 0; i < 3; i++) - { - PRUint32 titleId = buttonFlags & 255; - TCHAR **title = &mButtonTitles[i]; - switch (titleId) - { - case nsIPromptService::BUTTON_TITLE_OK: - case nsIPromptService::BUTTON_TITLE_CANCEL: - case nsIPromptService::BUTTON_TITLE_YES: - case nsIPromptService::BUTTON_TITLE_NO: - case nsIPromptService::BUTTON_TITLE_SAVE: - case nsIPromptService::BUTTON_TITLE_DONT_SAVE: - case nsIPromptService::BUTTON_TITLE_REVERT: - { - const int kTitleSize = 256; - int stringId = IDS_CONFIRMEX_OK + titleId - nsIPromptService::BUTTON_TITLE_OK; - *title = (TCHAR *) malloc(sizeof(TCHAR) * kTitleSize); - ::LoadString(hInstResource, stringId, *title, kTitleSize - 1); - break; - } - case nsIPromptService::BUTTON_TITLE_IS_STRING: - { - const PRUnichar *srcTitle = - (i == 0) ? button0Title : - (i == 1) ? button1Title : button2Title; - if (srcTitle) - { - *title = _tcsdup(W2T(srcTitle)); - } - break; - } - default: - // ANYTHING ELSE GETS IGNORED - break; - } - buttonFlags >>= 8; - } - - // Must have at least one button the user can click on! - NS_ENSURE_ARG_POINTER(mButtonTitles[0]); - - INT result = DialogBoxParam(hInstResource, - MAKEINTRESOURCE(IDD_CONFIRMEX), hwndParent, ConfirmProc, (LPARAM) this); - - if (checkValue) - *checkValue = mCheckValue; - - if (buttonPressed) - *buttonPressed = result; - - return NS_OK; -} - -nsresult -PromptDlg::Prompt(HWND hwndParent, const PRUnichar *dialogTitle, - const PRUnichar *text, PRUnichar **value, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - NS_ENSURE_ARG_POINTER(text); - NS_ENSURE_ARG_POINTER(_retval); - - HINSTANCE hInstResource = _Module.m_hInstResource; - - USES_CONVERSION; - - // Duplicate all strings, turning them into TCHARs - - if (dialogTitle) - mTitle = _tcsdup(W2T(dialogTitle)); - mMessage = _tcsdup(W2T(text)); - if (checkMsg) - { - NS_ENSURE_ARG_POINTER(checkValue); - mCheckMessage = _tcsdup(W2T(checkMsg)); - mCheckValue = *checkValue ? TRUE : FALSE; - } - if (value) - { - mValue = _tcsdup(W2T(*value)); - } - - mPromptMode = PROMPT_VALUE; - INT result = DialogBoxParam(hInstResource, - MAKEINTRESOURCE(IDD_PROMPT), hwndParent, PromptProc, (LPARAM) this); - - if (result == IDOK) - { - if (value) - { - if (*value) - nsMemory::Free(*value); - nsAutoString v(T2W(mValue)); - *value = ToNewUnicode(v); - } - - if (checkValue) - *checkValue = mCheckValue; - - *_retval = TRUE; - } - else - { - *_retval = FALSE; - } - - return NS_OK; -} - -nsresult -PromptDlg::PromptUsernameAndPassword(HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **username, PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - NS_ENSURE_ARG_POINTER(text); - NS_ENSURE_ARG_POINTER(_retval); - - HINSTANCE hInstResource = _Module.m_hInstResource; - - USES_CONVERSION; - - // Duplicate all strings, turning them into TCHARs - - if (dialogTitle) - mTitle = _tcsdup(W2T(dialogTitle)); - mMessage = _tcsdup(W2T(text)); - if (checkMsg) - { - NS_ENSURE_ARG_POINTER(checkValue); - mCheckMessage = _tcsdup(W2T(checkMsg)); - mCheckValue = *checkValue ? TRUE : FALSE; - } - if (username) - { - mUsername = _tcsdup(W2T(*username)); - } - if (password) - { - mPassword = _tcsdup(W2T(*password)); - } - - mPromptMode = PROMPT_USERPASS; - INT result = DialogBoxParam(hInstResource, - MAKEINTRESOURCE(IDD_PROMPTUSERPASS), hwndParent, PromptProc, (LPARAM) this); - - if (result == IDOK) - { - if (username) - { - if (*username) - nsMemory::Free(*username); - nsAutoString user(T2W(mUsername)); - *username = ToNewUnicode(user); - } - if (password) - { - if (*password) - nsMemory::Free(*password); - nsAutoString pass(T2W(mPassword)); - *password = ToNewUnicode(pass); - } - - if (checkValue) - *checkValue = mCheckValue; - - *_retval = TRUE; - } - else - { - *_retval = FALSE; - } - - return NS_OK; -} - -nsresult -PromptDlg::PromptPassword(HWND hwndParent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - NS_ENSURE_ARG_POINTER(text); - NS_ENSURE_ARG_POINTER(_retval); - - HINSTANCE hInstResource = _Module.m_hInstResource; - - USES_CONVERSION; - - // Duplicate all strings, turning them into TCHARs - - if (dialogTitle) - mTitle = _tcsdup(W2T(dialogTitle)); - mMessage = _tcsdup(W2T(text)); - if (checkMsg) - { - NS_ENSURE_ARG_POINTER(checkValue); - mCheckMessage = _tcsdup(W2T(checkMsg)); - mCheckValue = *checkValue ? TRUE : FALSE; - } - if (password) - { - mPassword = _tcsdup(W2T(*password)); - } - - mPromptMode = PROMPT_PASS; - INT result = DialogBoxParam(hInstResource, - MAKEINTRESOURCE(IDD_PROMPTUSERPASS), hwndParent, PromptProc, (LPARAM) this); - - if (result == IDOK) - { - if (password) - { - if (*password) - nsMemory::Free(*password); - nsAutoString pass(T2W(mPassword)); - *password = ToNewUnicode(pass); - } - - if (checkValue) - *checkValue = mCheckValue; - - *_retval = TRUE; - } - else - { - *_retval = FALSE; - } - - return NS_OK; -} - - -INT_PTR CALLBACK -PromptDlg::PromptProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - PromptDlg *pThis = (PromptDlg *) GetWindowLongPtr(hwndDlg, DWLP_USER); - switch (uMsg) - { - case WM_INITDIALOG: - // Initialise pThis - SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); - pThis = (PromptDlg *) lParam; - - // Set dialog title & message text - if (pThis->mTitle) - SetWindowText(hwndDlg, pThis->mTitle); - - SetDlgItemText(hwndDlg, IDC_MESSAGE, pThis->mMessage); - - // Set check message text - if (pThis->mCheckMessage) - { - SetDlgItemText(hwndDlg, IDC_CHECKMSG, pThis->mCheckMessage); - CheckDlgButton(hwndDlg, IDC_CHECKMSG, pThis->mCheckValue ? BST_CHECKED : BST_UNCHECKED); - } - else - { - ShowWindow(GetDlgItem(hwndDlg, IDC_CHECKMSG), SW_HIDE); - } - - switch (pThis->mPromptMode) - { - case PROMPT_PASS: - EnableWindow(GetDlgItem(hwndDlg, IDC_USERNAME), FALSE); - if (pThis->mPassword) - { - SetDlgItemText(hwndDlg, IDC_PASSWORD, pThis->mPassword); - } - break; - case PROMPT_USERPASS: - if (pThis->mUsername) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, pThis->mUsername); - } - if (pThis->mPassword) - { - SetDlgItemText(hwndDlg, IDC_PASSWORD, pThis->mPassword); - } - break; - case PROMPT_VALUE: - if (pThis->mValue) - { - SetDlgItemText(hwndDlg, IDC_VALUE, pThis->mValue); - } - break; - } - - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED) - { - int id = LOWORD(wParam); - if (id == IDOK) - { - if (pThis->mCheckMessage) - { - pThis->mCheckValue = - (IsDlgButtonChecked(hwndDlg, IDC_CHECKMSG) == BST_CHECKED) ? - TRUE : FALSE; - } - - const int bufferSize = 256; - TCHAR buffer[bufferSize]; - - switch (pThis->mPromptMode) - { - case PROMPT_USERPASS: - if (pThis->mUsername) - { - free(pThis->mUsername); - } - memset(buffer, 0, sizeof(buffer)); - GetDlgItemText(hwndDlg, IDC_USERNAME, buffer, bufferSize); - pThis->mUsername = _tcsdup(buffer); - - // DROP THROUGH !!!! - - case PROMPT_PASS: - if (pThis->mPassword) - { - free(pThis->mPassword); - } - memset(buffer, 0, sizeof(buffer)); - GetDlgItemText(hwndDlg, IDC_PASSWORD, buffer, bufferSize); - pThis->mPassword = _tcsdup(buffer); - break; - - case PROMPT_VALUE: - if (pThis->mValue) - { - free(pThis->mValue); - } - memset(buffer, 0, sizeof(buffer)); - GetDlgItemText(hwndDlg, IDC_VALUE, buffer, bufferSize); - pThis->mValue = _tcsdup(buffer); - break; - } - EndDialog(hwndDlg, IDOK); - } - else if (id == IDCANCEL) - { - EndDialog(hwndDlg, IDCANCEL); - } - } - return TRUE; - } - return FALSE; -} - -INT_PTR CALLBACK -PromptDlg::ConfirmProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - PromptDlg *pThis = (PromptDlg *) GetWindowLongPtr(hwndDlg, DWLP_USER); - int i; - - switch (uMsg) - { - case WM_INITDIALOG: - - // Initialise pThis - SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); - pThis = (PromptDlg *) lParam; - - // Set dialog title & message text - SetWindowText(hwndDlg, pThis->mTitle); - SetDlgItemText(hwndDlg, IDC_MESSAGE, pThis->mMessage); - - // Set check message text - if (pThis->mCheckMessage) - { - SetDlgItemText(hwndDlg, IDC_CHECKMSG, pThis->mCheckMessage); - CheckDlgButton(hwndDlg, IDC_CHECKMSG, pThis->mCheckValue ? BST_CHECKED : BST_UNCHECKED); - } - else - { - ShowWindow(GetDlgItem(hwndDlg, IDC_CHECKMSG), SW_HIDE); - } - - // Set the button text or hide them - for (i = 0; i < 3; i++) - { - int id = IDC_BUTTON0 + i; - if (pThis->mButtonTitles[i]) - { - SetDlgItemText(hwndDlg, id, pThis->mButtonTitles[i]); - } - else - { - ShowWindow(GetDlgItem(hwndDlg, id), SW_HIDE); - } - } - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED) - { - int id = LOWORD(wParam); - if (id == IDC_BUTTON0 || - id == IDC_BUTTON1 || - id == IDC_BUTTON2) - { - if (pThis->mCheckMessage) - { - pThis->mCheckValue = - (IsDlgButtonChecked(hwndDlg, IDC_CHECKMSG) == BST_CHECKED) ? - TRUE : FALSE; - } - EndDialog(hwndDlg, id - IDC_BUTTON0); - } - } - return FALSE; - } - - return FALSE; -} - - -//***************************************************************************** -// CPromptService -//***************************************************************************** - -class CPromptService: public nsIPromptService -{ -public: - CPromptService(); - virtual ~CPromptService(); - - CMozillaBrowser *GetOwningBrowser(nsIDOMWindow *parent); - - NS_DECL_ISUPPORTS - NS_DECL_NSIPROMPTSERVICE -}; - -//***************************************************************************** - -NS_IMPL_ISUPPORTS1(CPromptService, nsIPromptService) - -CPromptService::CPromptService() -{ -} - -CPromptService::~CPromptService() -{ -} - - -CMozillaBrowser *CPromptService::GetOwningBrowser(nsIDOMWindow *parent) -{ - if (parent == nsnull) - { - // return the first element from the list if there is one - if (CMozillaBrowser::sBrowserList.Length() > 0) - { - return CMozillaBrowser::sBrowserList[0]; - } - return NULL; - } - - // Search for the browser with a content window matching the one provided - PRUint32 i; - for (i = 0; i < CMozillaBrowser::sBrowserList.Length(); i++) - { - CMozillaBrowser *p = CMozillaBrowser::sBrowserList[i]; - if (p->mWebBrowser) - { - nsCOMPtr domWindow; - p->mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow)); - if (domWindow.get() == parent) - { - return p; - } - } - } - - return NULL; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIPrompt - -NS_IMETHODIMP CPromptService::Alert(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - USES_CONVERSION; - pOwner->MessageBox(W2T(text), W2T(dialogTitle), MB_OK | MB_ICONEXCLAMATION); - } - return NS_OK; -} - -NS_IMETHODIMP CPromptService::AlertCheck(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text, - const PRUnichar *checkMsg, PRBool *checkValue) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - // TODO show dialog with check box - USES_CONVERSION; - pOwner->MessageBox(W2T(text), W2T(dialogTitle), MB_OK | MB_ICONEXCLAMATION); - } - return NS_OK; -} - -NS_IMETHODIMP CPromptService::Confirm(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text, - PRBool *_retval) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - USES_CONVERSION; - int nAnswer = pOwner->MessageBox(W2T(text), W2T(dialogTitle), - MB_YESNO | MB_ICONQUESTION); - *_retval = (nAnswer == IDYES) ? PR_TRUE : PR_FALSE; - } - return NS_OK; -} - - -NS_IMETHODIMP CPromptService::ConfirmCheck(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - PromptDlg dlg; - return dlg.ConfirmCheck(pOwner->m_hWnd, dialogTitle, - text, checkMsg, checkValue, _retval); - } - return NS_OK; -} - - -NS_IMETHODIMP CPromptService::ConfirmEx(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUint32 buttonFlags, - const PRUnichar *button0Title, - const PRUnichar *button1Title, - const PRUnichar *button2Title, - const PRUnichar *checkMsg, PRBool *checkValue, - PRInt32 *buttonPressed) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - PromptDlg dlg; - return dlg.ConfirmEx(pOwner->m_hWnd, dialogTitle, - text, buttonFlags, button0Title, button1Title, button2Title, - checkMsg, checkValue, buttonPressed); - } - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP CPromptService::Prompt(nsIDOMWindow *parent, const PRUnichar *dialogTitle, - const PRUnichar *text, PRUnichar **value, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - PromptDlg dlg; - return dlg.Prompt(pOwner->m_hWnd, - dialogTitle, text, value, checkMsg, checkValue, _retval); - } - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP CPromptService::PromptUsernameAndPassword(nsIDOMWindow *parent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **username, PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - PromptDlg dlg; - return dlg.PromptUsernameAndPassword(pOwner->m_hWnd, - dialogTitle, text, username, password, checkMsg, checkValue, _retval); - } - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP CPromptService::PromptPassword(nsIDOMWindow *parent, - const PRUnichar *dialogTitle, - const PRUnichar *text, - PRUnichar **password, - const PRUnichar *checkMsg, PRBool *checkValue, - PRBool *_retval) -{ - CMozillaBrowser *pOwner = GetOwningBrowser(parent); - if (pOwner) - { - PromptDlg dlg; - return dlg.PromptPassword(pOwner->m_hWnd, - dialogTitle, text, password, checkMsg, checkValue, _retval); - } - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP CPromptService::Select(nsIDOMWindow *parent, - const PRUnichar *dialogTitle, - const PRUnichar *text, PRUint32 count, - const PRUnichar **selectList, PRInt32 *outSelection, - PRBool *_retval) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -//***************************************************************************** -// CPromptServiceFactory -//***************************************************************************** - -class CPromptServiceFactory : public nsIFactory -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIFACTORY - - CPromptServiceFactory(); - virtual ~CPromptServiceFactory(); -}; - -//***************************************************************************** - -NS_IMPL_ISUPPORTS1(CPromptServiceFactory, nsIFactory) - -CPromptServiceFactory::CPromptServiceFactory() -{ -} - -CPromptServiceFactory::~CPromptServiceFactory() -{ -} - -NS_IMETHODIMP CPromptServiceFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - - *aResult = NULL; - CPromptService *inst = new CPromptService; - if (!inst) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = inst->QueryInterface(aIID, aResult); - if (rv != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } - - return rv; -} - -NS_IMETHODIMP CPromptServiceFactory::LockFactory(PRBool lock) -{ - return NS_OK; -} - -//***************************************************************************** - -nsresult NS_NewPromptServiceFactory(nsIFactory** aFactory) -{ - NS_ENSURE_ARG_POINTER(aFactory); - *aFactory = nsnull; - - CPromptServiceFactory *result = new CPromptServiceFactory; - if (!result) - return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(result); - *aFactory = result; - - return NS_OK; -} diff --git a/embedding/browser/activex/src/control/PromptService.h b/embedding/browser/activex/src/control/PromptService.h deleted file mode 100644 index cc67bd56bd2..00000000000 --- a/embedding/browser/activex/src/control/PromptService.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef __PromptService_h -#define __PromptService_h - -#include "nsError.h" - -class nsIFactory; - -extern nsresult NS_NewPromptServiceFactory(nsIFactory** aFactory); - -#endif diff --git a/embedding/browser/activex/src/control/PropertyDlg.cpp b/embedding/browser/activex/src/control/PropertyDlg.cpp deleted file mode 100644 index d06b977cb38..00000000000 --- a/embedding/browser/activex/src/control/PropertyDlg.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include "PropertyDlg.h" -#include "resource.h" - -#include "nsIMIMEInfo.h" -#include "nsIMIMEService.h" - -CPropertyDlg::CPropertyDlg() : - mPPage(NULL) -{ -} - -HRESULT CPropertyDlg::AddPage(CPPageDlg *pPage) -{ - mPPage = pPage; - return S_OK; -} - - -LRESULT CPropertyDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - if (mPPage) - { - // Create property page over the marker - RECT rc; - ::GetWindowRect(GetDlgItem(IDC_PPAGE_MARKER), &rc); - ScreenToClient(&rc); - mPPage->Create(m_hWnd, rc); - mPPage->SetWindowPos(HWND_TOP, &rc, SWP_SHOWWINDOW); - } - return 1; -} - - -LRESULT CPropertyDlg::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - if (mPPage) - { - mPPage->DestroyWindow(); - } - EndDialog(IDOK); - return 1; -} - - -LRESULT CPropertyDlg::OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - if (mPPage) - { - mPPage->DestroyWindow(); - } - EndDialog(IDCLOSE); - return 1; -} - - -/////////////////////////////////////////////////////////////////////////////// - - -LRESULT CPPageDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - nsAutoString desc; - if (!mType.IsEmpty()) - { - nsresult rv; - nsCOMPtr mimeService; - mimeService = do_GetService("@mozilla.org/mime;1", &rv); - NS_ENSURE_TRUE(mimeService, NS_ERROR_FAILURE); - - nsCOMPtr mimeInfo; - nsCAutoString contentType; - // MIME Types are ASCII. - LossyCopyUTF16toASCII(mType, contentType); - mimeService->GetFromTypeAndExtension(contentType, EmptyCString(), getter_AddRefs(mimeInfo)); - if (mimeInfo) - { - mimeInfo->GetDescription(desc); - } - } - - USES_CONVERSION; - SetDlgItemText(IDC_PROTOCOL, W2T(desc.get())); - SetDlgItemText(IDC_TYPE, W2T(mType.get())); - SetDlgItemText(IDC_ADDRESS, W2T(mURL.get())); - - return 1; -} diff --git a/embedding/browser/activex/src/control/PropertyDlg.h b/embedding/browser/activex/src/control/PropertyDlg.h deleted file mode 100644 index 4862e8a6fae..00000000000 --- a/embedding/browser/activex/src/control/PropertyDlg.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef PROPERTYDLG_H -#define PROPERTYDLG_H - -class CPPageDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_PPAGE_LINK }; - - nsString mType; - nsString mURL; - - BEGIN_MSG_MAP(CPPageLinkDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - END_MSG_MAP() - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); -}; - - -class CPropertyDlg : public CDialogImpl -{ -public: - enum { IDD = IDD_PROPERTIES }; - - CPPageDlg *mPPage; - - BEGIN_MSG_MAP(CPropertyDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDOK, OnOK) - COMMAND_ID_HANDLER(IDCLOSE, OnClose) - END_MSG_MAP() - - CPropertyDlg(); - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - - HRESULT AddPage(CPPageDlg *pPage); -}; - - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/control/StdAfx.cpp b/embedding/browser/activex/src/control/StdAfx.cpp deleted file mode 100644 index 45e15bee5bf..00000000000 --- a/embedding/browser/activex/src/control/StdAfx.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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 -#include -#endif - -#include -#include -#include diff --git a/embedding/browser/activex/src/control/StdAfx.h b/embedding/browser/activex/src/control/StdAfx.h deleted file mode 100644 index 7900ef8cc87..00000000000 --- a/embedding/browser/activex/src/control/StdAfx.h +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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 - - // under MSVC shut off copious warnings about debug symbol too long -#ifdef _MSC_VER - #pragma warning( disable: 4786 ) -#endif - -#include "jstypes.h" -#include "prtypes.h" - -// Mozilla headers - -#include "jscompat.h" - -#include "prthread.h" -#include "prprf.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" -#include "nsViewsCID.h" -#include "nsStringAPI.h" -#include "nsCOMPtr.h" - -#include "nsIHTTPChannel.h" - -#include "nsIPrefBranch.h" -#include "nsIPrefService.h" -#include "nsIURL.h" -#include "nsIBaseWindow.h" -#include "nsIWebBrowser.h" -#include "nsIEmbeddingSiteWindow.h" -#include "nsIDocShell.h" -#include "nsIDocShellTreeItem.h" -#include "nsIDocShellTreeOwner.h" -#include "nsIWebBrowserChrome.h" -#include "nsIWebBrowserSetup.h" -#include "nsIWebNavigation.h" -#include "nsIWebProgress.h" -#include "nsIWebProgressListener.h" -#include "nsIDocumentLoader.h" -#include "nsIContentViewer.h" -#include "nsIContentViewerEdit.h" -#include "nsIInterfaceRequestor.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsCOMPtr.h" -#include "nsISelection.h" -#include "nsIPrompt.h" -#include "nsIEditor.h" -#include "nsIEditingSession.h" -#include "nsICommandManager.h" - -#include "nsIDocument.h" -#include "nsIDocumentObserver.h" -#include "nsIStreamListener.h" -#include "nsTArray.h" - -#include "nsIDocumentViewer.h" -#include "nsIDOMNode.h" -#include "nsIDOMNodeList.h" -#include "nsIDOMDocument.h" -#include "nsIDOMDocumentType.h" -#include "nsIDOMElement.h" -#include "nsIDOMEvent.h" -#include "nsIDOMMouseEvent.h" -#include "nsIDOMEventTarget.h" - -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0403 -#define _ATL_APARTMENT_THREADED -#define _ATL_STATIC_REGISTRY -// #define _ATL_DEBUG_INTERFACES - -// ATL headers -#include -//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 -#include -#include -#include -#include - -// STL headers -#include -#include -#include - -// New winsock2.h doesn't define this anymore -typedef long int32; - -// Turn off warnings about debug symbols for templates being too long -#pragma warning(disable : 4786) - -// Mozilla control headers -#include "resource.h" - -#include "ActiveXTypes.h" -#include "BrowserDiagnostics.h" -#include "IOleCommandTargetImpl.h" -#include "DHTMLCmdIds.h" - -#include "MozillaControl.h" -#include "PropertyList.h" -#include "PropertyBag.h" -#include "ItemContainer.h" - -#include "IEHtmlDocument.h" -#include "CPMozillaControl.h" -#include "MozillaBrowser.h" -#include "WindowCreator.h" -#include "WebBrowserContainer.h" -#include "DropTarget.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) diff --git a/embedding/browser/activex/src/control/WebBrowserContainer.cpp b/embedding/browser/activex/src/control/WebBrowserContainer.cpp deleted file mode 100644 index dd3c82ad601..00000000000 --- a/embedding/browser/activex/src/control/WebBrowserContainer.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include -#include - -#include "WebBrowserContainer.h" - -#include "nsServiceManagerUtils.h" -#include "nsIWebNavigationInfo.h" - -CWebBrowserContainer::CWebBrowserContainer(CMozillaBrowser *pOwner) : - mOwner(pOwner), - mEvents1(mOwner), - mEvents2(mOwner), - mVisible(PR_TRUE) -{ -} - - -CWebBrowserContainer::~CWebBrowserContainer() -{ -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsISupports implementation - -NS_IMPL_ADDREF(CWebBrowserContainer) -NS_IMPL_RELEASE(CWebBrowserContainer) - -NS_INTERFACE_MAP_BEGIN(CWebBrowserContainer) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome) - NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) - NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome) - NS_INTERFACE_MAP_ENTRY(nsIURIContentListener) - NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow) - NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow2) - NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) - NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) - NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener) - NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus) -// NS_INTERFACE_MAP_ENTRY(nsICommandHandler) - NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) -NS_INTERFACE_MAP_END - - -/////////////////////////////////////////////////////////////////////////////// -// nsIInterfaceRequestor - -NS_IMETHODIMP CWebBrowserContainer::GetInterface(const nsIID & aIID, void * *result) -{ - *result = 0; - if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) - { - if (mOwner && mOwner->mWebBrowser) - { - return mOwner->mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) result); - } - return NS_ERROR_NOT_INITIALIZED; - } - return QueryInterface(aIID, result); -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIContextMenuListener - -NS_IMETHODIMP CWebBrowserContainer::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) -{ - mOwner->ShowContextMenu(aContextFlags, aEvent, aNode); - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIWebProgressListener - -/* void onProgressChange (in nsIWebProgress aProgress, in nsIRequest aRequest, in long curSelfProgress, in long maxSelfProgress, in long curTotalProgress, in long maxTotalProgress); */ -NS_IMETHODIMP CWebBrowserContainer::OnProgressChange(nsIWebProgress *aProgress, nsIRequest *aRequest, PRInt32 curSelfProgress, PRInt32 maxSelfProgress, PRInt32 curTotalProgress, PRInt32 maxTotalProgress) -{ - NG_TRACE(_T("CWebBrowserContainer::OnProgressChange(...)\n")); - - long nProgress = curTotalProgress; - long nProgressMax = maxTotalProgress; - - if (nProgress == 0) - { - } - if (nProgressMax == 0) - { - nProgressMax = LONG_MAX; - } - if (nProgress > nProgressMax) - { - nProgress = nProgressMax; // Progress complete - } - - mEvents1->Fire_ProgressChange(nProgress, nProgressMax); - mEvents2->Fire_ProgressChange(nProgress, nProgressMax); - - return NS_OK; -} - -/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest request, in unsigned long progressStateFlags, in unsinged long aStatus); */ -NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress, nsIRequest *aRequest, PRUint32 progressStateFlags, nsresult aStatus) -{ - nsresult rv = NS_OK; - - NG_TRACE(_T("CWebBrowserContainer::OnStateChange(...)\n")); - - BOOL doFireCommandStateChange = FALSE; - - // determine whether or not the document load has started or stopped. - if (progressStateFlags & STATE_IS_DOCUMENT) - { - if (progressStateFlags & STATE_START) - { - NG_TRACE(_T("CWebBrowserContainer::OnStateChange->Doc Start(..., \"\")\n")); - - nsCOMPtr channel(do_QueryInterface(aRequest)); - if (channel) - { - nsCOMPtr uri; - rv = channel->GetURI(getter_AddRefs(uri)); - if (NS_SUCCEEDED(rv)) - { - nsCAutoString aURI; - uri->GetAsciiSpec(aURI); - NG_TRACE(_T("CWebBrowserContainer::OnStateChange->Doc Start(..., %s, \"\")\n"), A2CT(aURI.get())); - } - } - - //Fire a DownloadBegin - mEvents1->Fire_DownloadBegin(); - mEvents2->Fire_DownloadBegin(); - } - else if (progressStateFlags & STATE_STOP) - { - NG_TRACE(_T("CWebBrowserContainer::OnStateChange->Doc Stop(..., \"\")\n")); - - if (mOwner->mIERootDocument) - { - // allow to keep old document around - mOwner->mIERootDocument->Release(); - mOwner->mIERootDocument = NULL; - } - - //Fire a DownloadComplete - mEvents1->Fire_DownloadComplete(); - mEvents2->Fire_DownloadComplete(); - - nsCOMPtr pURI; - - nsCOMPtr aChannel = do_QueryInterface(aRequest); - if (!aChannel) return NS_ERROR_NULL_POINTER; - - rv = aChannel->GetURI(getter_AddRefs(pURI)); - if (NS_FAILED(rv)) return NS_OK; - - nsCAutoString aURI; - rv = pURI->GetAsciiSpec(aURI); - if (NS_FAILED(rv)) return NS_OK; - - USES_CONVERSION; - BSTR bstrURI = SysAllocString(A2OLE(aURI.get())); - - // Fire a DocumentComplete event - CComVariant vURI(bstrURI); - mEvents2->Fire_DocumentComplete(mOwner, &vURI); - SysFreeString(bstrURI); - - //Fire a StatusTextChange event - BSTR bstrStatus = SysAllocString(A2OLE((CHAR *) "Done")); - mEvents1->Fire_StatusTextChange(bstrStatus); - mEvents2->Fire_StatusTextChange(bstrStatus); - SysFreeString(bstrStatus); - } - - // state change notifications - doFireCommandStateChange = TRUE; - } - - if (progressStateFlags & STATE_IS_NETWORK) - { - if (progressStateFlags & STATE_START) - { - } - - if (progressStateFlags & STATE_STOP) - { - nsCAutoString aURI; - if (mCurrentURI) - { - mCurrentURI->GetAsciiSpec(aURI); - } - - // Fire a NavigateComplete event - USES_CONVERSION; - BSTR bstrURI = SysAllocString(A2OLE(aURI.get())); - mEvents1->Fire_NavigateComplete(bstrURI); - - // Fire a NavigateComplete2 event - CComVariant vURI(bstrURI); - mEvents2->Fire_NavigateComplete2(mOwner, &vURI); - - // Cleanup - SysFreeString(bstrURI); - mOwner->mBusyFlag = FALSE; - mCurrentURI = nsnull; - } - } - - if (doFireCommandStateChange) - { - nsCOMPtr webNav(do_QueryInterface(mOwner->mWebBrowser)); - - // Fire the new NavigateForward state - VARIANT_BOOL bEnableForward = VARIANT_FALSE; - PRBool aCanGoForward = PR_FALSE; - webNav->GetCanGoForward(&aCanGoForward); - if (aCanGoForward) - { - bEnableForward = VARIANT_TRUE; - } - mEvents2->Fire_CommandStateChange(CSC_NAVIGATEFORWARD, bEnableForward); - - // Fire the new NavigateBack state - VARIANT_BOOL bEnableBack = VARIANT_FALSE; - PRBool aCanGoBack = PR_FALSE; - webNav->GetCanGoBack(&aCanGoBack); - if (aCanGoBack) - { - bEnableBack = VARIANT_TRUE; - } - mEvents2->Fire_CommandStateChange(CSC_NAVIGATEBACK, bEnableBack); - } - - return NS_OK; -} - - -/* void onLocationChange (in nsIURI location); */ -NS_IMETHODIMP CWebBrowserContainer::OnLocationChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, - nsIURI *location) -{ -// nsCString aPath; -// location->GetPath(getter_Copies(aPath)); - return NS_OK; -} - -NS_IMETHODIMP -CWebBrowserContainer::OnStatusChange(nsIWebProgress* aWebProgress, - nsIRequest* aRequest, - nsresult aStatus, - const PRUnichar* aMessage) -{ - NG_TRACE(_T("CWebBrowserContainer::OnStatusChange(..., \"\")\n")); - - BSTR bstrStatus = SysAllocString(W2OLE((PRUnichar *) aMessage)); - mEvents1->Fire_StatusTextChange(bstrStatus); - mEvents2->Fire_StatusTextChange(bstrStatus); - SysFreeString(bstrStatus); - - return NS_OK; -} - -NS_IMETHODIMP -CWebBrowserContainer::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - PRUint32 state) -{ - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIURIContentListener - -/* void onStartURIOpen (in nsIURI aURI, out boolean aAbortOpen); */ -NS_IMETHODIMP CWebBrowserContainer::OnStartURIOpen(nsIURI *pURI, PRBool *aAbortOpen) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebBrowserContainer::OnStartURIOpen(...)\n")); - - mCurrentURI = pURI; - NG_ASSERT(mCurrentURI); - - nsCAutoString aURI; - mCurrentURI->GetSpec(aURI); - - // Setup the post data - CComVariant vPostDataRef; - CComVariant vPostData; - vPostDataRef.vt = VT_BYREF | VT_VARIANT; - vPostDataRef.pvarVal = &vPostData; - // TODO get the post data passed in via the original call to Navigate() - - - // Fire a BeforeNavigate event - BSTR bstrURI = SysAllocString(A2OLE(aURI.get())); - BSTR bstrTargetFrameName = NULL; - BSTR bstrHeaders = NULL; - VARIANT_BOOL bCancel = VARIANT_FALSE; - long lFlags = 0; - - mEvents1->Fire_BeforeNavigate(bstrURI, lFlags, bstrTargetFrameName, &vPostDataRef, bstrHeaders, &bCancel); - - // Fire a BeforeNavigate2 event - CComVariant vURI(bstrURI); - CComVariant vFlags(lFlags); - CComVariant vTargetFrameName(bstrTargetFrameName); - CComVariant vHeaders(bstrHeaders); - - mEvents2->Fire_BeforeNavigate2(mOwner, &vURI, &vFlags, &vTargetFrameName, &vPostDataRef, &vHeaders, &bCancel); - - // Cleanup - SysFreeString(bstrURI); - SysFreeString(bstrTargetFrameName); - SysFreeString(bstrHeaders); - - if (bCancel != VARIANT_FALSE) - { - *aAbortOpen = PR_TRUE; - return NS_ERROR_ABORT; - } - else - { - mOwner->mBusyFlag = TRUE; - } - - //NOTE: The IE control fires a DownloadBegin after the first BeforeNavigate. - // It then fires a DownloadComplete after the engine has made its - // initial connection to the server. It then fires a second - // DownloadBegin/DownloadComplete pair around the loading of - // everything on the page. These events get fired out of - // CWebBrowserContainer::StartDocumentLoad() and - // CWebBrowserContainer::EndDocumentLoad(). - // We don't appear to distinguish between the initial connection to - // the server and the actual transfer of data. Firing these events - // here simulates, appeasing applications that are expecting that - // initial pair. - - mEvents1->Fire_DownloadBegin(); - mEvents2->Fire_DownloadBegin(); - mEvents1->Fire_DownloadComplete(); - mEvents2->Fire_DownloadComplete(); - - return NS_OK; -} - -/* void doContent (in string aContentType, in boolean aIsContentPreferred, in nsIRequest request, out nsIStreamListener aContentHandler, out boolean aAbortProcess); */ -NS_IMETHODIMP CWebBrowserContainer::DoContent(const char *aContentType, PRBool aIsContentPreferred, nsIRequest *request, nsIStreamListener **aContentHandler, PRBool *aAbortProcess) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -/* boolean isPreferred (in string aContentType, out string aDesiredContentType); */ -NS_IMETHODIMP CWebBrowserContainer::IsPreferred(const char *aContentType, char **aDesiredContentType, PRBool *_retval) -{ - return CanHandleContent(aContentType, PR_TRUE, aDesiredContentType, _retval); -} - - -/* boolean canHandleContent (in string aContentType, in PRBool aIsContentPreferred, out string aDesiredContentType); */ -NS_IMETHODIMP CWebBrowserContainer::CanHandleContent(const char *aContentType, PRBool aIsContentPreferred, char **aDesiredContentType, PRBool *_retval) -{ - *_retval = PR_FALSE; - *aDesiredContentType = nsnull; - - if (aContentType) - { - nsCOMPtr webNav(do_QueryInterface(mOwner->mWebBrowser)); - nsCOMPtr webNavInfo( - do_GetService("@mozilla.org/webnavigation-info;1")); - if (webNavInfo) - { - PRUint32 canHandle; - nsresult rv = - webNavInfo->IsTypeSupported(nsDependentCString(aContentType), - webNav, - &canHandle); - NS_ENSURE_SUCCESS(rv, rv); - *_retval = (canHandle != nsIWebNavigationInfo::UNSUPPORTED); - } - } - - return NS_OK; -} - - -/* attribute nsISupports loadCookie; */ -NS_IMETHODIMP CWebBrowserContainer::GetLoadCookie(nsISupports * *aLoadCookie) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -NS_IMETHODIMP CWebBrowserContainer::SetLoadCookie(nsISupports * aLoadCookie) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -/* attribute nsIURIContentListener parentContentListener; */ -NS_IMETHODIMP CWebBrowserContainer::GetParentContentListener(nsIURIContentListener * *aParentContentListener) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -NS_IMETHODIMP CWebBrowserContainer::SetParentContentListener(nsIURIContentListener * aParentContentListener) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIEmbeddingSiteWindow - -NS_IMETHODIMP -CWebBrowserContainer::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy) -{ - RECT rc = { 0, 0, 1, 1 }; - mOwner->GetClientRect(&rc); - if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) - { - if (*x) - *x = rc.left; - if (*y) - *y = rc.top; - } - if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER || - aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) - { - if (*cx) - *cx = rc.right - rc.left; - if (*cy) - *cy = rc.bottom - rc.top; - } - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) -{ - // Ignore - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::GetSiteWindow(void **aParentNativeWindow) -{ - NS_ENSURE_ARG_POINTER(aParentNativeWindow); - HWND *hwndDest = (HWND *) aParentNativeWindow; - *hwndDest = mOwner->m_hWnd; - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetFocus(void) -{ - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::GetTitle(PRUnichar * *aTitle) -{ - NG_ASSERT_POINTER(aTitle, PRUnichar **); - if (!aTitle) - return E_INVALIDARG; - - *aTitle = ToNewUnicode(mTitle); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetTitle(const PRUnichar * aTitle) -{ - NG_ASSERT_POINTER(aTitle, PRUnichar *); - if (!aTitle) - return E_INVALIDARG; - - mTitle = aTitle; - // Fire a TitleChange event - BSTR bstrTitle = SysAllocString(aTitle); - mEvents1->Fire_TitleChange(bstrTitle); - mEvents2->Fire_TitleChange(bstrTitle); - SysFreeString(bstrTitle); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::GetVisibility(PRBool *aVisibility) -{ - NS_ENSURE_ARG_POINTER(aVisibility); - *aVisibility = PR_TRUE; - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetVisibility(PRBool aVisibility) -{ - VARIANT_BOOL visible = aVisibility ? VARIANT_TRUE : VARIANT_FALSE; - mVisible = aVisibility; - // Fire an OnVisible event - mEvents2->Fire_OnVisible(visible); - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIEmbeddingSiteWindow2 - - -NS_IMETHODIMP -CWebBrowserContainer::Blur() -{ - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIWebBrowserChromeFocus implementation - -NS_IMETHODIMP -CWebBrowserContainer::FocusNextElement() -{ - ATLTRACE(_T("CWebBrowserContainer::FocusNextElement()\n")); - mOwner->NextDlgControl(); - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::FocusPrevElement() -{ - ATLTRACE(_T("CWebBrowserContainer::FocusPrevElement()\n")); - mOwner->PrevDlgControl(); - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// -// nsIWebBrowserChrome implementation - -NS_IMETHODIMP -CWebBrowserContainer::SetStatus(PRUint32 statusType, const PRUnichar *status) -{ - //Fire a StatusTextChange event - BSTR bstrStatus = SysAllocString(status); - mEvents1->Fire_StatusTextChange(bstrStatus); - mEvents2->Fire_StatusTextChange(bstrStatus); - SysFreeString(bstrStatus); - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::GetWebBrowser(nsIWebBrowser * *aWebBrowser) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetWebBrowser(nsIWebBrowser * aWebBrowser) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::GetChromeFlags(PRUint32 *aChromeFlags) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SetChromeFlags(PRUint32 aChromeFlags) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::DestroyBrowserWindow(void) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY) -{ - return NS_ERROR_FAILURE; -} - - -NS_IMETHODIMP -CWebBrowserContainer::ShowAsModal(void) -{ - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -CWebBrowserContainer::IsWindowModal(PRBool *_retval) -{ - // we're not - *_retval = PR_FALSE; - return NS_OK; -} - -NS_IMETHODIMP -CWebBrowserContainer::ExitModalEventLoop(nsresult aStatus) -{ - // Ignore request to exit modal loop - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIRequestObserver implementation - - -NS_IMETHODIMP -CWebBrowserContainer::OnStartRequest(nsIRequest *request, nsISupports* aContext) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebBrowserContainer::OnStartRequest(...)\n")); - - return NS_OK; -} - - -NS_IMETHODIMP -CWebBrowserContainer::OnStopRequest(nsIRequest *request, nsISupports* aContext, nsresult aStatus) -{ - USES_CONVERSION; - NG_TRACE(_T("CWebBrowserContainer::OnStopRequest(..., %d)\n"), (int) aStatus); - - // Fire a DownloadComplete event - mEvents1->Fire_DownloadComplete(); - mEvents2->Fire_DownloadComplete(); - - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsICommandHandler implementation - -/* void do (in string aCommand, in string aStatus); */ -NS_IMETHODIMP CWebBrowserContainer::Exec(const char *aCommand, const char *aStatus, char **aResult) -{ - return NS_OK; -} - -/* void query (in string aCommand, in string aStatus); */ -NS_IMETHODIMP CWebBrowserContainer::Query(const char *aCommand, const char *aStatus, char **aResult) -{ - return NS_OK; -} diff --git a/embedding/browser/activex/src/control/WebBrowserContainer.h b/embedding/browser/activex/src/control/WebBrowserContainer.h deleted file mode 100644 index 54d2cacb439..00000000000 --- a/embedding/browser/activex/src/control/WebBrowserContainer.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef WEBBROWSERCONTAINER_H -#define WEBBROWSERCONTAINER_H - -#include "nsIContextMenuListener.h" -#include "nsITooltipListener.h" -#include "nsICommandHandler.h" -#include "nsIEmbeddingSiteWindow.h" -#include "nsIEmbeddingSiteWindow2.h" -#include "nsIURIContentListener.h" -#include "nsIWebBrowserChromeFocus.h" -#include "nsWeakReference.h" - -// This is the class that handles the XPCOM side of things, callback -// interfaces into the web shell and so forth. - -class CWebBrowserContainer : - public nsIEmbeddingSiteWindow2, - public nsIWebBrowserChrome, - public nsIWebProgressListener, - public nsIRequestObserver, - public nsIURIContentListener, - public nsIInterfaceRequestor, - public nsIContextMenuListener, - public nsICommandHandler, - public nsIWebBrowserChromeFocus, - public nsSupportsWeakReference -{ -public: - CWebBrowserContainer(CMozillaBrowser *pOwner); - - friend CMozillaBrowser; - friend CWindowCreator; - -protected: - virtual ~CWebBrowserContainer(); - -// Protected members -protected: - CMozillaBrowser *mOwner; - nsCOMPtr mCurrentURI; - CProxyDWebBrowserEvents *mEvents1; - CProxyDWebBrowserEvents2 *mEvents2; - nsString mTitle; - PRPackedBool mVisible; - -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIEMBEDDINGSITEWINDOW - NS_DECL_NSIEMBEDDINGSITEWINDOW2 - NS_DECL_NSIWEBBROWSERCHROME - NS_DECL_NSIURICONTENTLISTENER - NS_DECL_NSIREQUESTOBSERVER - NS_DECL_NSIINTERFACEREQUESTOR - NS_DECL_NSIWEBPROGRESSLISTENER - NS_DECL_NSICONTEXTMENULISTENER - NS_DECL_NSIWEBBROWSERCHROMEFOCUS - NS_DECL_NSICOMMANDHANDLER -}; - -#endif - diff --git a/embedding/browser/activex/src/control/WindowCreator.cpp b/embedding/browser/activex/src/control/WindowCreator.cpp deleted file mode 100644 index 62d7cbbcfc4..00000000000 --- a/embedding/browser/activex/src/control/WindowCreator.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include "WindowCreator.h" - -NS_IMPL_ISUPPORTS1(CWindowCreator, nsIWindowCreator) - -CWindowCreator::CWindowCreator(void) -{ -} - -CWindowCreator::~CWindowCreator() -{ -} - -NS_IMETHODIMP -CWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent, PRUint32 aChromeFlags, nsIWebBrowserChrome **_retval) -{ - NS_ENSURE_ARG_POINTER(_retval); - *_retval = nsnull; - - // NOTE: - // - // The nsIWindowCreator::CreateChromeWindow is REQUIRED to handle a nsnull - // parent window but this implementation must have one in order to fire - // events to the ActiveX container. Therefore we treat a nsnull aParent - // as an error and return. - - if (aParent == nsnull) - { - return NS_ERROR_FAILURE; - } - - CWebBrowserContainer *pContainer = static_cast(aParent); - - CComQIPtr dispNew; - VARIANT_BOOL bCancel = VARIANT_FALSE; - - // Test if the event sink can give us a new window to navigate into - if (pContainer->mEvents2) - { - pContainer->mEvents2->Fire_NewWindow2(&dispNew, &bCancel); - if ((bCancel == VARIANT_FALSE) && dispNew) - { - CComQIPtr cpBridge = dispNew; - if (cpBridge) - { - nsIWebBrowser *browser = nsnull; - cpBridge->GetWebBrowser((void **) &browser); - if (browser) - { - nsresult rv = browser->GetContainerWindow(_retval); - NS_RELEASE(browser); - return rv; - } - } - } - } - - return NS_ERROR_FAILURE; -} - diff --git a/embedding/browser/activex/src/control/WindowCreator.h b/embedding/browser/activex/src/control/WindowCreator.h deleted file mode 100644 index 04a519aee2b..00000000000 --- a/embedding/browser/activex/src/control/WindowCreator.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef WINDOWCREATOR_H -#define WINDOWCREATOR_H - -#include "nsIWindowCreator.h" -#include "nsIWebBrowserChrome.h" - -class CWindowCreator : public nsIWindowCreator -{ -public: - CWindowCreator(); -protected: - virtual ~CWindowCreator(); - -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIWINDOWCREATOR -}; - -#endif diff --git a/embedding/browser/activex/src/control/mkctldef.bat b/embedding/browser/activex/src/control/mkctldef.bat deleted file mode 100755 index 9b4302a3f26..00000000000 --- a/embedding/browser/activex/src/control/mkctldef.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off - -REM This script generates the DEF file for the control DLL depending on -REM what has been set to go into it - -echo ; mozctl.def : Declares the module parameters. > %1 -echo ; This file was autogenerated by mkctldef.bat! >> %1 -echo. >> %1 -echo LIBRARY "mozctl.DLL" >> %1 -echo EXPORTS >> %1 -echo ; ActiveX exports >> %1 -echo DllCanUnloadNow @100 PRIVATE >> %1 -echo DllGetClassObject @101 PRIVATE >> %1 -echo DllRegisterServer @102 PRIVATE >> %1 -echo DllUnregisterServer @103 PRIVATE >> %1 -echo. >> %1 diff --git a/embedding/browser/activex/src/control/mkctldef.sh b/embedding/browser/activex/src/control/mkctldef.sh deleted file mode 100755 index 517c0c49647..00000000000 --- a/embedding/browser/activex/src/control/mkctldef.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# This script generates the DEF file for the control DLL depending on -# what has been set to go into it - -echo '; mozctl.def : Declares the module parameters.' > $1 -echo '; This file was autogenerated by mkctldef.sh! ' >> $1 -echo '' >> $1 -echo 'LIBRARY "mozctl.DLL"' >> $1 -echo 'EXPORTS' >> $1 -echo ' ; ActiveX exports' >> $1 -echo ' DllCanUnloadNow @100 PRIVATE' >> $1 -echo ' DllGetClassObject @101 PRIVATE' >> $1 -echo ' DllRegisterServer @102 PRIVATE' >> $1 -echo ' DllUnregisterServer @103 PRIVATE' >> $1 -echo '' >> $1 diff --git a/embedding/browser/activex/src/control/resource.h b/embedding/browser/activex/src/control/resource.h deleted file mode 100644 index 4340c46dee5..00000000000 --- a/embedding/browser/activex/src/control/resource.h +++ /dev/null @@ -1,119 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by MozillaControl.rc -// -#define IDS_PROJNAME 100 -#define IDR_MOZILLABROWSER 101 -#define IDS_HEADERFOOTER_OPTIONS 101 -#define IDI_MOZILLABROWSER 201 -#define IDC_CHECKMSG 201 -#define IDR_POPUP_PAGE 202 -#define IDR_POPUP_DOCUMENT 202 -#define IDR_POPUP_LINK 203 -#define IDR_POPUP_CLIPBOARD 204 -#define IDC_QUESTION 204 -#define IDR_POPUP_TEXT 204 -#define IDD_CONFIRMCHECK 205 -#define IDC_MESSAGE 205 -#define IDD_PROMPT 206 -#define IDR_POPUP_IMAGE 206 -#define IDC_PPAGE_MARKER 206 -#define IDD_PROMPTUSERNAMEANDPASSWORD 207 -#define IDD_PROMPTUSERPASS 207 -#define IDD_PROMPTPASSWORD 208 -#define IDC_TYPE 208 -#define IDD_PROPERTIES 209 -#define IDC_PROTOCOL 209 -#define IDD_PPAGE_LINK 210 -#define IDC_ADDRESS 210 -#define IDD_CONFIRMEX 211 -#define IDD_HELPERAPP 212 -#define IDC_VALUE 213 -#define IDD_PROGRESS 213 -#define IDC_USERNAME 214 -#define IDD_PAGESETUP 214 -#define IDC_PASSWORD 215 -#define IDD_PPAGE_FORMAT 215 -#define IDD_PPAGE_MARGINS 216 -#define IDD_CUSTOM_FIELD 217 -#define IDC_CHOOSE 218 -#define IDC_URL 222 -#define IDC_CONTENTTYPE 223 -#define IDC_APPLICATION 224 -#define IDC_SOURCE 225 -#define IDC_DESTINATION 226 -#define IDC_PROGRESS 227 -#define IDC_TAB 229 -#define IDC_PAGE_MARKER 230 -#define IDC_PRINTBACKGROUND 231 -#define IDC_PORTRAIT 232 -#define IDC_LANDSCAPE 233 -#define IDC_SCALE 234 -#define IDC_SHRINKTOFIT 235 -#define IDC_MARGIN_TOP 236 -#define IDC_MARGIN_LEFT 237 -#define IDC_MARGIN_BOTTOM 238 -#define IDC_MARGIN_RIGHT 239 -#define IDC_HDR_LEFT 240 -#define IDC_HDR_MIDDLE 241 -#define IDC_HDR_RIGHT 242 -#define IDC_FTR_LEFT 243 -#define IDC_FTR_MIDDLE 244 -#define IDC_FTR_RIGHT 245 -#define IDC_OPENWITHAPP 300 -#define IDC_SAVETOFILE 301 -#define IDS_LOCATEMOZILLA 1000 -#define IDS_LOCATEMOZILLATITLE 1001 -#define IDS_CANNOTCREATEPREFS 1002 -#define IDS_CONFIRMEX_OK 2000 -#define IDS_CONFIRMEX_CANCEL 2001 -#define IDS_CONFIRMEX_YES 2002 -#define IDS_CONFIRMEX_NO 2003 -#define IDS_CONFIRMEX_SAVE 2004 -#define IDS_CONFIRMEX_DONTSAVE 2005 -#define IDS_CONFIRMEX_REVERT 2006 -#define IDC_BUTTON0 2200 -#define IDC_BUTTON1 2201 -#define IDC_BUTTON2 2202 -#define ID_BROWSE_BACK 32768 -#define ID_DOCUMENT_BACK 32768 -#define ID_BROWSE_FORWARD 32769 -#define ID_DOCUMENT_FORWARD 32769 -#define ID_FILE_REFRESH 32772 -#define ID_DOCUMENT_REFRESH 32772 -#define ID_FILE_PRINT 32773 -#define ID_DOCUMENT_PRINT 32773 -#define ID_PAGE_PROPERTIES 32774 -#define ID_DOCUMENT_PROPERTIES 32774 -#define ID_FILE_VIEWSOURCE 32775 -#define ID_DOCUMENT_VIEWSOURCE 32775 -#define ID_FILE_OPEN 32776 -#define ID_LINK_OPEN 32776 -#define ID_FILE_OPENINNEWWINDOW 32777 -#define ID_LINK_OPENINNEWWINDOW 32777 -#define ID_EDIT_COPYSHORTCUT 32778 -#define ID_LINK_COPYSHORTCUT 32778 -#define ID_LINK_PROPERTIES 32779 -#define ID_EDIT_CUT 32780 -#define ID_EDIT_COPY 32781 -#define ID_EDIT_PASTE 32782 -#define ID_EDIT_SELECTALL 32783 -#define ID_SELECTIONPOPUP_PRINT 32784 -#define ID_DOCUMENT_SELECTALL 32785 -#define ID_DOCUMENT_PASTE 32786 -#define ID_TEXT_CUT 32787 -#define ID_TEXT_COPY 32788 -#define ID_TEXT_PASTE 32789 -#define ID_TEXT_SELECTALL 32790 -#define ID_TEXT_PRINT 32791 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 218 -#define _APS_NEXT_COMMAND_VALUE 32792 -#define _APS_NEXT_CONTROL_VALUE 246 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/embedding/browser/activex/src/control_kicker/Makefile.in b/embedding/browser/activex/src/control_kicker/Makefile.in deleted file mode 100644 index b6d0f4dfc66..00000000000 --- a/embedding/browser/activex/src/control_kicker/Makefile.in +++ /dev/null @@ -1,83 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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/MPL/ -# -# 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 the Mozilla browser. -# -# The Initial Developer of the Original Code is -# Netscape Communications, Inc. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Adam Lock -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -LIBRARY_NAME = mozctlx -DEFFILE = $(win_srcdir)/mozctlx.def -FORCE_SHARED_LIB= 1 -GRE_MODULE = 1 -MOZILLA_INTERNAL_API = 1 - -CPPSRCS = \ - StdAfx.cpp \ - control_kicker.cpp \ - $(NULL) - -OS_LIBS += \ - comdlg32.lib \ - ole32.lib \ - oleaut32.lib \ - uuid.lib \ - shell32.lib \ - $(NULL) - -ENABLE_CXX_EXCEPTIONS = 1 - -EMBED_MANIFEST_AT = 2 - -include $(topsrcdir)/config/rules.mk - -CXXFLAGS += -D "WIN32" -GF -MT -O1 - -libs:: -ifdef MOZ_ACTIVEX_REGISTRATION -ifneq ($(OS_TARGET),WIN98) - -regsvr32 -s -c $(DIST)/bin/$(SHARED_LIBRARY) -endif -endif - -clean clobber clobber_all realclean distclean:: - -regsvr32 -s -c -u $(DIST)/bin/$(SHARED_LIBRARY) - -control_kicker.cpp StdAfx.cpp: StdAfx.h diff --git a/embedding/browser/activex/src/control_kicker/ReadMe.txt b/embedding/browser/activex/src/control_kicker/ReadMe.txt deleted file mode 100644 index ed3ace6b813..00000000000 --- a/embedding/browser/activex/src/control_kicker/ReadMe.txt +++ /dev/null @@ -1,37 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY : control_kicker -======================================================================== - - -AppWizard has created this control_kicker DLL for you. - -This file contains a summary of what you will find in each of the files that -make up your control_kicker application. - -control_kicker.dsp - This file (the project file) contains information at the project level and - is used to build a single project or subproject. Other users can share the - project (.dsp) file, but they should export the makefiles locally. - -control_kicker.cpp - This is the main DLL source file. - -control_kicker.h - This file contains your DLL exports. - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named control_kicker.pch and a precompiled types file named StdAfx.obj. - - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - - -///////////////////////////////////////////////////////////////////////////// diff --git a/embedding/browser/activex/src/control_kicker/StdAfx.cpp b/embedding/browser/activex/src/control_kicker/StdAfx.cpp deleted file mode 100644 index 5d8ce5720ae..00000000000 --- a/embedding/browser/activex/src/control_kicker/StdAfx.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications, Inc. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// stdafx.cpp : source file that includes just the standard includes -// control_kicker.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/embedding/browser/activex/src/control_kicker/StdAfx.h b/embedding/browser/activex/src/control_kicker/StdAfx.h deleted file mode 100644 index e2acde75c91..00000000000 --- a/embedding/browser/activex/src/control_kicker/StdAfx.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications, Inc. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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__7F2751C5_DFC7_4E43_BE16_785116B26B4A__INCLUDED_) -#define AFX_STDAFX_H__7F2751C5_DFC7_4E43_BE16_785116B26B4A__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include -#include -#include - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__7F2751C5_DFC7_4E43_BE16_785116B26B4A__INCLUDED_) diff --git a/embedding/browser/activex/src/control_kicker/control_kicker.cpp b/embedding/browser/activex/src/control_kicker/control_kicker.cpp deleted file mode 100644 index c35e0bd29a7..00000000000 --- a/embedding/browser/activex/src/control_kicker/control_kicker.cpp +++ /dev/null @@ -1,415 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications, Inc. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include -#include - -#include "shlobj.h" - -static BOOL LoadMozLibraryFromCurrentDir(); -static BOOL LoadMozLibraryFromRegistry(BOOL bAskUserToSetPath); -static BOOL LoadLibraryWithPATHFixup(const TCHAR *szBinDirPath); - - -static HMODULE ghMozCtlX = NULL; -static HMODULE ghMozCtl = NULL; - -static LPCTSTR c_szMozCtlDll = _T("mozctl.dll"); -static LPCTSTR c_szMozillaControlKey = _T("Software\\Mozilla\\"); -static LPCTSTR c_szMozillaBinDirPathValue = _T("BinDirectoryPath"); -static LPCTSTR c_szMozCtlInProcServerKey = - _T("CLSID\\{1339B54C-3453-11D2-93B9-000000000000}\\InProcServer32"); - -// Message strings - should come from a resource file -static LPCTSTR c_szWarningTitle = - _T("Mozilla Control Warning"); -static LPCTSTR c_szErrorTitle = - _T("Mozilla Control Error"); -static LPCTSTR c_szPrePickFolderMsg = - _T("The Mozilla control was unable to detect where your Mozilla " - "layout libraries may be found. You will now be shown a directory " - "picker for you to locate them."); -static LPCTSTR c_szPickFolderDlgTitle = - _T("Pick where the Mozilla bin directory is located, " - "e.g. (c:\\mozilla\\bin)"); -static LPCTSTR c_szRegistryErrorMsg = - _T("The Mozilla control was unable to store the location of the Mozilla" - "layout libraries in the registry. This may be due to the host " - "program running with insufficient permissions to write there.\n\n" - "You should consider running the control once as Administrator " - "to enable this entry to added or alternatively move the " - "control files mozctlx.dll and mozctl.dll into the same folder as " - "the other libraries."); -static LPCTSTR c_szLoadErrorMsg = - _T("The Mozilla control could not be loaded correctly. This is could " - "be due to an invalid location being specified for the Mozilla " - "layout libraries or missing files from your installation.\n\n" - "Visit http://www.iol.ie/~locka/mozilla/mozilla.htm for in-depth" - "troubleshooting advice."); - -BOOL APIENTRY DllMain( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - ghMozCtlX = (HMODULE) hModule; - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - if (ghMozCtl) - { - FreeLibrary(ghMozCtl); - ghMozCtl = NULL; - } - break; - } - return TRUE; -} - -static BOOL LoadMozLibrary(BOOL bAskUserToSetPath = TRUE) -{ - if (ghMozCtl) - { - return TRUE; - } - - ghMozCtl = LoadLibrary(c_szMozCtlDll); - if (ghMozCtl) - { - return TRUE; - } - - if (LoadMozLibraryFromCurrentDir()) - { - return TRUE; - } - - if (LoadMozLibraryFromRegistry(bAskUserToSetPath)) - { - return TRUE; - } - - ::MessageBox(NULL, c_szLoadErrorMsg, c_szErrorTitle, MB_OK); - - return FALSE; -} - -static BOOL LoadMozLibraryFromCurrentDir() -{ - TCHAR szMozCtlXPath[MAX_PATH + 1]; - - // Get this module's path - ZeroMemory(szMozCtlXPath, sizeof(szMozCtlXPath)); - GetModuleFileName(ghMozCtlX, szMozCtlXPath, - sizeof(szMozCtlXPath) / sizeof(szMozCtlXPath[0])); - - // Make the control path - TCHAR szTmpDrive[_MAX_DRIVE]; - TCHAR szTmpDir[_MAX_DIR]; - TCHAR szTmpFname[_MAX_FNAME]; - TCHAR szTmpExt[_MAX_EXT]; - _tsplitpath(szMozCtlXPath, szTmpDrive, szTmpDir, szTmpFname, szTmpExt); - - TCHAR szMozCtlPath[MAX_PATH + 1]; - ZeroMemory(szMozCtlPath, sizeof(szMozCtlPath)); - _tmakepath(szMozCtlPath, szTmpDrive, szTmpDir, c_szMozCtlDll, NULL); - - // Stat to see if the control exists - struct _stat dirStat; - if (_tstat(szMozCtlPath, &dirStat) == 0) - { - TCHAR szBinDirPath[MAX_PATH + 1]; - ZeroMemory(szBinDirPath, sizeof(szBinDirPath)); - _tmakepath(szBinDirPath, szTmpDrive, szTmpDir, NULL, NULL); - if (LoadLibraryWithPATHFixup(szBinDirPath)) - { - return TRUE; - } - } - - return FALSE; -} - -static BOOL LoadMozLibraryFromRegistry(BOOL bAskUserToSetPath) -{ - // - HKEY hkey = NULL; - - TCHAR szBinDirPath[MAX_PATH + 1]; - DWORD dwBufSize = sizeof(szBinDirPath); - - ZeroMemory(szBinDirPath, dwBufSize); - - // First try and read the path from the registry - RegOpenKeyEx(HKEY_LOCAL_MACHINE, c_szMozillaControlKey, 0, KEY_READ, &hkey); - if (hkey) - { - DWORD dwType = REG_SZ; - RegQueryValueEx(hkey, c_szMozillaBinDirPathValue, NULL, &dwType, - (LPBYTE) szBinDirPath, &dwBufSize); - RegCloseKey(hkey); - hkey = NULL; - - if (lstrlen(szBinDirPath) > 0 && LoadLibraryWithPATHFixup(szBinDirPath)) - { - return TRUE; - } - - // NOTE: We will drop through here if the registry key existed - // but didn't lead to the control being loaded. - } - - // Ask the user to pick to pick the path? - if (bAskUserToSetPath) - { - // Tell the user that they have to pick the bin dir path - ::MessageBox(NULL, c_szPrePickFolderMsg, c_szWarningTitle, MB_OK); - - // Show a folder picker for the user to choose the bin directory - BROWSEINFO bi; - ZeroMemory(&bi, sizeof(bi)); - bi.hwndOwner = NULL; - bi.pidlRoot = NULL; - bi.pszDisplayName = szBinDirPath; - bi.lpszTitle = c_szPickFolderDlgTitle; - LPITEMIDLIST pItemList = SHBrowseForFolder(&bi); - if (pItemList) - { - // Get the path from the user selection - IMalloc *pShellAllocator = NULL; - SHGetMalloc(&pShellAllocator); - if (pShellAllocator) - { - char szPath[MAX_PATH + 1]; - - if (SHGetPathFromIDList(pItemList, szPath)) - { - // Chop off the end path separator - int nPathSize = strlen(szPath); - if (nPathSize > 0) - { - if (szPath[nPathSize - 1] == '\\') - { - szPath[nPathSize - 1] = '\0'; - } - } - - // Form the file pattern -#ifdef UNICODE - MultiByteToWideChar(CP_ACP, 0, szPath, szBinDirPath, -1, - sizeof(szBinDirPath) / sizeof(TCHAR)); -#else - lstrcpy(szBinDirPath, szPath); -#endif - } - pShellAllocator->Free(pItemList); - pShellAllocator->Release(); - } - } - - // Store the new path if we can - if (lstrlen(szBinDirPath) > 0) - { - RegCreateKeyEx(HKEY_LOCAL_MACHINE, c_szMozillaControlKey, 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL); - if (hkey) - { - RegSetValueEx(hkey, c_szMozillaBinDirPathValue, 0, REG_SZ, - (LPBYTE) szBinDirPath, lstrlen(szBinDirPath) * sizeof(TCHAR)); - RegCloseKey(hkey); - } - else - { - // Tell the user the key can't be stored but the path they - // chose will be used for this session - ::MessageBox(NULL, c_szRegistryErrorMsg, c_szErrorTitle, MB_OK); - } - } - } - - if (lstrlen(szBinDirPath) > 0 && LoadLibraryWithPATHFixup(szBinDirPath)) - { - return TRUE; - } - - return FALSE; -} - -static BOOL LoadLibraryWithPATHFixup(const TCHAR *szBinDirPath) -{ - TCHAR szOldPath[8192]; - TCHAR szNewPath[8192]; - - ZeroMemory(szOldPath, sizeof(szOldPath)); - ZeroMemory(szNewPath, sizeof(szNewPath)); - - // Append path to front of PATH - GetEnvironmentVariable("PATH", szOldPath, sizeof(szOldPath) / sizeof(TCHAR)); - lstrcat(szNewPath, szBinDirPath); - lstrcat(szNewPath, _T(";")); - lstrcat(szNewPath, szOldPath); - SetEnvironmentVariable("PATH", szNewPath); - - // Attempt load - ghMozCtl = LoadLibrary(c_szMozCtlDll); - if (ghMozCtl) - { - return TRUE; - } - - // Restore old PATH - SetEnvironmentVariable("PATH", szOldPath); - - return FALSE; -} - - -static BOOL FixupInProcRegistryEntry() -{ - TCHAR szMozCtlXLongPath[MAX_PATH+1]; - ZeroMemory(szMozCtlXLongPath, sizeof(szMozCtlXLongPath)); - GetModuleFileName(ghMozCtlX, szMozCtlXLongPath, - sizeof(szMozCtlXLongPath) * sizeof(TCHAR)); - - TCHAR szMozCtlXPath[MAX_PATH+1]; - ZeroMemory(szMozCtlXPath, sizeof(szMozCtlXPath)); - GetShortPathName(szMozCtlXLongPath, szMozCtlXPath, - sizeof(szMozCtlXPath) * sizeof(TCHAR)); - - HKEY hkey = NULL; - RegOpenKeyEx(HKEY_CLASSES_ROOT, c_szMozCtlInProcServerKey, 0, KEY_ALL_ACCESS, &hkey); - if (hkey) - { - RegSetValueEx(hkey, NULL, 0, REG_SZ, (LPBYTE) szMozCtlXPath, - lstrlen(szMozCtlXPath) * sizeof(TCHAR)); - RegCloseKey(hkey); - return TRUE; - } - - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////// -// Used to determine whether the DLL can be unloaded by OLE - -typedef HRESULT (STDAPICALLTYPE *DllCanUnloadNowFn)(void); - -STDAPI DllCanUnloadNow(void) -{ - if (LoadMozLibrary()) - { - DllCanUnloadNowFn pfn = (DllCanUnloadNowFn) - GetProcAddress(ghMozCtl, _T("DllCanUnloadNow")); - if (pfn) - { - return pfn(); - } - } - return S_OK; -} - -///////////////////////////////////////////////////////////////////////////// -// Returns a class factory to create an object of the requested type - -typedef HRESULT (STDAPICALLTYPE *DllGetClassObjectFn)(REFCLSID rclsid, REFIID riid, LPVOID* ppv); - -STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) -{ - if (LoadMozLibrary()) - { - DllGetClassObjectFn pfn = (DllGetClassObjectFn) - GetProcAddress(ghMozCtl, _T("DllGetClassObject")); - if (pfn) - { - return pfn(rclsid, riid, ppv); - } - } - return E_FAIL; -} - -///////////////////////////////////////////////////////////////////////////// -// DllRegisterServer - Adds entries to the system registry - -typedef HRESULT (STDAPICALLTYPE *DllRegisterServerFn)(void); - -STDAPI DllRegisterServer(void) -{ - if (LoadMozLibrary()) - { - DllRegisterServerFn pfn = (DllRegisterServerFn) - GetProcAddress(ghMozCtl, _T("DllRegisterServer")); - if (pfn) - { - HRESULT hr = pfn(); - if (SUCCEEDED(hr)) - { - FixupInProcRegistryEntry(); - } - return hr; - } - } - return E_FAIL; -} - -///////////////////////////////////////////////////////////////////////////// -// DllUnregisterServer - Removes entries from the system registry - -typedef HRESULT (STDAPICALLTYPE *DllUnregisterServerFn)(void); - -STDAPI DllUnregisterServer(void) -{ - if (LoadMozLibrary()) - { - DllUnregisterServerFn pfn = (DllUnregisterServerFn) - GetProcAddress(ghMozCtl, _T("DllUnregisterServer")); - if (pfn) - { - return pfn(); - } - } - return E_FAIL; -} diff --git a/embedding/browser/activex/src/control_kicker/control_kicker.dsp b/embedding/browser/activex/src/control_kicker/control_kicker.dsp deleted file mode 100644 index 86859450bd2..00000000000 --- a/embedding/browser/activex/src/control_kicker/control_kicker.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="control_kicker" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=control_kicker - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "control_kicker.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "control_kicker.mak" CFG="control_kicker - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "control_kicker - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "control_kicker - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "control_kicker - Win32 Release" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f control_kicker.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "control_kicker.exe" -# PROP BASE Bsc_Name "control_kicker.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "nmake /f makefile.win" -# PROP Rebuild_Opt "/a" -# PROP Target_File "WIN32_O.OBJ\mozctlx.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "control_kicker - Win32 Debug" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f control_kicker.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "control_kicker.exe" -# PROP BASE Bsc_Name "control_kicker.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "nmake /f makefile.win" -# PROP Rebuild_Opt "/a" -# PROP Target_File "WIN32_D.OBJ\mozctlx.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "control_kicker - Win32 Release" -# Name "control_kicker - Win32 Debug" - -!IF "$(CFG)" == "control_kicker - Win32 Release" - -!ELSEIF "$(CFG)" == "control_kicker - Win32 Debug" - -!ENDIF - -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\control_kicker.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\control_kicker.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# End Target -# End Project diff --git a/embedding/browser/activex/src/control_kicker/control_kicker.h b/embedding/browser/activex/src/control_kicker/control_kicker.h deleted file mode 100644 index cabad3129a8..00000000000 --- a/embedding/browser/activex/src/control_kicker/control_kicker.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifde -///////////////////////////////////////////////////////////////////////////// -// 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; -} diff --git a/embedding/browser/activex/src/control_kicker/mozctlx.def b/embedding/browser/activex/src/control_kicker/mozctlx.def deleted file mode 100644 index ff3d02029e4..00000000000 --- a/embedding/browser/activex/src/control_kicker/mozctlx.def +++ /dev/null @@ -1,10 +0,0 @@ -; mozctlx.def : Declares the module parameters. - -LIBRARY "mozctlx.dll" -EXPORTS - ; ActiveX exports - DllCanUnloadNow @100 PRIVATE - DllGetClassObject @101 PRIVATE - DllRegisterServer @102 PRIVATE - DllUnregisterServer @103 PRIVATE - diff --git a/embedding/browser/activex/src/plugin/LegacyPlugin.cpp b/embedding/browser/activex/src/plugin/LegacyPlugin.cpp deleted file mode 100644 index dc360a4bdcd..00000000000 --- a/embedding/browser/activex/src/plugin/LegacyPlugin.cpp +++ /dev/null @@ -1,1270 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include "npapi.h" - -#include "jsapi.h" -#include "jscntxt.h" - -#include "nsISupports.h" - -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -#include "XPConnect.h" -#endif - -#include "LegacyPlugin.h" - -#ifdef XPC_IDISPATCH_SUPPORT -#include "nsCOMPtr.h" -#include "nsStringAPI.h" -#include "nsIDocument.h" -#include "nsIDOMElement.h" -#include "nsIDOMDocument.h" -#include "nsIDOMWindow.h" -#include "nsIScriptGlobalObject.h" -#include "nsIScriptContext.h" -#include "nsIURI.h" -#include "nsIJSContextStack.h" -#include "nsIScriptSecurityManager.h" -#endif - -/////////////////////////////////////////////////////////////////////////////// -// These are constants to control certain default behaviours - -#ifndef MOZ_ACTIVEX_PLUGIN_XPCONNECT -// Flag determines if controls should be created if they are not marked -// safe for scripting. -const BOOL kHostSafeControlsOnly = FALSE; -// Flag determines if controls should be downloaded and installed if there is a -// codebase specified -const BOOL kDownloadControlsIfMissing = FALSE; -#endif - -// Flag determines whether the plugin will complain to the user if a page -// contains a control it cannot load -const BOOL kDisplayErrorMessages = FALSE; - -/////////////////////////////////////////////////////////////////////////////// -// CInstallControlProgress - -class CInstallControlProgress : - public CComObjectRootEx, - public IBindStatusCallback, - public IWindowForBindingUI -{ -public: - CInstallControlProgress() - { - } - - BOOL mBindingInProgress; - HRESULT mResult; - NPP mNPP; - -protected: - virtual ~CInstallControlProgress() - { - } -public: -BEGIN_COM_MAP(CInstallControlProgress) - COM_INTERFACE_ENTRY(IBindStatusCallback) - COM_INTERFACE_ENTRY(IWindowForBindingUI) -END_COM_MAP() - -// IBindStatusCallback - HRESULT STDMETHODCALLTYPE OnStartBinding(DWORD dwReserved, - IBinding __RPC_FAR *pib) - { - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetPriority(LONG __RPC_FAR *pnPriority) - { - return S_OK; - } - - HRESULT STDMETHODCALLTYPE OnLowResource(DWORD reserved) - { - return S_OK; - } - - HRESULT STDMETHODCALLTYPE OnProgress(ULONG ulProgress, - ULONG ulProgressMax, - ULONG ulStatusCode, - LPCWSTR szStatusText) - { - switch (ulStatusCode) - { - case BINDSTATUS_BEGINDOWNLOADDATA: - case BINDSTATUS_DOWNLOADINGDATA: - case BINDSTATUS_ENDDOWNLOADDATA: - { - char szMsg[100]; - _snprintf(szMsg, sizeof(szMsg) - 1, "Downloading control (%lu of %lu)", ulProgress, ulProgressMax); - szMsg[sizeof(szMsg) - 1] = '\0'; - NPN_Status(mNPP, szMsg); - } - break; - case BINDSTATUS_FINDINGRESOURCE: - case BINDSTATUS_CONNECTING: - case BINDSTATUS_REDIRECTING: - case BINDSTATUS_BEGINDOWNLOADCOMPONENTS: - case BINDSTATUS_INSTALLINGCOMPONENTS: - case BINDSTATUS_ENDDOWNLOADCOMPONENTS: - case BINDSTATUS_USINGCACHEDCOPY: - case BINDSTATUS_SENDINGREQUEST: - case BINDSTATUS_CLASSIDAVAILABLE: - case BINDSTATUS_MIMETYPEAVAILABLE: - case BINDSTATUS_CACHEFILENAMEAVAILABLE: - case BINDSTATUS_BEGINSYNCOPERATION: - case BINDSTATUS_ENDSYNCOPERATION: - case BINDSTATUS_BEGINUPLOADDATA: - case BINDSTATUS_UPLOADINGDATA: - case BINDSTATUS_ENDUPLOADDATA: - case BINDSTATUS_PROTOCOLCLASSID: - case BINDSTATUS_ENCODING: - case BINDSTATUS_CLASSINSTALLLOCATION: - case BINDSTATUS_DECODING: - case BINDSTATUS_LOADINGMIMEHANDLER: - default: - /* do nothing */ - break; - } - return S_OK; - } - - HRESULT STDMETHODCALLTYPE OnStopBinding(HRESULT hresult, LPCWSTR szError) - { - mBindingInProgress = FALSE; - mResult = hresult; - NPN_Status(mNPP, ""); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE GetBindInfo(DWORD __RPC_FAR *pgrfBINDF, - BINDINFO __RPC_FAR *pbindInfo) - { - *pgrfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | - BINDF_GETNEWESTVERSION | BINDF_NOWRITECACHE; - pbindInfo->cbSize = sizeof(BINDINFO); - pbindInfo->szExtraInfo = NULL; - memset(&pbindInfo->stgmedData, 0, sizeof(STGMEDIUM)); - pbindInfo->grfBindInfoF = 0; - pbindInfo->dwBindVerb = 0; - pbindInfo->szCustomVerb = NULL; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE OnDataAvailable(DWORD grfBSCF, - DWORD dwSize, - FORMATETC __RPC_FAR *pformatetc, - STGMEDIUM __RPC_FAR *pstgmed) - { - return E_NOTIMPL; - } - - HRESULT STDMETHODCALLTYPE OnObjectAvailable(REFIID riid, - IUnknown __RPC_FAR *punk) - { - return S_OK; - } - -// IWindowForBindingUI - virtual HRESULT STDMETHODCALLTYPE GetWindow( - /* [in] */ REFGUID rguidReason, - /* [out] */ HWND *phwnd) - { - HWND hwnd = NULL; - NPN_GetValue(mNPP, NPNVnetscapeWindow, &hwnd); - *phwnd = hwnd; - return S_OK; - } -}; - -/////////////////////////////////////////////////////////////////////////////// - - -// NPP_Initialize -// -// Initialize the plugin library. Your DLL global initialization -// should be here -// -NPError NPP_Initialize(void) -{ - ATLTRACE(_T("NPP_Initialize()\n")); - _Module.Lock(); - return NPERR_NO_ERROR; -} - - -// NPP_Shutdown -// -// shutdown the plugin library. Revert initializition -// -void NPP_Shutdown(void) -{ - ATLTRACE(_T("NPP_Shutdown()\n")); - _Module.Unlock(); -} - - -#define MIME_OLEOBJECT1 "application/x-oleobject" -#define MIME_OLEOBJECT2 "application/oleobject" - -enum MozAxPluginErrors -{ - MozAxErrorControlIsNotSafeForScripting, - MozAxErrorCouldNotCreateControl, -}; - -static void -ShowError(MozAxPluginErrors errorCode, const CLSID &clsid) -{ - if (!kDisplayErrorMessages) - return; - - const TCHAR *szMsg = NULL; - const unsigned long kBufSize = 256; - TCHAR szBuffer[kBufSize]; - - // TODO errors are hardcoded for now - switch (errorCode) - { - case MozAxErrorControlIsNotSafeForScripting: - { - USES_CONVERSION; - LPOLESTR szClsid; - StringFromCLSID(clsid, &szClsid); - _sntprintf(szBuffer, kBufSize - 1, - _T("Could not create the control %s because it is not marked safe for scripting."), OLE2T(szClsid)); - CoTaskMemFree(szClsid); - szMsg = szBuffer; - } - break; - case MozAxErrorCouldNotCreateControl: - { - USES_CONVERSION; - LPOLESTR szClsid; - StringFromCLSID(clsid, &szClsid); - _sntprintf(szBuffer, kBufSize - 1, - _T("Could not create the control %s. Check that it has been installed on your computer and that this page correctly references it."), OLE2T(szClsid)); - CoTaskMemFree(szClsid); - szMsg = szBuffer; - } - break; - } - szBuffer[kBufSize - 1] = TCHAR('\0'); - if (szMsg) - MessageBox(NULL, szMsg, _T("ActiveX Error"), MB_OK | MB_ICONWARNING); -} - -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - -static nsresult -CreatePrincipal(nsIURI * origin, - nsIPrincipal ** outPrincipal) -{ - nsresult rv; - nsCOMPtr secMan( - do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv)); - if (NS_FAILED(rv)) return rv; - - return secMan->GetCodebasePrincipal(origin, outPrincipal); -} - -/***************************************************************************/ -// A class to put on the stack to manage JS contexts when we are entering JS. -// This pushes and pops the given context -// with the nsThreadJSContextStack service as this object goes into and out -// of scope. It is optimized to not push/pop the cx if it is already on top -// of the stack. We need to push the JSContext when we enter JS because the -// JS security manager looks on the context stack for permissions information. - -class MozAxAutoPushJSContext -{ -public: - MozAxAutoPushJSContext(JSContext *cx, nsIURI * aURI); - - ~MozAxAutoPushJSContext(); - - nsresult ResultOfPush() { return mPushResult; }; - -private: - nsCOMPtr mContextStack; - JSContext* mContext; - JSStackFrame mFrame; - nsresult mPushResult; -}; - - -MozAxAutoPushJSContext::MozAxAutoPushJSContext(JSContext *cx, - nsIURI * aURI) - : mContext(cx), mPushResult(NS_OK) -{ - nsCOMPtr contextStack = - do_GetService("@mozilla.org/js/xpc/ContextStack;1"); - - JSContext* currentCX; - if(contextStack && - // Don't push if the current context is already on the stack. - (NS_FAILED(contextStack->Peek(¤tCX)) || - cx != currentCX) ) - { - if (NS_SUCCEEDED(contextStack->Push(cx))) - { - // Leave the reference in mContextStack to - // indicate that we need to pop it in our dtor. - mContextStack.swap(contextStack); - } - } - - memset(&mFrame, 0, sizeof(mFrame)); - - // See if there are any scripts on the stack. - // If not, we need to add a dummy frame with a principal. - PRBool hasScript = PR_FALSE; - JSStackFrame* tempFP = cx->fp(); - while (tempFP) - { - if (tempFP->script) - { - hasScript = PR_TRUE; - break; - } - tempFP = tempFP->down; - }; - - if (!hasScript) - { - nsCOMPtr principal; - mPushResult = CreatePrincipal(aURI, getter_AddRefs(principal)); - - if (NS_SUCCEEDED(mPushResult)) - { - JSPrincipals* jsprinc; - principal->GetJSPrincipals(cx, &jsprinc); - - mFrame.script = JS_CompileScriptForPrincipals(cx, JS_GetGlobalObject(cx), - jsprinc, "", 0, "", 1); - JSPRINCIPALS_DROP(cx, jsprinc); - - if (mFrame.script) - { - mFrame.down = cx->fp; - cx->fp = &mFrame; - } - else - mPushResult = NS_ERROR_OUT_OF_MEMORY; - } - } -} - -MozAxAutoPushJSContext::~MozAxAutoPushJSContext() -{ - if (mContextStack) - mContextStack->Pop(nsnull); - - if (mFrame.script) - mContext->fp = mFrame.down; - -} - - -static JSContext* -GetPluginsContext(PluginInstanceData *pData) -{ - nsCOMPtr window; - NPN_GetValue(pData->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(window))); - - nsCOMPtr globalObject(do_QueryInterface(window)); - if (!globalObject) - return nsnull; - - nsIScriptContext *scriptContext = globalObject->GetContext(); - - if (!scriptContext) - return nsnull; - - return reinterpret_cast(scriptContext->GetNativeContext()); -} - -#endif - -static BOOL -WillHandleCLSID(const CLSID &clsid, PluginInstanceData *pData) -{ -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - // Ensure the control is safe for scripting - nsCOMPtr dispSupport = do_GetService(NS_IDISPATCH_SUPPORT_CONTRACTID); - if (!dispSupport) - return FALSE; - JSContext * cx = GetPluginsContext(pData); - if (!cx) - return FALSE; - nsCID cid; - memcpy(&cid, &clsid, sizeof(nsCID)); - PRBool isSafe = PR_FALSE; - PRBool classExists = PR_FALSE; - nsCOMPtr uri; - MozAxPlugin::GetCurrentLocation(pData->pPluginInstance, getter_AddRefs(uri)); - - JSAutoRequest req(cx); - MozAxAutoPushJSContext autoContext(cx, uri); - dispSupport->IsClassSafeToHost(cx, cid, PR_TRUE, &classExists, &isSafe); - if (classExists && !isSafe) - return FALSE; - return TRUE; -#else - if (::IsEqualCLSID(clsid, CLSID_NULL)) - { - return FALSE; - } - - // Check the Internet Explorer list of vulnerable controls - CRegKey keyExplorer; - if (keyExplorer.Open(HKEY_LOCAL_MACHINE, - _T("SOFTWARE\\Microsoft\\Internet Explorer\\ActiveX Compatibility"), KEY_READ) == ERROR_SUCCESS) - { - LPOLESTR szCLSID = NULL; - ::StringFromCLSID(clsid, &szCLSID); - if (szCLSID) - { - CRegKey keyCLSID; - USES_CONVERSION; - if (keyCLSID.Open(keyExplorer, W2T(szCLSID), KEY_READ) == ERROR_SUCCESS) - { - DWORD dwType = REG_DWORD; - DWORD dwFlags = 0; - DWORD dwBufSize = sizeof(dwFlags); - if (::RegQueryValueEx(keyCLSID, _T("Compatibility Flags"), - NULL, &dwType, (LPBYTE) &dwFlags, &dwBufSize) == ERROR_SUCCESS) - { - // Flags for this reg key - const DWORD kKillBit = 0x00000400; - if (dwFlags & kKillBit) - { - ::CoTaskMemFree(szCLSID); - return FALSE; - } - } - } - ::CoTaskMemFree(szCLSID); - } - } - - // Check if the CLSID belongs to a list that the plugin does not support - CRegKey keyDeny; - if (keyDeny.Open(HKEY_LOCAL_MACHINE, kControlsToDenyKey, KEY_READ) == ERROR_SUCCESS) - { - // Enumerate CLSIDs looking for this one - int i = 0; - do { - USES_CONVERSION; - TCHAR szCLSID[64]; - const DWORD nLength = sizeof(szCLSID) / sizeof(szCLSID[0]); - if (::RegEnumKey(keyDeny, i++, szCLSID, nLength) != ERROR_SUCCESS) - { - break; - } - szCLSID[nLength - 1] = TCHAR('\0'); - CLSID clsidToCompare = GUID_NULL; - if (SUCCEEDED(::CLSIDFromString(T2OLE(szCLSID), &clsidToCompare)) && - ::IsEqualCLSID(clsid, clsidToCompare)) - { - return FALSE; - } - } while (1); - keyDeny.Close(); - } - - // Check if the CLSID belongs to a list that the plugin only supports - CRegKey keyAllow; - if (keyAllow.Open(HKEY_LOCAL_MACHINE, kControlsToAllowKey, KEY_READ) == ERROR_SUCCESS) - { - // Enumerate CLSIDs looking for this one - int i = 0; - do { - USES_CONVERSION; - TCHAR szCLSID[64]; - const DWORD nLength = sizeof(szCLSID) / sizeof(szCLSID[0]); - if (::RegEnumKey(keyAllow, i, szCLSID, nLength) != ERROR_SUCCESS) - { - // An empty list means all controls are allowed. - return (i == 0) ? TRUE : FALSE; - } - ++i; - szCLSID[nLength - 1] = TCHAR('\0'); - CLSID clsidToCompare = GUID_NULL; - if (SUCCEEDED(::CLSIDFromString(T2OLE(szCLSID), &clsidToCompare)) && - ::IsEqualCLSID(clsid, clsidToCompare)) - { - return TRUE; - } - } while (1); - } - - return TRUE; -#endif -} - -static NPError -CreateControl(const CLSID &clsid, PluginInstanceData *pData, PropertyList &pl, LPCOLESTR szCodebase) -{ - // Make sure we got a CLSID we can handle - if (!WillHandleCLSID(clsid, pData)) - { - return NPERR_GENERIC_ERROR; - } - - pData->clsid = clsid; - - // Set flags to specify if it is allowed to host safe or unsafe controls - // and download them. - PRBool hostSafeControlsOnly; - PRBool downloadControlsIfMissing; -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - PRUint32 hostingFlags = MozAxPlugin::PrefGetHostingFlags(); - if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_SAFE_OBJECTS && - !(hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_ALL_OBJECTS)) - { - hostSafeControlsOnly = TRUE; - } - else if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_ALL_OBJECTS) - { - hostSafeControlsOnly = FALSE; - } - else - { - // Plugin can host neither safe nor unsafe controls, so just return - // without creating anything. - return NPERR_GENERIC_ERROR; - } - if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_DOWNLOAD_CONTROLS) - { - downloadControlsIfMissing = PR_TRUE; - } - else - { - downloadControlsIfMissing = PR_FALSE; - } - // Ensure we can obtain the nsIDispatchSupport service - nsCOMPtr dispSupport = do_GetService(NS_IDISPATCH_SUPPORT_CONTRACTID); - if (!dispSupport) - { - return NPERR_GENERIC_ERROR; - } - // Now test if the CLSID is safe for scripting - PRBool classIsMarkedSafeForScripting = PR_FALSE; - if (hostSafeControlsOnly) - { - PRBool classExists = PR_FALSE; - PRBool isClassSafeForScripting = PR_FALSE; - nsCID cid; - memcpy(&cid, &clsid, sizeof(cid)); - if (NS_SUCCEEDED(dispSupport->IsClassMarkedSafeForScripting(cid, &classExists, &isClassSafeForScripting)) && - classExists && isClassSafeForScripting) - { - classIsMarkedSafeForScripting = PR_TRUE; - } - } -#else - hostSafeControlsOnly = kHostSafeControlsOnly; - downloadControlsIfMissing = kDownloadControlsIfMissing; -#endif - - // Create the control site - CControlSiteInstance *pSite = NULL; - CControlSiteInstance::CreateInstance(&pSite); - if (pSite == NULL) - { - return NPERR_GENERIC_ERROR; - } - - pSite->m_bSupportWindowlessActivation = FALSE; -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - // We handle our own security further down - pSite->SetSecurityPolicy(NULL); - pSite->m_bSafeForScriptingObjectsOnly = FALSE; -#else - pSite->m_bSafeForScriptingObjectsOnly = hostSafeControlsOnly; -#endif - - pSite->AddRef(); - -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - // Set up the service provider and container so the control can get hold - // of the IE DOM and other interfaces - CComPtr sp; - MozAxPlugin::GetServiceProvider(pData, &sp); - if (sp) - pSite->SetServiceProvider(sp); - CComQIPtr container = sp; - if (container) - pSite->SetContainer(container); -#endif - - // TODO check the object is installed and at least as recent as - // that specified in szCodebase - - // Create the object - HRESULT hr; - if (!downloadControlsIfMissing || !szCodebase) - { - hr = pSite->Create(clsid, pl); - } - else if (szCodebase) - { - CComObject *pProgress = NULL; - CComPtr spBindCtx; - CComPtr spOldBSC; - CComObject::CreateInstance(&pProgress); - pProgress->AddRef(); - CreateBindCtx(0, &spBindCtx); - RegisterBindStatusCallback(spBindCtx, dynamic_cast(pProgress), &spOldBSC, 0); - - hr = pSite->Create(clsid, pl, szCodebase, spBindCtx); - if (hr == MK_S_ASYNCHRONOUS) - { - pProgress->mNPP = pData->pPluginInstance; - pProgress->mBindingInProgress = TRUE; - pProgress->mResult = E_FAIL; - - // Spin around waiting for binding to complete - HANDLE hFakeEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - while (pProgress->mBindingInProgress) - { - MSG msg; - // Process pending messages - while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (!::GetMessage(&msg, NULL, 0, 0)) - { - pProgress->mBindingInProgress = FALSE; - break; - } - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - if (!pProgress->mBindingInProgress) - break; - // Sleep for a bit or the next msg to appear - ::MsgWaitForMultipleObjects(1, &hFakeEvent, FALSE, 500, QS_ALLEVENTS); - } - ::CloseHandle(hFakeEvent); - - hr = pProgress->mResult; - if (SUCCEEDED(hr)) - { - hr = pSite->Create(clsid, pl); - } - } - if (pProgress) - { - RevokeBindStatusCallback(spBindCtx, dynamic_cast(pProgress)); - pProgress->Release(); - } - } - if (FAILED(hr)) - { - ShowError(MozAxErrorCouldNotCreateControl, clsid); - } -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - if (SUCCEEDED(hr) && hostSafeControlsOnly && !classIsMarkedSafeForScripting) - { - CComPtr cpUnk; - pSite->GetControlUnknown(&cpUnk); - nsIID iidDispatch; - memcpy(&iidDispatch, &__uuidof(IDispatch), sizeof(nsIID)); - PRBool isObjectSafe = PR_FALSE; - if (!cpUnk || - NS_FAILED(dispSupport->IsObjectSafeForScripting( - reinterpret_cast(cpUnk.p), iidDispatch, &isObjectSafe)) || - !isObjectSafe) - { - pSite->Detach(); - hr = E_FAIL; - ShowError(MozAxErrorControlIsNotSafeForScripting, clsid); - // DROP THROUGH - } - } -#endif - - // Clean up if the control could not be created - if (FAILED(hr)) - { - pSite->Release(); - return NPERR_GENERIC_ERROR; - } - -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - // Hook up the event sink - nsEventSinkInstance *pSink = NULL; - nsEventSinkInstance::CreateInstance(&pSink); - if (pSink) - { - pSink->AddRef(); - pSink->mPlugin = pData; - CComPtr control; - pSite->GetControlUnknown(&control); - pSink->SubscribeToEvents(control); - } - pData->pControlEventSink = pSink; -#endif - pData->nType = itControl; - pData->pControlSite = pSite; - - return NPERR_NO_ERROR; -} - -static NPError -NewControl(const char *pluginType, - PluginInstanceData *pData, - uint16_t mode, - int16_t argc, - char *argn[], - char *argv[]) -{ - // Read the parameters - CLSID clsid = CLSID_NULL; - CComBSTR codebase; - PropertyList pl; - - if (strcmp(pluginType, MIME_OLEOBJECT1) != 0 && - strcmp(pluginType, MIME_OLEOBJECT2) != 0) - { - clsid = MozAxPlugin::GetCLSIDForType(pluginType); - } - - for (int16_t i = 0; i < argc; i++) - { - if (stricmp(argn[i], "CLSID") == 0 || - stricmp(argn[i], "CLASSID") == 0) - { - // Accept CLSIDs specified in various ways - // e.g: - // "CLSID:C16DF970-D1BA-11d2-A252-000000000000" - // "C16DF970-D1BA-11d2-A252-000000000000" - // "{C16DF970-D1BA-11d2-A252-000000000000}" - // - // The first example is the proper way - - const int kCLSIDLen = 256; - char szCLSID[kCLSIDLen]; - if (strlen(argv[i]) < sizeof(szCLSID)) - { - if (_strnicmp(argv[i], "CLSID:", 6) == 0) - { - _snprintf(szCLSID, kCLSIDLen - 1, "{%s}", argv[i]+6); - } - else if(argv[i][0] != '{') - { - _snprintf(szCLSID, kCLSIDLen - 1, "{%s}", argv[i]); - } - else - { - strncpy(szCLSID, argv[i], kCLSIDLen - 1); - } - szCLSID[kCLSIDLen - 1] = '\0'; - USES_CONVERSION; - CLSIDFromString(A2OLE(szCLSID), &clsid); - } - } - else if (stricmp(argn[i], "CODEBASE") == 0) - { - codebase = argv[i]; - -#ifdef XPC_IDISPATCH_SUPPORT - // resolve relative URLs on CODEBASE - if (argv[i]) - { - nsCOMPtr element; - NPN_GetValue(pData->pPluginInstance, NPNVDOMElement, - static_cast(getter_AddRefs(element))); - if (element) - { - nsCOMPtr tagAsNode (do_QueryInterface(element)); - if (tagAsNode) - { - nsCOMPtr DOMdocument; - tagAsNode->GetOwnerDocument(getter_AddRefs(DOMdocument)); - // XXX nsIDocument is not frozen!!! - nsCOMPtr doc(do_QueryInterface(DOMdocument)); - if (doc) - { - nsIURI *baseURI = doc->GetBaseURI(); - if (baseURI) - { - nsCAutoString newURL; - if (NS_SUCCEEDED(baseURI->Resolve(nsDependentCString(argv[i]), newURL))) - { - codebase = newURL.get(); - } - } - } - } - } - } -#endif - - } - else - { - CComBSTR paramName; - if (_strnicmp(argn[i], "PARAM_", 6) == 0) - { - paramName = argn[i] + 6; - } - else if (stricmp(argn[i], "PARAM") == 0) - { - // The next argn and argv values after this symbol - // will be tag names and values - continue; - } - else - { - paramName = argn[i]; - } - - // Empty parameters are ignored - if (!paramName.m_str || paramName.Length() == 0) - { - continue; - } - - USES_CONVERSION; - CComBSTR paramValue(A2W(argv[i])); - - // Check for existing params with the same name - BOOL bFound = FALSE; - for (unsigned long j = 0; j < pl.GetSize(); j++) - { - if (wcscmp(pl.GetNameOf(j), (BSTR) paramName) == 0) - { - bFound = TRUE; - break; - } - } - // If the parameter already exists, don't add it to the - // list again. - if (bFound) - { - continue; - } - - // Add named parameter to list - CComVariant v(paramValue); - pl.AddNamedProperty(paramName, v); - } - } - - return CreateControl(clsid, pData, pl, codebase.m_str); -} - - -// NPP_New -// -// create a new plugin instance -// handle any instance specific code initialization here -// -NPError NPP_New(NPMIMEType pluginType, - NPP instance, - uint16_t mode, - int16_t argc, - char* argn[], - char* argv[], - NPSavedData* saved) -{ - ATLTRACE(_T("NPP_New()\n")); - - // trap duff args - if (instance == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - PluginInstanceData *pData = new PluginInstanceData; - if (pData == NULL) - { - return NPERR_GENERIC_ERROR; - } - pData->pPluginInstance = instance; - pData->szUrl = NULL; - pData->szContentType = (pluginType) ? strdup(pluginType) : NULL; -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - pData->pScriptingPeer = NULL; -#endif - - // Create a plugin according to the mime type -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - MozAxPlugin::AddRef(); -#endif - - CoInitializeEx(NULL, COINIT_MULTITHREADED); - - NPError rv = NPERR_GENERIC_ERROR; - /* if (strcmp(pluginType, MIME_OLEOBJECT1) == 0 || - strcmp(pluginType, MIME_OLEOBJECT2) == 0) */ - { - rv = NewControl(pluginType, pData, mode, argc, argn, argv); - } - - // Test if plugin creation has succeeded and cleanup if it hasn't - if (rv != NPERR_NO_ERROR) - { - if (pData->szContentType) - free(pData->szContentType); - if (pData->szUrl) - free(pData->szUrl); - delete pData; -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - MozAxPlugin::Release(); -#endif - CoUninitialize(); - return rv; - } - - instance->pdata = pData; - - return NPERR_NO_ERROR; -} - - -// NPP_Destroy -// -// Deletes a plug-in instance and releases all of its resources. -// -NPError -NPP_Destroy(NPP instance, NPSavedData** save) -{ - ATLTRACE(_T("NPP_Destroy()\n")); - - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (pData == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - if (pData->nType == itControl) - { - // Destroy the site - CControlSiteInstance *pSite = pData->pControlSite; - if (pSite) - { - pSite->Detach(); - pSite->Release(); - } -#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT) - if (pData->pControlEventSink) - { - pData->pControlEventSink->UnsubscribeFromEvents(); - pData->pControlEventSink->Release(); - } -#endif -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - if (pData->pScriptingPeer) - { - pData->pScriptingPeer->Release(); - } -#endif - } - else if (pData->nType == itScript) - { - // TODO - } - - if (pData->szUrl) - free(pData->szUrl); - if (pData->szContentType) - free(pData->szContentType); - delete pData; -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - MozAxPlugin::Release(); -#endif - - instance->pdata = 0; - - CoUninitialize(); - - return NPERR_NO_ERROR; - -} - - -// NPP_SetWindow -// -// Associates a platform specific window handle with a plug-in instance. -// Called multiple times while, e.g., scrolling. Can be called for three -// reasons: -// -// 1. A new window has been created -// 2. A window has been moved or resized -// 3. A window has been destroyed -// -// There is also the degenerate case; that it was called spuriously, and -// the window handle and or coords may have or have not changed, or -// the window handle and or coords may be ZERO. State information -// must be maintained by the plug-in to correctly handle the degenerate -// case. -// -NPError -NPP_SetWindow(NPP instance, NPWindow* window) -{ - ATLTRACE(_T("NPP_SetWindow()\n")); - - // Reject silly parameters - if (!window) - { - return NPERR_GENERIC_ERROR; - } - - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (pData == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - if (pData->nType == itControl) - { - CControlSiteInstance *pSite = pData->pControlSite; - if (pSite == NULL) - { - return NPERR_GENERIC_ERROR; - } - - HWND hwndParent = (HWND) window->window; - if (hwndParent) - { - RECT rcPos; - GetClientRect(hwndParent, &rcPos); - - if (pSite->GetParentWindow() == NULL) - { - pSite->Attach(hwndParent, rcPos, NULL); - } - else - { - pSite->SetPosition(rcPos); - } - - // Ensure clipping on parent to keep child controls happy - ::SetWindowLong(hwndParent, GWL_STYLE, - ::GetWindowLong(hwndParent, GWL_STYLE) | WS_CLIPCHILDREN); - } - } - - return NPERR_NO_ERROR; -} - - -// NPP_NewStream -// -// Notifies the plugin of a new data stream. -// The data type of the stream (a MIME name) is provided. -// The stream object indicates whether it is seekable. -// The plugin specifies how it wants to handle the stream. -// -// In this case, I set the streamtype to be NPAsFile. This tells the Navigator -// that the plugin doesn't handle streaming and can only deal with the object as -// a complete disk file. It will still call the write functions but it will also -// pass the filename of the cached file in a later NPE_StreamAsFile call when it -// is done transferring the file. -// -// If a plugin handles the data in a streaming manner, it should set streamtype to -// NPNormal (e.g. *streamtype = NPNormal)...the NPE_StreamAsFile function will -// never be called in this case -// -NPError -NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream *stream, - NPBool seekable, - uint16_t *stype) -{ - ATLTRACE(_T("NPP_NewStream()\n")); - - if(!instance) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - // save the plugin instance object in the stream instance - stream->pdata = instance->pdata; - *stype = NP_ASFILE; - return NPERR_NO_ERROR; -} - - -// NPP_StreamAsFile -// -// The stream is done transferring and here is a pointer to the file in the cache -// This function is only called if the streamtype was set to NPAsFile. -// -void -NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) -{ - ATLTRACE(_T("NPP_StreamAsFile()\n")); - - if(fname == NULL || fname[0] == NULL) - { - return; - } -} - - -// -// These next 2 functions are really only directly relevant -// in a plug-in which handles the data in a streaming manner. -// For a NPAsFile stream, they are still called but can safely -// be ignored. -// -// In a streaming plugin, all data handling would take place here... -// -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. - -int32_t STREAMBUFSIZE = 0X0FFFFFFF; // we are reading from a file in NPAsFile mode - // so we can take any size stream in our write - // call (since we ignore it) - - -// NPP_WriteReady -// -// The number of bytes that a plug-in is willing to accept in a subsequent -// NPO_Write call. -// -int32_t -NPP_WriteReady(NPP instance, NPStream *stream) -{ - return STREAMBUFSIZE; -} - - -// NPP_Write -// -// Provides len bytes of data. -// -int32_t -NPP_Write(NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer) -{ - return len; -} - - -// NPP_DestroyStream -// -// Closes a stream object. -// reason indicates why the stream was closed. Possible reasons are -// that it was complete, because there was some error, or because -// the user aborted it. -// -NPError -NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) -{ - // because I am handling the stream as a file, I don't do anything here... - // If I was streaming, I would know that I was done and do anything appropriate - // to the end of the stream... - return NPERR_NO_ERROR; -} - - -// NPP_Print -// -// Printing the plugin (to be continued...) -// -void -NPP_Print(NPP instance, NPPrint* printInfo) -{ - if(printInfo == NULL) // trap invalid parm - { - return; - } - -// if (instance != NULL) { -// CPluginWindow* pluginData = (CPluginWindow*) instance->pdata; -// pluginData->Print(printInfo); -// } -} - -/******************************************************************************* -// NPP_URLNotify: -// Notifies the instance of the completion of a URL request. -// -// NPP_URLNotify is called when Netscape completes a NPN_GetURLNotify or -// NPN_PostURLNotify request, to inform the plug-in that the request, -// identified by url, has completed for the reason specified by reason. The most -// common reason code is NPRES_DONE, indicating simply that the request -// completed normally. Other possible reason codes are NPRES_USER_BREAK, -// indicating that the request was halted due to a user action (for example, -// clicking the "Stop" button), and NPRES_NETWORK_ERR, indicating that the -// request could not be completed (for example, because the URL could not be -// found). The complete list of reason codes is found in npapi.h. -// -// The parameter notifyData is the same plug-in-private value passed as an -// argument to the corresponding NPN_GetURLNotify or NPN_PostURLNotify -// call, and can be used by your plug-in to uniquely identify the request. - ******************************************************************************/ - -void -NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) -{ - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (pData) - { - if (pData->szUrl) - free(pData->szUrl); - pData->szUrl = strdup(url); - } -} - -NPError -NPP_GetValue(NPP instance, NPPVariable variable, void *value) -{ - NPError rv = NPERR_GENERIC_ERROR; -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - rv = MozAxPlugin::GetValue(instance, variable, value); -#endif - return rv; -} - -NPError -NPP_SetValue(NPP instance, NPNVariable variable, void *value) -{ - return NPERR_GENERIC_ERROR; -} diff --git a/embedding/browser/activex/src/plugin/LegacyPlugin.h b/embedding/browser/activex/src/plugin/LegacyPlugin.h deleted file mode 100644 index 731a38959b6..00000000000 --- a/embedding/browser/activex/src/plugin/LegacyPlugin.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * Paul Oswald - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef LEGACYPLUGIN_H -#define LEGACYPLUGIN_H - -#include "npapi.h" -#include "nsISupports.h" - -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -#include "XPConnect.h" -#endif - -// Plugin types supported -enum PluginInstanceType -{ - itScript, - itControl -}; - -// Data associated with a plugin instance -struct PluginInstanceData { - NPP pPluginInstance; - PluginInstanceType nType; - CControlSiteInstance *pControlSite; -#ifdef XPC_IDISPATCH_SUPPORT - nsEventSinkInstance *pControlEventSink; -#endif - char *szUrl; - char *szContentType; - CLSID clsid; -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - nsISupports *pScriptingPeer; -#endif -}; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/plugin/Makefile.in b/embedding/browser/activex/src/plugin/Makefile.in deleted file mode 100644 index f429f491a00..00000000000 --- a/embedding/browser/activex/src/plugin/Makefile.in +++ /dev/null @@ -1,241 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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/MPL/ -# -# 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.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Adam Lock -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -############################################################################### -# CUSTOMISE SETTINGS IN THIS SECTION AS APPROPRIATE FOR YOUR BUILD SYSTEM! - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = npmozax -LIBRARY_NAME = npmozax - -RESFILE = MozActiveX.res -DEFFILE = npmozax.def -GRE_MODULE = 1 - - -XPIFILE = mozactivex.xpi - -FORCE_SHARED_LIB = 1 -NO_DIST_INSTALL = 1 -NO_INSTALL = 1 - -# Path to the Mozilla ActiveX common dir (some files are copied from there) -AXCOMMONSRC=$(srcdir)/../common - -############ -# XPConnect settings - -MOZ_ACTIVEX_PLUGIN_XPCONNECT = 1 - -# XPConnect support in (Netscape 6.1+/Mozilla) - -# Uncomment this line to install the plugin & policy -MOZ_USE_ACTIVEX_PLUGIN = 1 - -# Settings will also be read from this supplemental file if it exists --include $(srcdir)/plugin.mk - -############################################################################### - -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -XPIDLSRCS = \ - ./nsIMozAxPlugin.idl \ - $(NULL) -endif - -GARBAGE += $(DEFFILE) - -CPPSRCS = \ - StdAfx.cpp \ - LegacyPlugin.cpp \ - MozActiveX.cpp \ - npwin.cpp \ - $(NULL) - -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -CPPSRCS += XPConnect.cpp XPCDocument.cpp XPCBrowser.cpp -endif - -ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT -_AXCOMMON_CPPSRCS = \ - ActiveScriptSite.cpp \ - ControlEventSink.cpp \ - ControlSite.cpp \ - ControlSiteIPFrame.cpp \ - ItemContainer.cpp \ - PropertyBag.cpp \ - $(NULL) -CPPSRCS += $(_AXCOMMON_CPPSRCS) -CSRCS += javastubs.c -endif - -ifdef XPC_IDISPATCH_SUPPORT -CPPSRCS += PrefObserver.cpp -endif - -LOCAL_INCLUDES = -I$(srcdir) -I$(AXCOMMONSRC) - -ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT -LOCAL_INCLUDES += -I./_java -endif - -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -LOCAL_INCLUDES += -I$(XPIDL_GEN_DIR) -endif - -OS_LIBS += \ - comdlg32.lib \ - ole32.lib \ - oleaut32.lib \ - uuid.lib \ - shell32.lib \ - $(NULL) - -ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT -DEFINES += -DMOZ_ACTIVEX_PLUGIN_LIVECONNECT -DXPCOM_GLUE -endif - -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -DEFINES += -DMOZ_ACTIVEX_PLUGIN_XPCONNECT -endif - -ifdef XPC_IDISPATCH_SUPPORT -DEFINES += -DXPC_IDISPATCH_SUPPORT -endif - -EXTRA_DSO_LDOPTS = \ - $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \ - $(MOZ_COMPONENT_LIBS) \ - $(NSPR_LIBS) \ - $(NULL) - -LIBS = \ - $(NSPR_LIBS) \ - $(NULL) - -# XPConnect links to XPCOM and the shared activex lib -ifdef XPC_IDISPATCH_SUPPORT -EXTRA_DSO_LDOPTS += \ - ../common/$(LIB_PREFIX)ax_common_s.$(LIB_SUFFIX) \ - $(MOZ_JS_LIBS) \ - $(XPCOM_LIBS) \ - $(NULL) -endif - -SRCS_IN_OBJDIR = 1 - -ENABLE_CXX_EXCEPTIONS = 1 - -include $(topsrcdir)/config/rules.mk - -ifdef MOZ_ACTIVEX_PLUGIN_LIVCONNECT -copy-sources: $(addprefix $(MOZCTLSRC)/,$(_CONTROL_CPPSRCS)) - $(INSTALL) $^ . - -export:: copy-sources -endif - -install-plugin: $(SHARED_LIBRARY) -ifdef SHARED_LIBRARY - $(INSTALL) $< $(DIST)/bin/plugins -endif - -install-class: MozAxPlugin.class - $(INSTALL) $< $(DIST)/bin/plugins - -install-typelib: $(XPIDL_GEN_DIR)/nsIMozAxPlugin.xpt - $(INSTALL) $< $(DIST)/bin/plugins - -install-securitypolicy: nsAxSecurityPolicy.js - $(INSTALL) $< $(DIST)/bin/components - -install-prefs: activex.js $(FLASHLITE_PREFS_JS) - $(INSTALL) $^ $(DIST)/bin/defaults/pref - -ifdef MOZ_USE_ACTIVEX_PLUGIN -libs:: install-plugin install-prefs - -ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT -libs:: install-class -endif - -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT -libs:: install-typelib -endif - -ifdef XPC_IDISPATCH_SUPPORT -libs:: install-securitypolicy -endif -endif - -## Note: Ensure you create the redist dir containing the correct runtime dlls - -xpi:: install.js $(SHARED_LIBRARY) - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) $< - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) $(SHARED_LIBRARY) - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) $(topsrcdir)/../redist/microsoft/system/msvcrt.dll - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) $(topsrcdir)/../redist/microsoft/system/msvcp60.dll -ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) MozAxPlugin.class -endif -ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) $(XPIDL_GEN_DIR)/nsIMozAxPlugin.xpt -endif -ifdef XPC_IDISPATCH_SUPPORT - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) activex.js - $(ZIP) -9 -j $(DIST)/bin/$(XPIFILE) nsAxSecurityPolicy.js -endif - -$(SHARED_LIBRARY) : $(DEFFILE) - -$(DEFFILE): - -rm -f $@ - @echo "; npmozax.def : Declares the module parameters." >> $@ - @echo "; This file was autogenerated by mkctldef.bat!" >> $@ - @echo "" >> $@ - @echo "LIBRARY "npmozax.DLL"" >> $@ - @echo "EXPORTS" >> $@ - @echo "; Plugin exports" >> $@ - @echo "NP_GetEntryPoints @1" >> $@ - @echo "NP_Initialize @2" >> $@ - @echo "NP_Shutdown @3" >> $@ diff --git a/embedding/browser/activex/src/plugin/MozActiveX.cpp b/embedding/browser/activex/src/plugin/MozActiveX.cpp deleted file mode 100644 index e3da4ebd2d7..00000000000 --- a/embedding/browser/activex/src/plugin/MozActiveX.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// npmozax.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" - -CComModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) -END_OBJECT_MAP() - -#if 0 -BOOL WINAPI -DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - _Module.Init(ObjectMap, hInstance, &LIBID_ATLLib); - DisableThreadLibraryCalls(hInstance); - } - else if (dwReason == DLL_PROCESS_DETACH) - { - _Module.Term(); - } - return TRUE; // ok -} -#endif diff --git a/embedding/browser/activex/src/plugin/MozActiveX.rc b/embedding/browser/activex/src/plugin/MozActiveX.rc deleted file mode 100644 index e0f562e7de3..00000000000 --- a/embedding/browser/activex/src/plugin/MozActiveX.rc +++ /dev/null @@ -1,124 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" -#include "winresrc.h" - -///////////////////////////////////////////////////////////////////////////// -// 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 - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,4 - PRODUCTVERSION 1,0,0,4 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Mozilla ActiveX control and plugin module\0" - VALUE "FileExtents", "*.ocx|*.ocx\0" - VALUE "FileOpenName", "ActiveX (*.ocx)|ActiveX (*.ocx)|Adobe Flash Movie (*.swf)|Adobe Flash Movie (*.swf)\0" - VALUE "FileVersion", "1, 0, 0, 4\0" - VALUE "InternalName", "NPMOZAX\0" - VALUE "LegalCopyright", "Copyright 1999\0" - VALUE "LegalTrademarks", "\0" - VALUE "MIMEType", "application/x-oleobject|application/oleobject|application/x-shockwave-flash|application/x-shockwave-flash\0" - VALUE "OriginalFilename", "NPMOZAX.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Mozilla ActiveX control and plugin support\0" - VALUE "ProductVersion", "1, 0, 0, 4\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/src/plugin/MozAxPlugin.java b/embedding/browser/activex/src/plugin/MozAxPlugin.java deleted file mode 100644 index 507a4d5c8fc..00000000000 --- a/embedding/browser/activex/src/plugin/MozAxPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -import netscape.plugin.Plugin; - -public class MozAxPlugin extends Plugin -{ - /////////////////////////////////////////////////////////////////////////// - // Public methods that are exposed through LiveConnect - - public Object getProperty(String dispid) - { - return xgetProperty(dispid); - } - public void setProperty(String dispid, String property) - { - xsetProperty1(dispid, property); - } - public void setProperty(String dispid, Object property) - { - xsetProperty2(dispid, property); - } - - public Object invoke(String dispid) - { - return xinvoke(dispid); - } - - public Object invoke(String dispid, Object p1) - { - return xinvoke1(dispid, p1); - } - public Object invoke(String dispid, Object p1, Object p2) - { - return xinvoke2(dispid, p1, p2); - } - public Object invoke(String dispid, Object p1, Object p2, Object p3) - { - return xinvoke3(dispid, p1, p2, p3); - } - public Object invoke(String dispid, Object p1, Object p2, Object p3, Object p4) - { - return xinvoke4(dispid, p1, p2, p3, p4); - } - public Object invoke(String dispid, Object params[]) - { - return xinvokeX(dispid, params); - } - - /////////////////////////////////////////////////////////////////////////// - // Native implementations of the above methods. - // - // Note: These methods are not overloaded like the public versions above - // because javah generates bad code which doesn't compile if you try. - - private native Object xgetProperty(String dispid); - private native void xsetProperty1(String dispid, String property); - private native void xsetProperty2(String dispid, Object property); - private native Object xinvoke(String dispid); - private native Object xinvoke1(String dispid, Object p1); - private native Object xinvoke2(String dispid, Object p1, Object p2); - private native Object xinvoke3(String dispid, Object p1, Object p2, Object p3); - private native Object xinvoke4(String dispid, Object p1, Object p2, Object p3, Object p4); - private native Object xinvokeX(String dispid, Object params[]); -}; diff --git a/embedding/browser/activex/src/plugin/PrefObserver.cpp b/embedding/browser/activex/src/plugin/PrefObserver.cpp deleted file mode 100644 index 810d7a13774..00000000000 --- a/embedding/browser/activex/src/plugin/PrefObserver.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include - -#include "npapi.h" -#include "nsServiceManagerUtils.h" -#include "nsISupportsUtils.h" -#include "nsIPrefService.h" -#include "nsIPrefBranch2.h" -#include "nsWeakReference.h" -#include "nsIObserver.h" -#include "nsStringAPI.h" - -#include "XPConnect.h" - -// These are the default hosting flags in the absence of a pref. - -const PRUint32 kDefaultHostingFlags = -#ifdef XPC_IDISPATCH_SUPPORT - nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_NOTHING; -#else - nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_SAFE_OBJECTS | - nsIActiveXSecurityPolicy::HOSTING_FLAGS_DOWNLOAD_CONTROLS | - nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS; -#endif - -class PrefObserver : - public nsSupportsWeakReference, - public nsIObserver -{ -public: - PrefObserver(); - -protected: - virtual ~PrefObserver(); - - void Sync(nsIPrefBranch *aPrefBranch); - - PRUint32 mHostingFlags; - nsCOMPtr mPrefBranch; -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIOBSERVER - - static PrefObserver *sPrefObserver; - - nsresult Subscribe(); - nsresult Unsubscribe(); - PRUint32 GetHostingFlags() const; -}; - -const char *kActiveXHostingFlags = "security.xpconnect.activex."; -const char *kUserAgentPref = "general.useragent."; -const char *kProxyPref = "network.http."; - -PrefObserver *PrefObserver::sPrefObserver = nsnull; - -PrefObserver::PrefObserver() : - mHostingFlags(kDefaultHostingFlags) -{ - nsresult rv = NS_OK; - mPrefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); - NS_ASSERTION(mPrefBranch, "where is the pref service?"); -} - -PrefObserver::~PrefObserver() -{ -} - -NS_IMPL_ADDREF(PrefObserver) -NS_IMPL_RELEASE(PrefObserver) - -NS_INTERFACE_MAP_BEGIN(PrefObserver) - NS_INTERFACE_MAP_ENTRY(nsIObserver) - NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) -NS_INTERFACE_MAP_END - -/* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */ -NS_IMETHODIMP PrefObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) -{ - if (strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic) != 0) - { - return S_OK; - } - - nsresult rv; - nsCOMPtr prefBranch = do_QueryInterface(aSubject, &rv); - if (NS_FAILED(rv)) - return rv; - - NS_ConvertUTF16toUTF8 pref(aData); - if (strcmp(kActiveXHostingFlags, pref.get()) == 0 || - strcmp(kUserAgentPref, pref.get()) == 0 || - strcmp(kProxyPref, pref.get()) == 0) - { - Sync(prefBranch); - } - return NS_OK; -} - -void PrefObserver::Sync(nsIPrefBranch *aPrefBranch) -{ - NS_ASSERTION(aPrefBranch, "no pref branch"); - if (!aPrefBranch) - { - return; - } - - // TODO - // const char *userAgent = NPN_UserAgent(mData->pPluginInstance); - // ::UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, userAgent, strlen(userAgent), 0); - - // TODO - // INTERNET_PROXY_INFO ipi; - // ::UrlMkSetSessionOption(INTERNET_OPTION_PROXY, ....); - - nsCOMPtr dispSupport = do_GetService(NS_IDISPATCH_SUPPORT_CONTRACTID); - if (!dispSupport) - mHostingFlags = kDefaultHostingFlags; - else - dispSupport->GetHostingFlags(nsnull, &mHostingFlags); -} - -nsresult -PrefObserver::Subscribe() -{ - NS_ENSURE_TRUE(mPrefBranch, NS_ERROR_FAILURE); - - mPrefBranch->AddObserver(kProxyPref, this, PR_TRUE); - mPrefBranch->AddObserver(kUserAgentPref, this, PR_TRUE); - mPrefBranch->AddObserver(kActiveXHostingFlags, this, PR_TRUE); - - Sync(mPrefBranch); - - return S_OK; -} - -nsresult -PrefObserver::Unsubscribe() -{ - NS_ENSURE_TRUE(mPrefBranch, NS_ERROR_FAILURE); - - mPrefBranch->RemoveObserver(kProxyPref, this); - mPrefBranch->RemoveObserver(kUserAgentPref, this); - mPrefBranch->RemoveObserver(kActiveXHostingFlags, this); - - return NS_OK; -} - -PRUint32 PrefObserver::GetHostingFlags() const -{ - return mHostingFlags; -} - -/////////////////////////////////////////////////////////////////////////////// - -PRUint32 MozAxPlugin::PrefGetHostingFlags() -{ - if (!PrefObserver::sPrefObserver) - { - PrefObserver::sPrefObserver = new PrefObserver(); - if (!PrefObserver::sPrefObserver) - { - return nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_NOTHING; - } - PrefObserver::sPrefObserver->AddRef(); - PrefObserver::sPrefObserver->Subscribe(); - } - return PrefObserver::sPrefObserver->GetHostingFlags(); -} - -void MozAxPlugin::ReleasePrefObserver() -{ - if (PrefObserver::sPrefObserver) - { - PrefObserver::sPrefObserver->Unsubscribe(); - PrefObserver::sPrefObserver->Release(); - PrefObserver::sPrefObserver = nsnull; - } -} - diff --git a/embedding/browser/activex/src/plugin/StdAfx.cpp b/embedding/browser/activex/src/plugin/StdAfx.cpp deleted file mode 100644 index e717491dfaa..00000000000 --- a/embedding/browser/activex/src/plugin/StdAfx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "StdAfx.h" diff --git a/embedding/browser/activex/src/plugin/StdAfx.h b/embedding/browser/activex/src/plugin/StdAfx.h deleted file mode 100644 index b44681c0540..00000000000 --- a/embedding/browser/activex/src/plugin/StdAfx.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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 - -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0403 -#define _ATL_APARTMENT_THREADED -#define _ATL_STATIC_REGISTRY - -#define USE_PLUGIN - -// Uncomment if you want to say what is QI'ing for what -//#define _ATL_DEBUG_QI - -// ATL headers -// The ATL headers that come with the platform SDK have bad for scoping -#if _MSC_VER >= 1400 -#pragma conform(forScope, push, atlhack, off) -#endif - -#include -//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 -#include - -#if _MSC_VER >= 1400 -#pragma conform(forScope, pop, atlhack) -#endif - -#include -#include -#include -#include -#include - -#ifdef USE_PLUGIN -#include -#endif - -// STL headers -#include -#include -#include - -// New winsock2.h doesn't define this anymore -typedef long int32; - -#include "PropertyList.h" -#include "PropertyBag.h" -#include "ItemContainer.h" -#include "ControlSite.h" -#include "ControlSiteIPFrame.h" -#include "ControlEventSink.h" - -#include "npapi.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) diff --git a/embedding/browser/activex/src/plugin/XPCBrowser.cpp b/embedding/browser/activex/src/plugin/XPCBrowser.cpp deleted file mode 100644 index 269b50bd716..00000000000 --- a/embedding/browser/activex/src/plugin/XPCBrowser.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include "npapi.h" - -#include "nsCOMPtr.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsServiceManagerUtils.h" -#include "nsStringAPI.h" -#include "nsIPrefBranch.h" -#include "nsIPrefService.h" -#include "nsMemory.h" - - -#include "XPCBrowser.h" - - -IEBrowser::IEBrowser() -{ -} - -IEBrowser::~IEBrowser() -{ -} - -HRESULT IEBrowser::Init(PluginInstanceData *pData) -{ - mData = pData; - // Get the location URL - NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(mDOMWindow))); - if (mDOMWindow) - { - mWebNavigation = do_GetInterface(mDOMWindow); - } - return S_OK; -} - - -nsresult IEBrowser::GetWebNavigation(nsIWebNavigation **aWebNav) -{ - NS_ENSURE_ARG_POINTER(aWebNav); - *aWebNav = mWebNavigation; - NS_IF_ADDREF(*aWebNav); - return (*aWebNav) ? NS_OK : NS_ERROR_FAILURE; -} - -// Return the nsIDOMWindow object -nsresult IEBrowser::GetDOMWindow(nsIDOMWindow **aDOMWindow) -{ - NS_ENSURE_ARG_POINTER(aDOMWindow); - *aDOMWindow = mDOMWindow; - NS_IF_ADDREF(*aDOMWindow); - return (*aDOMWindow) ? NS_OK : NS_ERROR_FAILURE; -} - -// Return the nsIPrefBranch object -nsresult IEBrowser::GetPrefs(nsIPrefBranch **aPrefBranch) -{ - return CallGetService(NS_PREFSERVICE_CONTRACTID, aPrefBranch); -} - -// Return the valid state of the browser -PRBool IEBrowser::BrowserIsValid() -{ - return mWebNavigation ? PR_TRUE : PR_FALSE; -} - diff --git a/embedding/browser/activex/src/plugin/XPCBrowser.h b/embedding/browser/activex/src/plugin/XPCBrowser.h deleted file mode 100644 index 9133538198d..00000000000 --- a/embedding/browser/activex/src/plugin/XPCBrowser.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef IEBrowser_H -#define IEBrowser_H - -#include -#include - -#include "nsCOMPtr.h" -#include "nsIWebNavigation.h" - -#include "LegacyPlugin.h" - -#include "IWebBrowserImpl.h" - -class IEBrowser : - public CComObjectRootEx, - public IWebBrowserImpl -{ -public: -BEGIN_COM_MAP(IEBrowser) - COM_INTERFACE_ENTRY(IWebBrowser) - COM_INTERFACE_ENTRY(IWebBrowser2) - COM_INTERFACE_ENTRY(IWebBrowserApp) -END_COM_MAP() - - PluginInstanceData *mData; - nsCOMPtr mWebNavigation; - nsCOMPtr mDOMWindow; - - IEBrowser(); - HRESULT Init(PluginInstanceData *pData); - -protected: - virtual ~IEBrowser(); - -public: -// IWebBrowserImpl overrides - // Return the nsIWebNavigation object - virtual nsresult GetWebNavigation(nsIWebNavigation **aWebNav); - // Return the nsIDOMWindow object - virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow); - // Return the nsIPrefBranch object - virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch); - // Return the valid state of the browser - virtual PRBool BrowserIsValid(); -}; - - -#endif diff --git a/embedding/browser/activex/src/plugin/XPCDocument.cpp b/embedding/browser/activex/src/plugin/XPCDocument.cpp deleted file mode 100644 index 2302a1757f9..00000000000 --- a/embedding/browser/activex/src/plugin/XPCDocument.cpp +++ /dev/null @@ -1,2106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "StdAfx.h" - -#include -#include - -// A barely documented interface called ITargetFrame from IE -// This is needed for targeted Hlink* calls (e.g. HlinkNavigateString) to -// work. During the call, the Hlink API QIs and calls ITargetFrame::FindFrame -// to determine the named target frame before calling IHlinkFrame::Navigate. -// -// MS mentions the methods at the url below: -// -// http://msdn.microsoft.com/workshop/browser/browser/Reference/IFaces/ITargetFrame/ITargetFrame.asp -// -// The interface is defined in very recent versions of Internet SDK part of -// the PlatformSDK, from Dec 2002 onwards. -// -// http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ -// -// Neither Visual C++ 6.0 or 7.0 ship with this interface. -// -#ifndef __ITargetFrame_INTERFACE_DEFINED__ -// No ITargetFrame so make a binary compatible one -MIDL_INTERFACE("d5f78c80-5252-11cf-90fa-00AA0042106e") -IMozTargetFrame : public IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetFrameName( - /* [in] */ LPCWSTR pszFrameName) = 0; - virtual HRESULT STDMETHODCALLTYPE GetFrameName( - /* [out] */ LPWSTR *ppszFrameName) = 0; - virtual HRESULT STDMETHODCALLTYPE GetParentFrame( - /* [out] */ IUnknown **ppunkParent) = 0; - virtual HRESULT STDMETHODCALLTYPE FindFrame( - /* [in] */ LPCWSTR pszTargetName, - /* [in] */ IUnknown *ppunkContextFrame, - /* [in] */ DWORD dwFlags, - /* [out] */ IUnknown **ppunkTargetFrame) = 0; - virtual HRESULT STDMETHODCALLTYPE SetFrameSrc( - /* [in] */ LPCWSTR pszFrameSrc) = 0; - virtual HRESULT STDMETHODCALLTYPE GetFrameSrc( - /* [out] */ LPWSTR *ppszFrameSrc) = 0; - virtual HRESULT STDMETHODCALLTYPE GetFramesContainer( - /* [out] */ IOleContainer **ppContainer) = 0; - virtual HRESULT STDMETHODCALLTYPE SetFrameOptions( - /* [in] */ DWORD dwFlags) = 0; - virtual HRESULT STDMETHODCALLTYPE GetFrameOptions( - /* [out] */ DWORD *pdwFlags) = 0; - virtual HRESULT STDMETHODCALLTYPE SetFrameMargins( - /* [in] */ DWORD dwWidth, - /* [in] */ DWORD dwHeight) = 0; - virtual HRESULT STDMETHODCALLTYPE GetFrameMargins( - /* [out] */ DWORD *pdwWidth, - /* [out] */ DWORD *pdwHeight) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoteNavigate( - /* [in] */ ULONG cLength, - /* [size_is][in] */ ULONG *pulData) = 0; - virtual HRESULT STDMETHODCALLTYPE OnChildFrameActivate( - /* [in] */ IUnknown *pUnkChildFrame) = 0; - virtual HRESULT STDMETHODCALLTYPE OnChildFrameDeactivate( - /* [in] */ IUnknown *pUnkChildFrame) = 0; -}; -#define __ITargetFrame_INTERFACE_DEFINED__ -#define ITargetFrame IMozTargetFrame -#endif - -#include "npapi.h" - -#include "nsCOMPtr.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsStringAPI.h" -#include "nsNetUtil.h" - -#include "nsIContent.h" -#include "nsIURI.h" -#include "nsIDocument.h" -#include "nsIScriptObjectPrincipal.h" -#include "nsIDOMWindow.h" -#include "nsIDOMElement.h" -#include "nsIDOMDocument.h" -#include "nsIDOMWindowInternal.h" -#include "nsIDOMLocation.h" -#include "nsIWebNavigation.h" -#include "nsILinkHandler.h" -#include "nsIScriptGlobalObject.h" -#include "nsIScriptContext.h" -#include "nsIPrincipal.h" -#include "nsPIDOMWindow.h" - -#include "XPConnect.h" -#include "XPCBrowser.h" -#include "LegacyPlugin.h" - -#include "IEHtmlElementCollection.h" -#include "IHTMLLocationImpl.h" - -/* - * This file contains partial implementations of various IE objects and - * interfaces that many ActiveX controls expect to be able to obtain and - * call from their control site. Typically controls will use these methods - * in order to integrate themselves with the browser, e.g. a control - * might want to initiate a load, or obtain the user agent. - */ - -class IELocation : - public CComObjectRootEx, - public IHTMLLocationImpl -{ -public: -BEGIN_COM_MAP(IELocation) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLLocation) -END_COM_MAP() - - PluginInstanceData *mData; - nsCOMPtr mDOMLocation; - - IELocation() : mData(NULL) - { - } - - HRESULT Init(PluginInstanceData *pData) - { - NS_PRECONDITION(pData != nsnull, "null ptr"); - - mData = pData; - - // Get the DOM window - nsCOMPtr domWindow; - NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(domWindow))); - if (!domWindow) - { - return E_FAIL; - } - nsCOMPtr windowInternal = do_QueryInterface(domWindow); - if (windowInternal) - { - windowInternal->GetLocation(getter_AddRefs(mDOMLocation)); - } - if (!mDOMLocation) - return E_FAIL; - - return S_OK; - } - - virtual nsresult GetDOMLocation(nsIDOMLocation **aLocation) - { - *aLocation = mDOMLocation; - NS_IF_ADDREF(*aLocation); - return NS_OK; - } -}; - -// Note: corresponds to the window.navigator property in the IE DOM -class IENavigator : - public CComObjectRootEx, - public IDispatchImpl -{ -public: -BEGIN_COM_MAP(IENavigator) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IOmNavigator) -END_COM_MAP() - - PluginInstanceData *mData; - CComBSTR mUserAgent; - - HRESULT Init(PluginInstanceData *pData) - { - mData = pData; - USES_CONVERSION; - const char *userAgent = NPN_UserAgent(mData->pPluginInstance); - mUserAgent.Attach(::SysAllocString(A2CW(userAgent))); - return S_OK; - } - -// IOmNavigator - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_appCodeName( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_appName( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_appVersion( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_userAgent( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - *p = mUserAgent.Copy(); - return S_OK; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE javaEnabled( - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *enabled) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE taintEnabled( - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *enabled) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_mimeTypes( - /* [out][retval] */ IHTMLMimeTypesCollection __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_plugins( - /* [out][retval] */ IHTMLPluginsCollection __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_cookieEnabled( - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_opsProfile( - /* [out][retval] */ IHTMLOpsProfile __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE toString( - /* [out][retval] */ BSTR __RPC_FAR *string) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_cpuClass( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_systemLanguage( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_browserLanguage( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_userLanguage( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_platform( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_appMinorVersion( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_connectionSpeed( - /* [out][retval] */ long __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_onLine( - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_userProfile( - /* [out][retval] */ IHTMLOpsProfile __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } -}; - - -// Note: Corresponds to the window object in the IE DOM -class IEWindow : - public CComObjectRootEx, - public IDispatchImpl -{ -public: - PluginInstanceData *mData; - CComObject *mNavigator; - CComObject *mLocation; - - IEWindow() : mNavigator(NULL), mLocation(NULL), mData(NULL) - { - } - - HRESULT Init(PluginInstanceData *pData) - { - mData = pData; - - CComObject::CreateInstance(&mNavigator); - if (!mNavigator) - { - return E_UNEXPECTED; - } - mNavigator->AddRef(); - mNavigator->Init(mData); - - CComObject::CreateInstance(&mLocation); - if (!mLocation) - { - return E_UNEXPECTED; - } - mLocation->AddRef(); - mLocation->Init(mData); - - return S_OK; - } - -protected: - virtual ~IEWindow() - { - if (mNavigator) - { - mNavigator->Release(); - } - if (mLocation) - { - mLocation->Release(); - } - } - -public: - -BEGIN_COM_MAP(IEWindow) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLWindow2) - COM_INTERFACE_ENTRY(IHTMLFramesCollection2) - COM_INTERFACE_ENTRY_BREAK(IHlinkFrame) -END_COM_MAP() - -//IHTMLFramesCollection2 - virtual /* [id] */ HRESULT STDMETHODCALLTYPE item( - /* [in] */ VARIANT __RPC_FAR *pvarIndex, - /* [out][retval] */ VARIANT __RPC_FAR *pvarResult) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [out][retval] */ long __RPC_FAR *p) - { - return E_NOTIMPL; - } - -// IHTMLWindow2 - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_frames( - /* [out][retval] */ IHTMLFramesCollection2 __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_defaultStatus( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_defaultStatus( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_status( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_status( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE setTimeout( - /* [in] */ BSTR expression, - /* [in] */ long msec, - /* [in][optional] */ VARIANT __RPC_FAR *language, - /* [out][retval] */ long __RPC_FAR *timerID) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE clearTimeout( - /* [in] */ long timerID) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE alert( - /* [in][defaultvalue] */ BSTR message) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE confirm( - /* [in][defaultvalue] */ BSTR message, - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *confirmed) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE prompt( - /* [in][defaultvalue] */ BSTR message, - /* [in][defaultvalue] */ BSTR defstr, - /* [out][retval] */ VARIANT __RPC_FAR *textdata) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Image( - /* [out][retval] */ IHTMLImageElementFactory __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_location( - /* [out][retval] */ IHTMLLocation __RPC_FAR *__RPC_FAR *p) - { - if (mLocation) - return mLocation->QueryInterface(__uuidof(IHTMLLocation), (void **) p); - return E_FAIL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_history( - /* [out][retval] */ IOmHistory __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE close( void) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_opener( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_opener( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_navigator( - /* [out][retval] */ IOmNavigator __RPC_FAR *__RPC_FAR *p) - { - if (mNavigator) - return mNavigator->QueryInterface(__uuidof(IOmNavigator), (void **) p); - return E_FAIL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_name( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_name( - /* [out][retval] */ BSTR __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_parent( - /* [out][retval] */ IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) - { - *p = NULL; - return S_OK; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE open( - /* [in][defaultvalue] */ BSTR url, - /* [in][defaultvalue] */ BSTR name, - /* [in][defaultvalue] */ BSTR features, - /* [in][defaultvalue] */ VARIANT_BOOL replace, - /* [out][retval] */ IHTMLWindow2 __RPC_FAR *__RPC_FAR *pomWindowResult) - { - *pomWindowResult = NULL; - return E_FAIL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_self( - /* [out][retval] */ IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_top( - /* [out][retval] */ IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) - { - *p = NULL; - return S_OK; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_window( - /* [out][retval] */ IHTMLWindow2 __RPC_FAR *__RPC_FAR *p) - { - *p = NULL; - return S_OK; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE navigate( - /* [in] */ BSTR url) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onfocus( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onfocus( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onblur( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onblur( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onload( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onload( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onbeforeunload( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onbeforeunload( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onunload( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onunload( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onhelp( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onhelp( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onerror( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onerror( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onresize( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onresize( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onscroll( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onscroll( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [source][id][propget] */ HRESULT STDMETHODCALLTYPE get_document( - /* [out][retval] */ IHTMLDocument2 __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_event( - /* [out][retval] */ IHTMLEventObj __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [out][retval] */ IUnknown __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE showModalDialog( - /* [in] */ BSTR dialog, - /* [in][optional] */ VARIANT __RPC_FAR *varArgIn, - /* [in][optional] */ VARIANT __RPC_FAR *varOptions, - /* [out][retval] */ VARIANT __RPC_FAR *varArgOut) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE showHelp( - /* [in] */ BSTR helpURL, - /* [in][optional] */ VARIANT helpArg, - /* [in][defaultvalue] */ BSTR features) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_screen( - /* [out][retval] */ IHTMLScreen __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Option( - /* [out][retval] */ IHTMLOptionElementFactory __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE focus( void) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_closed( - /* [out][retval] */ VARIANT_BOOL __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE blur( void) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE scroll( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_clientInformation( - /* [out][retval] */ IOmNavigator __RPC_FAR *__RPC_FAR *p) - { - return get_navigator(p); - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE setInterval( - /* [in] */ BSTR expression, - /* [in] */ long msec, - /* [in][optional] */ VARIANT __RPC_FAR *language, - /* [out][retval] */ long __RPC_FAR *timerID) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE clearInterval( - /* [in] */ long timerID) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_offscreenBuffering( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_offscreenBuffering( - /* [out][retval] */ VARIANT __RPC_FAR *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE execScript( - /* [in] */ BSTR code, - /* [in][defaultvalue] */ BSTR language, - /* [out][retval] */ VARIANT __RPC_FAR *pvarRet) - { - nsresult rv; - - nsCOMPtr domWindow; - NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(domWindow))); - if (!domWindow) - { - return E_UNEXPECTED; - } - - // Now get the DOM Document. Accessing the document will create one - // if necessary. So, basically, this call ensures that a document gets - // created -- if necessary. - nsCOMPtr domDocument; - rv = domWindow->GetDocument(getter_AddRefs(domDocument)); - NS_ASSERTION(domDocument, "No DOMDocument!"); - if (NS_FAILED(rv)) { - return E_UNEXPECTED; - } - - nsCOMPtr globalObject(do_QueryInterface(domWindow)); - if (!globalObject) - return E_UNEXPECTED; - - nsCOMPtr scriptContext = globalObject->GetContext(); - if (!scriptContext) - return E_UNEXPECTED; - - nsCOMPtr doc(do_QueryInterface(domDocument)); - if (!doc) - return E_UNEXPECTED; - - nsIPrincipal *principal = doc->GetPrincipal(); - if (!principal) - return E_UNEXPECTED; - - // Execute the script. - // - // Note: The script context takes care of the JS stack and of ensuring - // nothing is executed when JS is disabled. - // - nsAutoString scriptString(code); - NS_NAMED_LITERAL_CSTRING(url, "javascript:axplugin"); - rv = scriptContext->EvaluateString(scriptString, - nsnull, // obj - principal, - url.get(), // url - 1, // line no - nsnull, - nsnull, - nsnull); - - if (NS_FAILED(rv)) - return NS_ERROR_FAILURE; - - return S_OK; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE toString( - /* [out][retval] */ BSTR __RPC_FAR *String) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE scrollBy( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE scrollTo( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE moveTo( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE moveBy( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE resizeTo( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE resizeBy( - /* [in] */ long x, - /* [in] */ long y) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_external( - /* [out][retval] */ IDispatch __RPC_FAR *__RPC_FAR *p) - { - return E_NOTIMPL; - } - -}; - - -// Note: Corresponds to the document object in the IE DOM -class IEDocument : - public CComObjectRootEx, - public IDispatchImpl, - public IServiceProvider, - public IOleContainer, - public IBindHost, - public IHlinkFrame, - public ITargetFrame -{ -public: - PluginInstanceData *mData; - - nsCOMPtr mDOMWindow; - nsCOMPtr mDOMDocument; - nsCOMPtr mDOMElement; - CComObject *mWindow; - CComObject *mBrowser; - CComBSTR mURL; - BSTR mUseTarget; - - IEDocument() : - mWindow(NULL), - mBrowser(NULL), - mData(NULL), - mUseTarget(NULL) - { - MozAxPlugin::AddRef(); - } - - HRESULT Init(PluginInstanceData *pData) - { - mData = pData; - - // Get the DOM document - NPN_GetValue(mData->pPluginInstance, NPNVDOMElement, - static_cast(getter_AddRefs(mDOMElement))); - if (mDOMElement) - { - mDOMElement->GetOwnerDocument(getter_AddRefs(mDOMDocument)); - } - - // Get the DOM window - NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(mDOMWindow))); - if (mDOMWindow) - { - nsCOMPtr windowInternal = do_QueryInterface(mDOMWindow); - if (windowInternal) - { - nsCOMPtr location; - nsAutoString href; - windowInternal->GetLocation(getter_AddRefs(location)); - if (location && - NS_SUCCEEDED(location->GetHref(href))) - { - const PRUnichar *s = href.get(); - mURL.Attach(::SysAllocString(s)); - } - } - } - - CComObject::CreateInstance(&mWindow); - ATLASSERT(mWindow); - if (!mWindow) - { - return E_OUTOFMEMORY; - } - mWindow->AddRef(); - mWindow->Init(mData); - - CComObject::CreateInstance(&mBrowser); - ATLASSERT(mBrowser); - if (!mBrowser) - { - return E_OUTOFMEMORY; - } - mBrowser->AddRef(); - mBrowser->Init(mData); - - return S_OK; - } - - virtual ~IEDocument() - { - if (mUseTarget) - { - SysFreeString(mUseTarget); - } - if (mBrowser) - { - mBrowser->Release(); - } - if (mWindow) - { - mWindow->Release(); - } - MozAxPlugin::Release(); - } - -BEGIN_COM_MAP(IEDocument) - COM_INTERFACE_ENTRY(IServiceProvider) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IHTMLDocument) - COM_INTERFACE_ENTRY(IHTMLDocument2) - COM_INTERFACE_ENTRY(IParseDisplayName) - COM_INTERFACE_ENTRY(IOleContainer) - COM_INTERFACE_ENTRY(IBindHost) - COM_INTERFACE_ENTRY_BREAK(IHlinkTarget) - COM_INTERFACE_ENTRY(IHlinkFrame) - COM_INTERFACE_ENTRY(ITargetFrame) -END_COM_MAP() - -// IServiceProvider - virtual /* [local] */ HRESULT STDMETHODCALLTYPE QueryService( - /* [in] */ REFGUID guidService, - /* [in] */ REFIID riid, - /* [out] */ void **ppvObject) - { -#ifdef DEBUG - ATLTRACE(_T("IEDocument::QueryService\n")); - if (IsEqualIID(riid, __uuidof(IWebBrowser)) || - IsEqualIID(riid, __uuidof(IWebBrowser2)) || - IsEqualIID(riid, __uuidof(IWebBrowserApp))) - { - ATLTRACE(_T(" IWebBrowserApp\n")); - if (mBrowser) - { - return mBrowser->QueryInterface(riid, ppvObject); - } - } - else if (IsEqualIID(riid, __uuidof(IHTMLWindow2))) - { - ATLTRACE(_T(" IHTMLWindow2\n")); - if (mWindow) - { - return mWindow->QueryInterface(riid, ppvObject); - } - } - else if (IsEqualIID(riid, __uuidof(IHTMLDocument2))) - { - ATLTRACE(_T(" IHTMLDocument2\n")); - } - else if (IsEqualIID(riid, __uuidof(IBindHost))) - { - ATLTRACE(_T(" IBindHost\n")); - } - else - { - USES_CONVERSION; - LPOLESTR szClsid = NULL; - StringFromIID(riid, &szClsid); - ATLTRACE(_T(" Unknown interface %s\n"), OLE2T(szClsid)); - CoTaskMemFree(szClsid); - } -#endif - return QueryInterface(riid, ppvObject); - } - -// IHTMLDocument - virtual /* [nonbrowsable][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_Script( - /* [out][retval] */ IDispatch **p) - { - *p = NULL; - return S_OK; - } - -// IHTMLDocument2 - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_all( - /* [out][retval] */ IHTMLElementCollection **p) - { - // Validate parameters - if (p == NULL) - { - return E_INVALIDARG; - } - - *p = NULL; - - // Create a collection object - CIEHtmlElementCollectionInstance *pCollection = NULL; - CIEHtmlElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - return E_OUTOFMEMORY; - } - - // Initialise and populate the collection - nsCOMPtr docNode = do_QueryInterface(mDOMDocument); - pCollection->PopulateFromDOMNode(docNode, PR_TRUE); - pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p); - - return *p ? S_OK : E_UNEXPECTED; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_body( - /* [out][retval] */ IHTMLElement **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_activeElement( - /* [out][retval] */ IHTMLElement **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_images( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_applets( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_links( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_forms( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_anchors( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_title( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_title( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_scripts( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_designMode( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_designMode( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_selection( - /* [out][retval] */ IHTMLSelectionObject **p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_frames( - /* [out][retval] */ IHTMLFramesCollection2 **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_embeds( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_plugins( - /* [out][retval] */ IHTMLElementCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_alinkColor( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_alinkColor( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bgColor( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bgColor( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_fgColor( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_fgColor( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_linkColor( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_linkColor( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_vlinkColor( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_vlinkColor( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_referrer( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_location( - /* [out][retval] */ IHTMLLocation **p) - { - if (mWindow) - return mWindow->get_location(p); - return E_FAIL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_lastModified( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_URL( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_URL( - /* [out][retval] */ BSTR *p) - { - *p = mURL.Copy(); - return S_OK; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_domain( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_domain( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_cookie( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_cookie( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [hidden][bindable][id][propput] */ HRESULT STDMETHODCALLTYPE put_expando( - /* [in] */ VARIANT_BOOL v) - { - return E_NOTIMPL; - } - - virtual /* [hidden][bindable][id][propget] */ HRESULT STDMETHODCALLTYPE get_expando( - /* [out][retval] */ VARIANT_BOOL *p) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propput] */ HRESULT STDMETHODCALLTYPE put_charset( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_charset( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_defaultCharset( - /* [in] */ BSTR v) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_defaultCharset( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_mimeType( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_fileSize( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_fileCreatedDate( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_fileModifiedDate( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_fileUpdatedDate( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_security( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_protocol( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nameProp( - /* [out][retval] */ BSTR *p) - { - return E_NOTIMPL; - } - - virtual /* [id][vararg] */ HRESULT STDMETHODCALLTYPE write( - /* [in] */ SAFEARRAY * psarray) - { - return E_NOTIMPL; - } - - virtual /* [id][vararg] */ HRESULT STDMETHODCALLTYPE writeln( - /* [in] */ SAFEARRAY * psarray) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE open( - /* [in][defaultvalue] */ BSTR url, - /* [in][optional] */ VARIANT name, - /* [in][optional] */ VARIANT features, - /* [in][optional] */ VARIANT replace, - /* [out][retval] */ IDispatch **pomWindowResult) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE close( void) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE clear( void) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandSupported( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandEnabled( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandState( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandIndeterm( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandText( - /* [in] */ BSTR cmdID, - /* [out][retval] */ BSTR *pcmdText) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE queryCommandValue( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT *pcmdValue) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE execCommand( - /* [in] */ BSTR cmdID, - /* [in][defaultvalue] */ VARIANT_BOOL showUI, - /* [in][optional] */ VARIANT value, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE execCommandShowHelp( - /* [in] */ BSTR cmdID, - /* [out][retval] */ VARIANT_BOOL *pfRet) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE createElement( - /* [in] */ BSTR eTag, - /* [out][retval] */ IHTMLElement **newElem) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onhelp( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onhelp( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onclick( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onclick( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_ondblclick( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_ondblclick( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onkeyup( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onkeyup( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onkeydown( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onkeydown( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onkeypress( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onkeypress( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onmouseup( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onmouseup( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onmousedown( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onmousedown( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onmousemove( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onmousemove( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onmouseout( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onmouseout( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onmouseover( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onmouseover( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onreadystatechange( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onreadystatechange( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onafterupdate( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onafterupdate( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onrowexit( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onrowexit( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onrowenter( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onrowenter( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_ondragstart( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_ondragstart( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onselectstart( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onselectstart( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE elementFromPoint( - /* [in] */ long x, - /* [in] */ long y, - /* [out][retval] */ IHTMLElement **elementHit) - { - return E_NOTIMPL; - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_parentWindow( - /* [out][retval] */ IHTMLWindow2 **p) - { - return mWindow->QueryInterface(_uuidof(IHTMLWindow2), (void **) p); - } - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_styleSheets( - /* [out][retval] */ IHTMLStyleSheetsCollection **p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onbeforeupdate( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onbeforeupdate( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propput] */ HRESULT STDMETHODCALLTYPE put_onerrorupdate( - /* [in] */ VARIANT v) - { - return E_NOTIMPL; - } - - virtual /* [bindable][displaybind][id][propget] */ HRESULT STDMETHODCALLTYPE get_onerrorupdate( - /* [out][retval] */ VARIANT *p) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE toString( - /* [out][retval] */ BSTR *String) - { - return E_NOTIMPL; - } - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE createStyleSheet( - /* [in][defaultvalue] */ BSTR bstrHref, - /* [in][defaultvalue] */ long lIndex, - /* [out][retval] */ IHTMLStyleSheet **ppnewStyleSheet) - { - return E_NOTIMPL; - } - -// IParseDisplayName - virtual HRESULT STDMETHODCALLTYPE ParseDisplayName( - /* [unique][in] */ IBindCtx *pbc, - /* [in] */ LPOLESTR pszDisplayName, - /* [out] */ ULONG *pchEaten, - /* [out] */ IMoniker **ppmkOut) - { - return E_NOTIMPL; - } - -// IOleContainer - virtual HRESULT STDMETHODCALLTYPE EnumObjects( - /* [in] */ DWORD grfFlags, - /* [out] */ IEnumUnknown **ppenum) - { - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE LockContainer( - /* [in] */ BOOL fLock) - { - return E_NOTIMPL; - } - - -// IHlinkFrame - virtual HRESULT STDMETHODCALLTYPE SetBrowseContext( - /* [unique][in] */ IHlinkBrowseContext *pihlbc) - { - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetBrowseContext( - /* [out] */ IHlinkBrowseContext **ppihlbc) - { - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE Navigate( - /* [in] */ DWORD grfHLNF, - /* [unique][in] */ LPBC pbc, - /* [unique][in] */ IBindStatusCallback *pibsc, - /* [unique][in] */ IHlink *pihlNavigate) - { - if (!pihlNavigate) return E_INVALIDARG; - // TODO check grfHLNF for type of link - LPWSTR szTarget = NULL; - LPWSTR szLocation = NULL; - LPWSTR szTargetFrame = NULL; - HRESULT hr; - hr = pihlNavigate->GetStringReference(HLINKGETREF_DEFAULT, &szTarget, &szLocation); - hr = pihlNavigate->GetTargetFrameName(&szTargetFrame); - if (szTarget && szTarget[0] != WCHAR('\0')) - { - NS_ConvertUTF16toUTF8 spec(szTarget); - nsCOMPtr uri; - nsresult rv = NS_NewURI(getter_AddRefs(uri), spec); - if (NS_SUCCEEDED(rv) && uri) - { - nsCOMPtr webNav = do_GetInterface(mDOMWindow); - if (webNav) - { - nsCOMPtr lh = do_QueryInterface(webNav); - if (lh) - { - nsCOMPtr window = - do_GetInterface(mDOMWindow); - - nsAutoPopupStatePusher popupStatePusher(window, - openAllowed); - - nsCOMPtr content(do_QueryInterface(mDOMElement)); - - // XXX Not checking whether content is editable, - // should we? - lh->OnLinkClick(content, uri, - szTargetFrame ? szTargetFrame : mUseTarget); - } - } - hr = S_OK; - } - else - { - hr = E_FAIL; - } - } - else - { - hr = E_FAIL; - } - if (szTarget) - CoTaskMemFree(szTarget); - if (szLocation) - CoTaskMemFree(szLocation); - if (szTargetFrame) - CoTaskMemFree(szTargetFrame); - if (mUseTarget) - { - SysFreeString(mUseTarget); - mUseTarget = NULL; - } - return hr; - } - - virtual HRESULT STDMETHODCALLTYPE OnNavigate( - /* [in] */ DWORD grfHLNF, - /* [unique][in] */ IMoniker *pimkTarget, - /* [unique][in] */ LPCWSTR pwzLocation, - /* [unique][in] */ LPCWSTR pwzFriendlyName, - /* [in] */ DWORD dwreserved) - { - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE UpdateHlink( - /* [in] */ ULONG uHLID, - /* [unique][in] */ IMoniker *pimkTarget, - /* [unique][in] */ LPCWSTR pwzLocation, - /* [unique][in] */ LPCWSTR pwzFriendlyName) - { - return E_NOTIMPL; - } - -// IBindHost - virtual HRESULT STDMETHODCALLTYPE CreateMoniker( - /* [in] */ LPOLESTR szName, - /* [in] */ IBindCtx *pBC, - /* [out] */ IMoniker **ppmk, - /* [in] */ DWORD dwReserved) - { - if (!szName || !ppmk) return E_POINTER; - if (!*szName) return E_INVALIDARG; - - *ppmk = NULL; - - // Get the BASE url - CComPtr baseURLMoniker; - nsCOMPtr doc(do_QueryInterface(mDOMDocument)); - if (doc) - { - nsIURI *baseURI = doc->GetBaseURI(); - nsCAutoString spec; - if (baseURI && - NS_SUCCEEDED(baseURI->GetSpec(spec))) - { - USES_CONVERSION; - if (FAILED(CreateURLMoniker(NULL, A2CW(spec.get()), &baseURLMoniker))) - return E_UNEXPECTED; - } - } - - // Make the moniker - HRESULT hr = CreateURLMoniker(baseURLMoniker, szName, ppmk); - if (SUCCEEDED(hr) && !*ppmk) - hr = E_FAIL; - return hr; - } - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE MonikerBindToStorage( - /* [in] */ IMoniker *pMk, - /* [in] */ IBindCtx *pBC, - /* [in] */ IBindStatusCallback *pBSC, - /* [in] */ REFIID riid, - /* [out] */ void **ppvObj) - { - if (!pMk || !ppvObj) return E_POINTER; - - *ppvObj = NULL; - HRESULT hr = S_OK; - CComPtr spBindCtx; - if (pBC) - { - spBindCtx = pBC; - if (pBSC) - { - hr = RegisterBindStatusCallback(spBindCtx, pBSC, NULL, 0); - if (FAILED(hr)) - return hr; - } - } - else - { - if (pBSC) - hr = CreateAsyncBindCtx(0, pBSC, NULL, &spBindCtx); - else - hr = CreateBindCtx(0, &spBindCtx); - if (SUCCEEDED(hr) && !spBindCtx) - hr = E_FAIL; - if (FAILED(hr)) - return hr; - } - return pMk->BindToStorage(spBindCtx, NULL, riid, ppvObj); - } - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE MonikerBindToObject( - /* [in] */ IMoniker *pMk, - /* [in] */ IBindCtx *pBC, - /* [in] */ IBindStatusCallback *pBSC, - /* [in] */ REFIID riid, - /* [out] */ void **ppvObj) - { - return E_NOTIMPL; - } - -// ITargetFrame - virtual HRESULT STDMETHODCALLTYPE SetFrameName( - /* [in] */ LPCWSTR pszFrameName) - { - NS_ASSERTION(FALSE, "ITargetFrame::SetFrameName is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetFrameName( - /* [out] */ LPWSTR *ppszFrameName) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetFrameName is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetParentFrame( - /* [out] */ IUnknown **ppunkParent) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetParentFrame is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE FindFrame( - /* [in] */ LPCWSTR pszTargetName, - /* [in] */ IUnknown *ppunkContextFrame, - /* [in] */ DWORD dwFlags, - /* [out] */ IUnknown **ppunkTargetFrame) - { - if (dwFlags & 0x1) // TODO test if the named frame exists and presumably return NULL if it doesn't - { - } - - if (mUseTarget) - { - SysFreeString(mUseTarget); - mUseTarget = NULL; - } - if (pszTargetName) - { - mUseTarget = SysAllocString(pszTargetName); - } - - QueryInterface(__uuidof(IUnknown), (void **) ppunkTargetFrame); - return S_OK;; - } - - virtual HRESULT STDMETHODCALLTYPE SetFrameSrc( - /* [in] */ LPCWSTR pszFrameSrc) - { - NS_ASSERTION(FALSE, "ITargetFrame::SetFrameSrc is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetFrameSrc( - /* [out] */ LPWSTR *ppszFrameSrc) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetFrameSrc is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetFramesContainer( - /* [out] */ IOleContainer **ppContainer) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetFramesContainer is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE SetFrameOptions( - /* [in] */ DWORD dwFlags) - { - NS_ASSERTION(FALSE, "ITargetFrame::SetFrameOptions is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetFrameOptions( - /* [out] */ DWORD *pdwFlags) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetFrameOptions is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE SetFrameMargins( - /* [in] */ DWORD dwWidth, - /* [in] */ DWORD dwHeight) - { - NS_ASSERTION(FALSE, "ITargetFrame::SetFrameMargins is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE GetFrameMargins( - /* [out] */ DWORD *pdwWidth, - /* [out] */ DWORD *pdwHeight) - { - NS_ASSERTION(FALSE, "ITargetFrame::GetFrameMargins is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE RemoteNavigate( - /* [in] */ ULONG cLength, - /* [size_is][in] */ ULONG *pulData) - { - NS_ASSERTION(FALSE, "ITargetFrame::RemoteNavigate is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE OnChildFrameActivate( - /* [in] */ IUnknown *pUnkChildFrame) - { - NS_ASSERTION(FALSE, "ITargetFrame::OnChildFrameActivate is not implemented"); - return E_NOTIMPL; - } - - virtual HRESULT STDMETHODCALLTYPE OnChildFrameDeactivate( - /* [in] */ IUnknown *pUnkChildFrame) - { - NS_ASSERTION(FALSE, "ITargetFrame::OnChildFrameDeactivate is not implemented"); - return E_NOTIMPL; - } -}; - -HRESULT MozAxPlugin::GetServiceProvider(PluginInstanceData *pData, IServiceProvider **pSP) -{ - // Note this should be called on the main NPAPI thread - CComObject *pDoc = NULL; - CComObject::CreateInstance(&pDoc); - ATLASSERT(pDoc); - if (!pDoc) - { - return E_OUTOFMEMORY; - } - pDoc->Init(pData); - // QI does the AddRef - return pDoc->QueryInterface(_uuidof(IServiceProvider), (void **) pSP); -} diff --git a/embedding/browser/activex/src/plugin/XPConnect.cpp b/embedding/browser/activex/src/plugin/XPConnect.cpp deleted file mode 100644 index 9bf27c3312e..00000000000 --- a/embedding/browser/activex/src/plugin/XPConnect.cpp +++ /dev/null @@ -1,1134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#ifdef XPCOM_GLUE -#include "nsXPCOMGlue.h" -#endif - -#include "nsCOMPtr.h" -#include "nsIComponentManager.h" -#include "nsComponentManagerUtils.h" -#include "nsServiceManagerUtils.h" - -#include "nsIMozAxPlugin.h" -#include "nsIVariant.h" -#include "nsMemory.h" - -#include "nsIDOMDocument.h" -#include "nsIDOMNode.h" -#include "nsIDOMNodeList.h" -#include "nsIDOMElement.h" -#include "nsIDOMEventTarget.h" -#include "nsIDOMWindow.h" - -#include "nsIInterfaceRequestorUtils.h" -#include "nsIEventListenerManager.h" - -#include "nsIScriptEventManager.h" -#include "jsapi.h" - -#include "LegacyPlugin.h" -#include "XPConnect.h" - -#ifdef XPC_IDISPATCH_SUPPORT -#include "nsIDOMWindowInternal.h" -#include "nsIDOMLocation.h" -#include "nsNetUtil.h" -#ifdef XPCOM_GLUE -#include "nsEmbedString.h" -#endif -#include "nsIURI.h" -#endif - - -/////////////////////////////////////////////////////////////////////////////// -// nsScriptablePeer - -nsScriptablePeer::nsScriptablePeer() : - mTearOff(new nsScriptablePeerTearOff(this)) -{ - NS_ASSERTION(mTearOff, "can't create tearoff"); - MozAxPlugin::AddRef(); -} - -nsScriptablePeer::~nsScriptablePeer() -{ - delete mTearOff; - MozAxPlugin::Release(); -} - -NS_IMPL_ADDREF(nsScriptablePeer) -NS_IMPL_RELEASE(nsScriptablePeer) - -// Custom QueryInterface impl to deal with the IDispatch tearoff -NS_IMETHODIMP -nsScriptablePeer::QueryInterface(const nsIID & aIID, void **aInstancePtr) -{ - NS_ASSERTION(aInstancePtr, "QueryInterface requires a non-NULL destination!"); - if (!aInstancePtr) - return NS_ERROR_NULL_POINTER; - *aInstancePtr = nsnull; - - nsISupports* foundInterface = nsnull; - if (aIID.Equals(NS_GET_IID(nsISupports))) - foundInterface = static_cast(static_cast(this)); - else if (aIID.Equals(NS_GET_IID(nsIClassInfo))) - foundInterface = static_cast(this); - else if (aIID.Equals(NS_GET_IID(nsIMozAxPlugin))) - foundInterface = static_cast(this); - else if (memcmp(&aIID, &__uuidof(IDispatch), sizeof(nsID)) == 0) - { - HRESULT hr = mTearOff->QueryInterface(__uuidof(IDispatch), aInstancePtr); - if (SUCCEEDED(hr)) return NS_OK; - return E_FAIL; - } - - NS_IF_ADDREF(foundInterface); - *aInstancePtr = foundInterface; - return (*aInstancePtr) ? NS_OK : NS_NOINTERFACE; -} - -HRESULT -nsScriptablePeer::GetIDispatch(IDispatch **pdisp) -{ - if (pdisp == NULL) - { - return E_INVALIDARG; - } - *pdisp = NULL; - - IUnknownPtr unk; - HRESULT hr = mPlugin->pControlSite->GetControlUnknown(&unk); - if (unk.GetInterfacePtr() == NULL) - { - return E_FAIL; - } - - IDispatchPtr disp = unk; - if (disp.GetInterfacePtr() == NULL) - { - return E_FAIL; - } - - *pdisp = disp.GetInterfacePtr(); - (*pdisp)->AddRef(); - - return S_OK; -} - -nsresult -nsScriptablePeer::HR2NS(HRESULT hr) const -{ - switch (hr) - { - case S_OK: - return NS_OK; - case E_NOTIMPL: - return NS_ERROR_NOT_IMPLEMENTED; - case E_NOINTERFACE: - return NS_ERROR_NO_INTERFACE; - case E_INVALIDARG: - return NS_ERROR_INVALID_ARG; - case E_ABORT: - return NS_ERROR_ABORT; - case E_UNEXPECTED: - return NS_ERROR_UNEXPECTED; - case E_OUTOFMEMORY: - return NS_ERROR_OUT_OF_MEMORY; - case E_POINTER: - return NS_ERROR_INVALID_POINTER; - case E_FAIL: - default: - return NS_ERROR_FAILURE; - } -} - -HRESULT -nsScriptablePeer::ConvertVariants(nsIVariant *aIn, VARIANT *aOut) -{ - if (aIn == NULL || aOut == NULL) - { - return NS_ERROR_INVALID_ARG; - } - - PRBool isWritable = PR_FALSE; - nsCOMPtr writable = do_QueryInterface(aIn); - if (writable) - { - writable->GetWritable(&isWritable); - } - - PRUint16 type; - nsresult rv = aIn->GetDataType(&type); - switch (type) - { - case nsIDataType::VTYPE_INT8: - { - PRUint8 value = 0; - rv = aIn->GetAsInt8(&value); - aOut->vt = VT_I1; - aOut->cVal = value; - } - break; - case nsIDataType::VTYPE_INT16: - { - PRInt16 value = 0; - rv = aIn->GetAsInt16(&value); - aOut->vt = VT_I2; - aOut->iVal = value; - } - break; - case nsIDataType::VTYPE_INT32: - { - PRInt32 value = 0; - rv = aIn->GetAsInt32(&value); - aOut->vt = VT_I4; - aOut->lVal = value; - } - break; - case nsIDataType::VTYPE_CHAR: - case nsIDataType::VTYPE_UINT8: - { - PRUint8 value = 0; - rv = aIn->GetAsInt8(&value); - aOut->vt = VT_UI1; - aOut->bVal = value; - } - break; - case nsIDataType::VTYPE_WCHAR: - case nsIDataType::VTYPE_UINT16: - { - PRUint16 value = 0; - rv = aIn->GetAsUint16(&value); - aOut->vt = VT_I2; - aOut->uiVal = value; - } - break; - case nsIDataType::VTYPE_UINT32: - { - PRUint32 value = 0; - rv = aIn->GetAsUint32(&value); - aOut->vt = VT_I4; - aOut->ulVal = value; - } - break; - case nsIDataType::VTYPE_FLOAT: - { - float value = 0; - rv = aIn->GetAsFloat(&value); - aOut->vt = VT_R4; - aOut->fltVal = value; - } - break; - case nsIDataType::VTYPE_DOUBLE: - { - double value = 0; - rv = aIn->GetAsDouble(&value); - aOut->vt = VT_R4; - aOut->dblVal = value; - } - break; - case nsIDataType::VTYPE_BOOL: - { - PRBool value = 0; - rv = aIn->GetAsBool(&value); - aOut->vt = VT_BOOL; - aOut->dblVal = value ? VARIANT_TRUE : VARIANT_FALSE; - } - break; - case nsIDataType::VTYPE_EMPTY: - VariantClear(aOut); - break; - - case nsIDataType::VTYPE_STRING_SIZE_IS: - case nsIDataType::VTYPE_CHAR_STR: - { - nsCString value; - aIn->GetAsString(getter_Copies(value)); - nsString valueWide; - NS_CStringToUTF16(value, NS_CSTRING_ENCODING_ASCII, valueWide); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(valueWide.get()); - } - break; - case nsIDataType::VTYPE_WSTRING_SIZE_IS: - case nsIDataType::VTYPE_WCHAR_STR: - { - nsString value; - aIn->GetAsWString(getter_Copies(value)); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(value.get()); - } - break; - - case nsIDataType::VTYPE_ASTRING: - { - nsAutoString value; - aIn->GetAsAString(value); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(value.get()); - } - break; - - case nsIDataType::VTYPE_DOMSTRING: - { - nsAutoString value; - aIn->GetAsAString(value); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(value.get()); - } - break; - - case nsIDataType::VTYPE_CSTRING: - { - nsCAutoString value; - aIn->GetAsACString(value); - nsAutoString valueWide; - NS_CStringToUTF16(value, NS_CSTRING_ENCODING_ASCII, valueWide); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(valueWide.get()); - } - break; - case nsIDataType::VTYPE_UTF8STRING: - { - nsCAutoString value; - aIn->GetAsAUTF8String(value); - nsAutoString valueWide; - CopyUTF8toUTF16(value, valueWide); - aOut->vt = VT_BSTR; - aOut->bstrVal = SysAllocString(valueWide.get()); - } - - // Unsupported types - default: - case nsIDataType::VTYPE_INT64: - case nsIDataType::VTYPE_UINT64: - case nsIDataType::VTYPE_VOID: - case nsIDataType::VTYPE_ID: - case nsIDataType::VTYPE_INTERFACE: - case nsIDataType::VTYPE_INTERFACE_IS: - case nsIDataType::VTYPE_ARRAY: - case nsIDataType::VTYPE_EMPTY_ARRAY: - return E_INVALIDARG; - } - - return S_OK; -} - - -HRESULT -nsScriptablePeer::ConvertVariants(VARIANT *aIn, nsIVariant **aOut) -{ - if (aIn == NULL || aOut == NULL) - { - return NS_ERROR_INVALID_ARG; - } - - *aOut = nsnull; - - nsresult rv; - nsCOMPtr v = do_CreateInstance("@mozilla.org/variant;1", &rv); - - // NOTE: THIS IS AN UGLY BACKWARDS COMPATIBILITY HACK TO WORKAROUND - // XPCOM GLUE'S INABILITY TO FIND A CERTAIN ENTRY POINT IN MOZ1.0.x/NS7.0! - // DO NOT TAUNT THE HACK - if (NS_FAILED(rv)) - { - // do_CreateInstance macro is broken so load the component manager by - // hand and get it to create the component. - HMODULE hlib = ::LoadLibraryW(L"xpcom.dll"); - if (hlib) - { - nsIComponentManager *pManager = nsnull; // A frozen interface, even in 1.0.x - typedef nsresult (*Moz1XGetComponentManagerFunc)(nsIComponentManager* *result); - Moz1XGetComponentManagerFunc compMgr = (Moz1XGetComponentManagerFunc) - ::GetProcAddress(hlib, "NS_GetComponentManager"); - if (compMgr) - { - compMgr(&pManager); - if (pManager) - { - rv = pManager->CreateInstanceByContractID("@mozilla.org/variant;1", - nsnull, NS_GET_IID(nsIWritableVariant), - getter_AddRefs(v)); - pManager->Release(); - } - } - ::FreeLibrary(hlib); - } - } - // END HACK - NS_ENSURE_SUCCESS(rv, rv); - - switch (aIn->vt) - { - case VT_EMPTY: - v->SetAsEmpty(); - break; - case VT_BSTR: - v->SetAsWString(aIn->bstrVal); - break; - case VT_I1: - v->SetAsInt8(aIn->cVal); - break; - case VT_I2: - v->SetAsInt16(aIn->iVal); - break; - case VT_I4: - v->SetAsInt32(aIn->lVal); - break; - case VT_UI1: - v->SetAsUint8(aIn->bVal); - break; - case VT_UI2: - v->SetAsUint16(aIn->uiVal); - break; - case VT_UI4: - v->SetAsUint32(aIn->ulVal); - break; - case VT_BOOL: - v->SetAsBool(aIn->boolVal == VARIANT_TRUE ? PR_TRUE : PR_FALSE); - break; - case VT_R4: - v->SetAsFloat(aIn->fltVal); - break; - case VT_R8: - v->SetAsDouble(aIn->dblVal); - break; - } - - *aOut = v; - NS_ADDREF(*aOut); - - return NS_OK; -} - -NS_IMETHODIMP -nsScriptablePeer::InternalInvoke(const char *aMethod, unsigned int aNumArgs, nsIVariant *aArgs[]) -{ - HRESULT hr; - DISPID dispid; - - IDispatchPtr disp; - if (FAILED(GetIDispatch(&disp))) - { - return NPERR_GENERIC_ERROR; - } - - USES_CONVERSION; - OLECHAR* szMember = A2OLE(aMethod); - hr = disp->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispid); - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - _variant_t *pArgs = NULL; - if (aNumArgs > 0) - { - pArgs = new _variant_t[aNumArgs]; - if (pArgs == NULL) - { - return NS_ERROR_OUT_OF_MEMORY; - } - for (unsigned int i = 0; i < aNumArgs; i++) - { - hr = ConvertVariants(aArgs[i], &pArgs[i]); - if (FAILED(hr)) - { - delete []pArgs; - return NS_ERROR_INVALID_ARG; - } - } - } - - DISPPARAMS dispparams = {NULL, NULL, 0, 0}; - _variant_t vResult; - - dispparams.cArgs = aNumArgs; - dispparams.rgvarg = pArgs; - - hr = disp->Invoke( - dispid, - IID_NULL, - LOCALE_USER_DEFAULT, - DISPATCH_METHOD, - &dispparams, &vResult, NULL, NULL); - - if (pArgs) - { - delete []pArgs; - } - - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// nsIMozAxPlugin - -NS_IMETHODIMP -nsScriptablePeer::Invoke(const char *aMethod) -{ - return InternalInvoke(aMethod, 0, NULL); -} - -NS_IMETHODIMP -nsScriptablePeer::Invoke1(const char *aMethod, nsIVariant *a) -{ - nsIVariant *args[1]; - args[0] = a; - return InternalInvoke(aMethod, sizeof(args) / sizeof(args[0]), args); -} - -NS_IMETHODIMP -nsScriptablePeer::Invoke2(const char *aMethod, nsIVariant *a, nsIVariant *b) -{ - nsIVariant *args[2]; - args[0] = a; - args[1] = b; - return InternalInvoke(aMethod, sizeof(args) / sizeof(args[0]), args); -} - -NS_IMETHODIMP -nsScriptablePeer::Invoke3(const char *aMethod, nsIVariant *a, nsIVariant *b, nsIVariant *c) -{ - nsIVariant *args[3]; - args[0] = a; - args[1] = b; - args[2] = c; - return InternalInvoke(aMethod, sizeof(args) / sizeof(args[0]), args); -} - -NS_IMETHODIMP -nsScriptablePeer::Invoke4(const char *aMethod, nsIVariant *a, nsIVariant *b, nsIVariant *c, nsIVariant *d) -{ - nsIVariant *args[4]; - args[0] = a; - args[1] = b; - args[2] = c; - args[3] = d; - return InternalInvoke(aMethod, sizeof(args) / sizeof(args[0]), args); -} - -NS_IMETHODIMP -nsScriptablePeer::GetProperty(const char *propertyName, nsIVariant **_retval) -{ - HRESULT hr; - DISPID dispid; - IDispatchPtr disp; - if (FAILED(GetIDispatch(&disp))) - { - return NPERR_GENERIC_ERROR; - } - USES_CONVERSION; - OLECHAR* szMember = A2OLE(propertyName); - hr = disp->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispid); - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - _variant_t vResult; - - DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; - hr = disp->Invoke( - dispid, - IID_NULL, - LOCALE_USER_DEFAULT, - DISPATCH_PROPERTYGET, - &dispparamsNoArgs, &vResult, NULL, NULL); - - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - nsCOMPtr propertyValue; - ConvertVariants(&vResult, getter_AddRefs(propertyValue)); - *_retval = propertyValue; - NS_IF_ADDREF(*_retval); - - return NS_OK; -} - -/* void setProperty (in string propertyName, in string propertyValue); */ -NS_IMETHODIMP -nsScriptablePeer::SetProperty(const char *propertyName, nsIVariant *propertyValue) -{ - HRESULT hr; - DISPID dispid; - IDispatchPtr disp; - if (FAILED(GetIDispatch(&disp))) - { - return NPERR_GENERIC_ERROR; - } - USES_CONVERSION; - OLECHAR* szMember = A2OLE(propertyName); - hr = disp->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispid); - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - _variant_t v; - ConvertVariants(propertyValue, &v); - - DISPID dispIdPut = DISPID_PROPERTYPUT; - DISPPARAMS functionArgs; - _variant_t vResult; - - functionArgs.rgdispidNamedArgs = &dispIdPut; - functionArgs.rgvarg = &v; - functionArgs.cArgs = 1; - functionArgs.cNamedArgs = 1; - - hr = disp->Invoke( - dispid, - IID_NULL, - LOCALE_USER_DEFAULT, - DISPATCH_PROPERTYPUT, - &functionArgs, &vResult, NULL, NULL); - - if (FAILED(hr)) - { - return NPERR_GENERIC_ERROR; - } - - return NS_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// - -#ifdef XPC_IDISPATCH_SUPPORT -HRESULT -nsEventSink::InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - FUNCDESC *pFuncDesc = NULL; - HRESULT hr = S_OK; - CComBSTR bstrName; - - // Must search and compare each member to the dispid... - if (m_spEventSinkTypeInfo) - { - HRESULT hr = S_OK; - TYPEATTR* pAttr; - hr = m_spEventSinkTypeInfo->GetTypeAttr(&pAttr); - if (pAttr) - { - int i; - for (i = 0; i < pAttr->cFuncs;i++) - { - hr = m_spEventSinkTypeInfo->GetFuncDesc(i, &pFuncDesc); - if (FAILED(hr)) - return hr; - if (pFuncDesc->memid == dispIdMember) - { - UINT cNames = 0; - m_spEventSinkTypeInfo->GetNames(dispIdMember, &bstrName, 1, &cNames); - break; - } - - m_spEventSinkTypeInfo->ReleaseFuncDesc(pFuncDesc); - pFuncDesc = NULL; - } - m_spEventSinkTypeInfo->ReleaseTypeAttr(pAttr); - } - } - if (!pFuncDesc) - { - // Return - return S_OK; - } - -#ifdef DEBUG - { - // Dump out some info to look at - ATLTRACE(_T("Invoke(%d)\n"), (int) dispIdMember); - - ATLTRACE(_T(" ")); - - /* Return code */ - switch (pFuncDesc->elemdescFunc.tdesc.vt) - { - case VT_HRESULT: ATLTRACE(_T("HRESULT")); break; - case VT_VOID: ATLTRACE(_T("void")); break; - default: ATLTRACE(_T("void /* vt = %d */"), pFuncDesc->elemdescFunc.tdesc.vt); break; - } - - /* Function name */ - ATLTRACE(_T(" %S("), SUCCEEDED(hr) ? bstrName.m_str : L"?unknown?"); - - /* Parameters */ - for (int i = 0; i < pFuncDesc->cParams; i++) - { - USHORT paramFlags = pFuncDesc->lprgelemdescParam[i].paramdesc.wParamFlags; - ATLTRACE("["); - BOOL addComma = FALSE; - if (paramFlags & PARAMFLAG_FIN) - { - ATLTRACE(_T("in")); addComma = TRUE; - } - if (paramFlags & PARAMFLAG_FOUT) - { - ATLTRACE(addComma ? _T(",out") : _T("out")); addComma = TRUE; - } - if (paramFlags & PARAMFLAG_FRETVAL) - { - ATLTRACE(addComma ? _T(",retval") : _T("retval")); addComma = TRUE; - } - ATLTRACE("] "); - - VARTYPE vt = pFuncDesc->lprgelemdescParam[i].tdesc.vt; - switch (vt) - { - case VT_HRESULT: ATLTRACE(_T("HRESULT")); break; - case VT_VARIANT: ATLTRACE(_T("VARIANT")); break; - case VT_I2: ATLTRACE(_T("short")); break; - case VT_I4: ATLTRACE(_T("long")); break; - case VT_R8: ATLTRACE(_T("double")); break; - case VT_BOOL: ATLTRACE(_T("VARIANT_BOOL")); break; - case VT_BSTR: ATLTRACE(_T("BSTR")); break; - case VT_DISPATCH: ATLTRACE(_T("IDispatch *")); break; - case VT_UNKNOWN: ATLTRACE(_T("IUnknown *")); break; - case VT_USERDEFINED: ATLTRACE(_T("/* Userdefined */")); break; - case VT_PTR: ATLTRACE(_T("void *")); break; - case VT_VOID: ATLTRACE(_T("void")); break; - // More could be added... - default: ATLTRACE(_T("/* vt = %d */"), vt); break; - } - if (i + 1 < pFuncDesc->cParams) - { - ATLTRACE(_T(", ")); - } - } - ATLTRACE(_T(");\n")); - } -#endif - m_spEventSinkTypeInfo->ReleaseFuncDesc(pFuncDesc); - pFuncDesc = NULL; - - nsCOMPtr element; - NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMElement, - static_cast(getter_AddRefs(element))); - if (!element) - { - NS_ERROR("can't get the object element"); - return S_OK; - } - nsAutoString id; - if (NS_FAILED(element->GetAttribute(NS_LITERAL_STRING("id"), id)) || - id.IsEmpty()) - { - // Object has no name so it can't fire events - return S_OK; - } - - nsDependentString eventName(bstrName.m_str); - - // Fire the script event handler... - nsCOMPtr window; - NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMWindow, - static_cast(getter_AddRefs(window))); - - nsCOMPtr eventManager(do_GetInterface(window)); - if (!eventManager) return S_OK; - - nsCOMPtr handler; - - eventManager->FindEventHandler(id, eventName, pDispParams->cArgs, getter_AddRefs(handler)); - if (!handler) - { - return S_OK; - } - - // Create a list of arguments to pass along - // - // This array is created on the stack if the number of arguments - // less than kMaxArgsOnStack. Otherwise, the array is heap - // allocated. - // - const int kMaxArgsOnStack = 10; - - PRUint32 argc = pDispParams->cArgs; - jsval *args = nsnull; - jsval stackArgs[kMaxArgsOnStack]; - - // Heap allocate the jsval array if it is too big to fit on - // the stack (ie. more than kMaxArgsOnStack arguments) - if (argc > kMaxArgsOnStack) - { - args = new jsval[argc]; - if (!args) return S_OK; - } - else if (argc) - { - // Use the jsval array on the stack... - args = stackArgs; - } - - if (argc) - { - nsCOMPtr disp(do_GetService("@mozilla.org/nsdispatchsupport;1")); - for (UINT i = 0; i < argc; i++) - { - // Arguments are listed backwards, intentionally, in rgvarg - disp->COMVariant2JSVal(&pDispParams->rgvarg[argc - 1 - i], &args[i]); - } - } - - // Fire the Event. - eventManager->InvokeEventHandler(handler, element, args, argc); - - // Free the jsvals if they were heap allocated... - if (args != stackArgs) - { - delete [] args; - } - - // TODO Turn js objects for out params back into VARIANTS - - // TODO Turn js return code into VARIANT - - // TODO handle js exception and fill in exception info (do we care?) - - if (pExcepInfo) - { - pExcepInfo->wCode = 0; - } - - return S_OK; -} -#endif - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// nsScriptablePeerTearOff - -nsScriptablePeerTearOff::nsScriptablePeerTearOff(nsScriptablePeer *pOwner) : - mOwner(pOwner) -{ - NS_ASSERTION(mOwner, "no owner"); -} - -HRESULT STDMETHODCALLTYPE nsScriptablePeerTearOff::QueryInterface(REFIID riid, void **ppvObject) -{ - if (::IsEqualIID(riid, _uuidof(IDispatch))) - { - *ppvObject = dynamic_cast(this); - mOwner->AddRef(); - return NS_OK; - } - nsID iid; - memcpy(&iid, &riid, sizeof(nsID)); - return mOwner->QueryInterface(iid, ppvObject); -} - -ULONG STDMETHODCALLTYPE nsScriptablePeerTearOff::AddRef() -{ - return mOwner->AddRef(); -} - -ULONG STDMETHODCALLTYPE nsScriptablePeerTearOff::Release() -{ - return mOwner->Release(); -} - -// IDispatch -HRESULT STDMETHODCALLTYPE nsScriptablePeerTearOff::GetTypeInfoCount(UINT __RPC_FAR *pctinfo) -{ - CComPtr disp; - if (FAILED(mOwner->GetIDispatch(&disp))) - { - return E_UNEXPECTED; - } - return disp->GetTypeInfoCount(pctinfo); -} - -HRESULT STDMETHODCALLTYPE nsScriptablePeerTearOff::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) -{ - CComPtr disp; - if (FAILED(mOwner->GetIDispatch(&disp))) - { - return E_UNEXPECTED; - } - return disp->GetTypeInfo(iTInfo, lcid, ppTInfo); -} - -HRESULT STDMETHODCALLTYPE nsScriptablePeerTearOff::GetIDsOfNames(REFIID riid, LPOLESTR __RPC_FAR *rgszNames, UINT cNames, LCID lcid, DISPID __RPC_FAR *rgDispId) -{ - CComPtr disp; - if (FAILED(mOwner->GetIDispatch(&disp))) - { - return E_UNEXPECTED; - } - return disp->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId); -} - -HRESULT STDMETHODCALLTYPE nsScriptablePeerTearOff::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr) -{ - CComPtr disp; - if (FAILED(mOwner->GetIDispatch(&disp))) - { - return E_UNEXPECTED; - } - return disp->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); -} - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// Some public methods - - -static PRUint32 gInstances = 0; - -void MozAxPlugin::AddRef() -{ - if (gInstances == 0) - { -#ifdef XPCOM_GLUE - XPCOMGlueStartup(nsnull); -#endif - MozAxPlugin::PrefGetHostingFlags(); // Initial call to set it up - } - gInstances++; -} - -void MozAxPlugin::Release() -{ - if (--gInstances == 0) - { -#ifdef XPC_IDISPATCH_SUPPORT - MozAxPlugin::ReleasePrefObserver(); -#endif -#ifdef XPCOM_GLUE - XPCOMGlueShutdown(); -#endif - } -} - -#ifdef XPC_IDISPATCH_SUPPORT -nsresult MozAxPlugin::GetCurrentLocation(NPP instance, nsIURI **aLocation) -{ - NS_ENSURE_ARG_POINTER(aLocation); - *aLocation = nsnull; - nsCOMPtr domWindow; - NPN_GetValue(instance, NPNVDOMWindow, (void *) &domWindow); - if (!domWindow) - { - return NS_ERROR_FAILURE; - } - nsCOMPtr windowInternal = do_QueryInterface(domWindow); - if (!windowInternal) - { - return NS_ERROR_FAILURE; - } - - nsCOMPtr location; -#ifdef XPCOM_GLUE - nsEmbedString href; -#else - nsAutoString href; -#endif - windowInternal->GetLocation(getter_AddRefs(location)); - if (!location || - NS_FAILED(location->GetHref(href))) - { - return NS_ERROR_FAILURE; - } - - return NS_NewURI(aLocation, href); -} -#endif - -CLSID MozAxPlugin::GetCLSIDForType(const char *mimeType) -{ - if (mimeType == NULL) - { - return CLSID_NULL; - } - - // Read the registry to see if there is a CLSID for an object to be associated with - // this MIME type. - USES_CONVERSION; - CRegKey keyMimeDB; - if (keyMimeDB.Open(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Content Type"), KEY_READ) == ERROR_SUCCESS) - { - CRegKey keyMimeType; - if (keyMimeType.Open(keyMimeDB, A2CT(mimeType), KEY_READ) == ERROR_SUCCESS) - { - USES_CONVERSION; - TCHAR szGUID[64]; - ULONG nCount = (sizeof(szGUID) / sizeof(szGUID[0])) - 1; - - GUID guidValue = GUID_NULL; - if (keyMimeType.QueryValue(szGUID, _T("CLSID"), &nCount) == ERROR_SUCCESS && - SUCCEEDED(::CLSIDFromString(T2OLE(szGUID), &guidValue))) - { - return guidValue; - } - } - } - return CLSID_NULL; -} - - -nsScriptablePeer * -MozAxPlugin::GetPeerForCLSID(const CLSID &clsid) -{ - return new nsScriptablePeer(); -} - -void -MozAxPlugin::GetIIDForCLSID(const CLSID &clsid, nsIID &iid) -{ -#ifdef XPC_IDISPATCH_SUPPORT - memcpy(&iid, &__uuidof(IDispatch), sizeof(iid)); -#else - iid = NS_GET_IID(nsIMozAxPlugin); -#endif -} - -// Called by NPP_GetValue to provide the scripting values -NPError -MozAxPlugin::GetValue(NPP instance, NPPVariable variable, void *value) -{ - if (instance == NULL) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - PluginInstanceData *pData = (PluginInstanceData *) instance->pdata; - if (!pData || - !pData->pControlSite || - !pData->pControlSite->IsObjectValid()) - { - return NPERR_GENERIC_ERROR; - } - - // Test if the object is allowed to be scripted - -#ifdef XPC_IDISPATCH_SUPPORT - PRUint32 hostingFlags = MozAxPlugin::PrefGetHostingFlags(); - if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS && - !(hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_ALL_OBJECTS)) - { - // Ensure the object is safe for scripting on the specified interface - nsCOMPtr dispSupport = do_GetService(NS_IDISPATCH_SUPPORT_CONTRACTID); - if (!dispSupport) return NPERR_GENERIC_ERROR; - - PRBool isScriptable = PR_FALSE; - - // Test if the object says its safe for scripting on IDispatch - nsIID iid; - memcpy(&iid, &__uuidof(IDispatch), sizeof(iid)); - CComPtr controlUnk; - pData->pControlSite->GetControlUnknown(&controlUnk); - dispSupport->IsObjectSafeForScripting(reinterpret_cast(controlUnk.p), iid, &isScriptable); - - // Test if the class id says safe for scripting - if (!isScriptable) - { - PRBool classExists = PR_FALSE; - nsCID cid; - memcpy(&cid, &pData->clsid, sizeof(cid)); - dispSupport->IsClassMarkedSafeForScripting(cid, &classExists, &isScriptable); - } - if (!isScriptable) - { - return NPERR_GENERIC_ERROR; - } - } - else if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_ALL_OBJECTS) - { - // Drop through since all objects are scriptable - } - else - { - return NPERR_GENERIC_ERROR; - } -#else - // Object *must* be safe - if (!pData->pControlSite->IsObjectSafeForScripting(__uuidof(IDispatch))) - { - return NPERR_GENERIC_ERROR; - } -#endif - - // Happy happy fun fun - redefine some NPPVariable values that we might - // be asked for but not defined by every PluginSDK - - const int kVarScriptableInstance = 10; // NPPVpluginScriptableInstance - const int kVarScriptableIID = 11; // NPPVpluginScriptableIID - - if (variable == kVarScriptableInstance) - { - if (!pData->pScriptingPeer) - { - nsScriptablePeer *peer = MozAxPlugin::GetPeerForCLSID(pData->clsid); - if (peer) - { - peer->AddRef(); - pData->pScriptingPeer = (nsIMozAxPlugin *) peer; - peer->mPlugin = pData; - } - } - if (pData->pScriptingPeer) - { - pData->pScriptingPeer->AddRef(); - *((nsISupports **) value)= pData->pScriptingPeer; - return NPERR_NO_ERROR; - } - } - else if (variable == kVarScriptableIID) - { - nsIID *piid = (nsIID *) NPN_MemAlloc(sizeof(nsIID)); - GetIIDForCLSID(pData->clsid, *piid); - *((nsIID **) value) = piid; - return NPERR_NO_ERROR; - } - return NPERR_GENERIC_ERROR; -} diff --git a/embedding/browser/activex/src/plugin/XPConnect.h b/embedding/browser/activex/src/plugin/XPConnect.h deleted file mode 100644 index 9d04c828c69..00000000000 --- a/embedding/browser/activex/src/plugin/XPConnect.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * Paul Oswald - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef XPCONNECT_H -#define XPCONNECT_H - -#include - -#ifdef XPC_IDISPATCH_SUPPORT -#include "nsIDispatchSupport.h" -#include "nsIActiveXSecurityPolicy.h" -#endif - -#include "nsID.h" -#include "nsCOMPtr.h" -#include "nsIClassInfo.h" -#include "nsIProgrammingLanguage.h" -#include "nsIMozAxPlugin.h" -#include "nsServiceManagerUtils.h" -#include "nsIURI.h" - -#include "ControlEventSink.h" - -struct PluginInstanceData; - -template class nsIClassInfoImpl : public nsIClassInfo -{ - NS_IMETHODIMP GetFlags(PRUint32 *aFlags) - { - *aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT; - return NS_OK; - } - NS_IMETHODIMP GetImplementationLanguage(PRUint32 *aImplementationLanguage) - { - *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS; - return NS_OK; - } - // The rest of the methods can safely return error codes... - NS_IMETHODIMP GetInterfaces(PRUint32 *count, nsIID * **array) - { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHODIMP GetHelperForLanguage(PRUint32 language, nsISupports **_retval) - { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHODIMP GetContractID(char * *aContractID) - { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHODIMP GetClassDescription(char * *aClassDescription) - { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHODIMP GetClassID(nsCID * *aClassID) - { return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHODIMP GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) - { return NS_ERROR_NOT_IMPLEMENTED; } -}; - -class nsScriptablePeerTearOff; - -class nsScriptablePeer : - public nsIClassInfoImpl, - public nsIMozAxPlugin -{ - friend nsScriptablePeerTearOff; -protected: - virtual ~nsScriptablePeer(); - -public: - nsScriptablePeer(); - - nsScriptablePeerTearOff *mTearOff; - PluginInstanceData* mPlugin; - - NS_DECL_ISUPPORTS - NS_DECL_NSIMOZAXPLUGIN - -protected: - HRESULT GetIDispatch(IDispatch **pdisp); - HRESULT ConvertVariants(nsIVariant *aIn, VARIANT *aOut); - HRESULT ConvertVariants(VARIANT *aIn, nsIVariant **aOut); - nsresult HR2NS(HRESULT hr) const; - NS_IMETHOD InternalInvoke(const char *aMethod, unsigned int aNumArgs, nsIVariant *aArgs[]); -}; - -class nsScriptablePeerTearOff : - public IDispatch -{ -public: - nsScriptablePeerTearOff(nsScriptablePeer *pOwner); - nsScriptablePeer *mOwner; - -// IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); - virtual ULONG STDMETHODCALLTYPE AddRef(void); - virtual ULONG STDMETHODCALLTYPE Release( void); - -// IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT __RPC_FAR *pctinfo); - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR __RPC_FAR *rgszNames, UINT cNames, LCID lcid, DISPID __RPC_FAR *rgDispId); - virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr); -}; - -#ifdef XPC_IDISPATCH_SUPPORT -class nsEventSink : public CControlEventSink -{ -public: - PluginInstanceData* mPlugin; - - virtual HRESULT InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); -}; - -typedef CComObject nsEventSinkInstance; -#endif - -namespace MozAxPlugin { - extern void AddRef(); - extern void Release(); - extern CLSID GetCLSIDForType(const char *mimeType); - extern NPError GetValue(NPP instance, NPPVariable variable, void *value); - extern nsScriptablePeer *GetPeerForCLSID(const CLSID &clsid); - extern void GetIIDForCLSID(const CLSID &clsid, nsIID &iid); - extern HRESULT GetServiceProvider(PluginInstanceData *pData, IServiceProvider **pSP); -#ifdef XPC_IDISPATCH_SUPPORT - extern PRUint32 PrefGetHostingFlags(); - extern void ReleasePrefObserver(); - extern nsresult GetCurrentLocation(NPP instance, nsIURI **aLocation); -#endif -} - -#endif diff --git a/embedding/browser/activex/src/plugin/activex.js b/embedding/browser/activex/src/plugin/activex.js deleted file mode 100644 index 7cc5deb65c2..00000000000 --- a/embedding/browser/activex/src/plugin/activex.js +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -/////////////////////////////////////////////////////////////////////////////// -// This is the default preferences file defining the behavior for hosting -// ActiveX controls in Gecko embedded applications. Embedders should override -// this file to set their own policy. -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// General hosting flags settings. Read nsIActiveXSecurityPolicy.idl in -// http://lxr.mozilla.org/seamonkey/find?string=nsIActiveXSecurityPolicy.idl -// for more combinations. -// -// Briefly, -// -// 0 means no hosting of activex controls whatsoever -// 13 means medium settings (safe for scripting controls and download / install) -// 31 means host anything (extremely dangerous!) -// - -pref("security.xpconnect.activex.global.hosting_flags", 13); - - -/////////////////////////////////////////////////////////////////////////////// -// Whitelist / Blacklist capabilities -// -// The whitelist and blacklist settings define what controls Gecko will host -// and the default allow / deny behavior. -// -// Note 1: -// -// The hosting flags pref value above takes priority over settings below. -// Therefore if the hosting flags are set to 0 (i.e. host nothing) then -// no control will be hosted no matter what controls are enabled. Likewise, -// If safe for scripting checks are (wisely) enabled, no unsafe control -// will be hosted even if it is explicitly enabled below. -// -// -// Note 2: -// -// Gecko always reads the IE browser's control blacklist if one is defined -// in the registry. This is to ensure any control identified by Microsoft -// or others as unsafe is not hosted without requiring it to be explicitly -// listed here also. -// - - -/////////////////////////////////////////////////////////////////////////////// -// This pref sets the default policy to allow all controls or deny them all -// default. If the value is false, only controls explicitly enabled by their -// classid will be allowed. Otherwise all controls are allowed except those -// explicitly disabled by their classid. -// -// If you are writing an embedding application that only needs to run -// certain known controls, (e.g. an intranet control of some kind) you are -// advised to use the false value and enable the control explicitly. - -pref("security.classID.allowByDefault", true); - - -/////////////////////////////////////////////////////////////////////////////// -// Specify below the controls that should be explicitly enabled or disabled. -// This is achieved by writing a policy rule, specifiying the classid of the -// control and giving the control "AllAccess" or "NoAccess". -// -// CIDaaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee -// -// You could explicitly ban a control (using the appropriate classid) like this -// -// pref("capability.policy.default.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "NoAccess"); -// -// If you want to explicity enable a control then do this: -// -// pref("capability.policy.default.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "AllAccess"); -// -// If you want to explicitly ban or allow a control for one or more sites then -// you can create a policy for those sites. This example creates a domain -// called 'trustable' containing sites where you allow an additional control -// to be hosted.: -// -// user_pref("capability.policy.policynames", "trustable"); -// user_pref("capability.policy.trustable.sites", "http://www.site1.net http://www.site2.net"); -// user_pref("capability.policy.trustable.ClassID.CID039ef260-2a0d-11d5-90a7-0010a4e73d9a", "AllAccess"); -// - - diff --git a/embedding/browser/activex/src/plugin/install.js b/embedding/browser/activex/src/plugin/install.js deleted file mode 100644 index e7dd041302a..00000000000 --- a/embedding/browser/activex/src/plugin/install.js +++ /dev/null @@ -1,161 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Settings! - -var SOFTWARE_NAME = "ActiveX Plugin"; -var VERSION = "1.0.0.3"; -var PLID_BASE = "@mozilla.org/ActiveXPlugin"; -var PLID = PLID_BASE + ",version=" + VERSION; - -var FLDR_COMPONENTS = getFolder("Components"); -var FLDR_PLUGINS = getFolder("Plugins"); -var FLDR_PREFS = getFolder("Program","defaults/pref"); -var FLDR_WINSYS = getFolder("Win System"); - -var PLUGIN = new FileToInstall("npmozax.dll", 300, FLDR_PLUGINS); -var XPT = new FileToInstall("nsIMozAxPlugin.xpt", 2, FLDR_COMPONENTS); -var SECURITYPOLICY = new FileToInstall("nsAxSecurityPolicy.js", 9, FLDR_COMPONENTS); -var PREFS = new FileToInstall("activex.js", 5, FLDR_PREFS); - -var MSVCRT = new FileToInstall("msvcrt.dll", 400, FLDR_WINSYS); -var MSSTL60 = new FileToInstall("msvcp60.dll", 300, FLDR_WINSYS); -var MSSTL70 = new FileToInstall("msvcp70.dll", 300, FLDR_WINSYS); - -var filesToAdd = new Array(PLUGIN, XPT, SECURITYPOLICY, PREFS); -var sysFilesToAdd = new Array(MSVCRT, MSSTL60, MSSTL70); - - -/////////////////////////////////////////////////////////////////////////////// - - -// Invoke initInstall to start the installation -err = initInstall(SOFTWARE_NAME, PLID, VERSION); -if (err == BAD_PACKAGE_NAME) -{ - // HACK: Mozilla 1.1 has a busted PLID parser which doesn't like the equals sign - PLID = PLID_BASE; - err = initInstall(SOFTWARE_NAME, PLID, VERSION); -} -if (err == SUCCESS) -{ - // Install plugin files - err = verifyDiskSpace(FLDR_PLUGINS, calcSpaceRequired(filesToAdd)); - if (err == SUCCESS) - { - for (i = 0; i < filesToAdd.length; i++) - { - err = addFile(PLID, VERSION, filesToAdd[i].name, filesToAdd[i].path, null); - if (err != SUCCESS) - { - alert("Installation of " + filesToAdd[i].name + " failed. Error code " + err); - logComment("adding file " + filesToAdd[i].name + " failed. Errror code: " + err); - break; - } - } - } - else - { - logComment("Cancelling current browser install due to lack of space..."); - } - - // Install C runtime files - if (err == SUCCESS) - { - if (verifyDiskSpace(FLDR_WINSYS, calcSpaceRequired(sysFilesToAdd)) == SUCCESS) - { - // Install system dlls *only* if they do not exist. - // - // NOTE: Ignore problems installing these files, since all kinds - // of stuff could cause this to fail and I really don't care - // about dealing with email describing failed permissions, - // locked files or whatnot. - for (i = 0; i < sysFilesToAdd.length; i++) - { - fileTemp = sysFilesToAdd[i].path + sysFilesToAdd[i].name; - fileUrl = getFolder("file:///", fileTemp); - if (File.exists(fileUrl) == false) - { - logComment("File not found: " + fileTemp); - addFile("/Microsoft/Shared", - VERSION, - sysFilesToAdd[i].name, // dir name in jar to extract - sysFilesToAdd[i].path, // Where to put this file (Returned from getFolder) - "", // subdir name to create relative to fProgram - WIN_SHARED_FILE); - logComment("addFile() of " + sysFilesToAdd[i].name + " returned: " + err); - } - else - { - logComment("File found: " + sysFilesToAdd[i].name ); - } - } - } - else - { - logComment("Cancelling current browser install due to lack of space..."); - } - } -} -else -{ - logComment("Install failed at initInstall level with " + err); -} - -if (err == SUCCESS) -{ - err = performInstall(); - if (err == SUCCESS) - { - alert("Installation performed successfully, you must restart the browser for the changes to take effect"); - } -} -else - cancelInstall(); - -/** - * Function for preinstallation of plugin (FirstInstall). - * You should not stop the install process because the function failed, - * you still have a chance to install the plugin for the already - * installed gecko browsers. - * - * @param dirPath directory path from getFolder - * @param spaceRequired required space in kilobytes - * - **/ -function verifyDiskSpace(dirPath, spaceRequired) -{ - var spaceAvailable; - - // Get the available disk space on the given path - spaceAvailable = fileGetDiskSpaceAvailable(dirPath); - - // Convert the available disk space into kilobytes - spaceAvailable = parseInt(spaceAvailable / 1024); - - // do the verification - if(spaceAvailable < spaceRequired) - { - logComment("Insufficient disk space: " + dirPath); - logComment(" required : " + spaceRequired + " K"); - logComment(" available: " + spaceAvailable + " K"); - return INSUFFICIENT_DISK_SPACE; - } - - return SUCCESS; -} - -function calcSpaceRequired(fileArray) -{ - var spaceRqd = 0; - for (i = 0; i < fileArray.length; i++) - { - spaceRqd += fileArray[i].size; - } - return spaceRqd; -} - -function FileToInstall(fileName, fileSize, dirPath) -{ - this.name = fileName; - this.size = fileSize; - this.path = dirPath; -} \ No newline at end of file diff --git a/embedding/browser/activex/src/plugin/npwin.cpp b/embedding/browser/activex/src/plugin/npwin.cpp deleted file mode 100644 index d9ab782804d..00000000000 --- a/embedding/browser/activex/src/plugin/npwin.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* IMPORTANT NOTE - This file has been hacked to add support for NPP_GetValue & NPP_SetValue! */ - -/* npwin.cpp */ - -//\\// INCLUDE -//#include "StdAfx.h" - -#include "npapi.h" -#include "npfunctions.h" - -//\\// DEFINE -#ifdef WIN32 - #define NP_EXPORT -#else - #define NP_EXPORT _export -#endif - -//\\// GLOBAL DATA -NPNetscapeFuncs* g_pNavigatorFuncs = 0; - -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -// PLUGIN DLL entry points -// -// These are the Windows specific DLL entry points. They must be exoprted -// - -// we need these to be global since we have to fill one of its field -// with a data (class) which requires knowlwdge of the navigator -// jump-table. This jump table is known at Initialize time (NP_Initialize) -// which is called after NP_GetEntryPoint -static NPPluginFuncs* g_pluginFuncs; - -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -// NP_GetEntryPoints -// -// fills in the func table used by Navigator to call entry points in -// plugin DLL. -// -NPError WINAPI NP_EXPORT -NP_GetEntryPoints(NPPluginFuncs* pFuncs) -{ - // trap a NULL ptr - if(pFuncs == NULL) - return NPERR_INVALID_FUNCTABLE_ERROR; - - // if the plugin's function table is smaller than the plugin expects, - // then they are incompatible, and should return an error - - pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; - pFuncs->newp = NPP_New; - pFuncs->destroy = NPP_Destroy; - pFuncs->setwindow = NPP_SetWindow; - pFuncs->newstream = NPP_NewStream; - pFuncs->destroystream = NPP_DestroyStream; - pFuncs->asfile = NPP_StreamAsFile; - pFuncs->writeready = NPP_WriteReady; - pFuncs->write = NPP_Write; - pFuncs->print = NPP_Print; - pFuncs->event = 0; /// reserved -#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT - pFuncs->getvalue = NPP_GetValue; - pFuncs->setvalue = NPP_SetValue; -#endif - - g_pluginFuncs = pFuncs; - - return NPERR_NO_ERROR; -} - -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -// NP_Initialize -// -// called immediately after the plugin DLL is loaded -// -NPError WINAPI NP_EXPORT -NP_Initialize(NPNetscapeFuncs* pFuncs) -{ - // trap a NULL ptr - if(pFuncs == NULL) - return NPERR_INVALID_FUNCTABLE_ERROR; - - g_pNavigatorFuncs = pFuncs; // save it for future reference - - // if the plugin's major ver level is lower than the Navigator's, - // then they are incompatible, and should return an error - if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR) - return NPERR_INCOMPATIBLE_VERSION_ERROR; - - // We have to defer these assignments until g_pNavigatorFuncs is set - int navMinorVers = g_pNavigatorFuncs->version & 0xFF; - - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) { - g_pluginFuncs->urlnotify = NPP_URLNotify; - } - - // NPP_Initialize is a standard (cross-platform) initialize function. - return NPP_Initialize(); -} - -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -// NP_Shutdown -// -// called immediately before the plugin DLL is unloaded. -// This function should check for some ref count on the dll to see if it is -// unloadable or it needs to stay in memory. -// -NPError WINAPI NP_EXPORT -NP_Shutdown() -{ - NPP_Shutdown(); - g_pNavigatorFuncs = NULL; - return NPERR_NO_ERROR; -} - -// END - PLUGIN DLL entry points -////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//. -//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. - -/* NAVIGATOR Entry points */ - -/* These entry points expect to be called from within the plugin. The - noteworthy assumption is that DS has already been set to point to the - plugin's DLL data segment. Don't call these functions from outside - the plugin without ensuring DS is set to the DLLs data segment first. -*/ - -/* returns the major/minor version numbers of the Plugin API for the plugin - and the Navigator -*/ -void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor) -{ - *plugin_major = NP_VERSION_MAJOR; - *plugin_minor = NP_VERSION_MINOR; - *netscape_major = HIBYTE(g_pNavigatorFuncs->version); - *netscape_minor = LOBYTE(g_pNavigatorFuncs->version); -} - -/* causes the specified URL to be fetched and streamed in -*/ -NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData) - -{ - int navMinorVers = g_pNavigatorFuncs->version & 0xFF; - NPError err; - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) { - err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData); - } - else { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - - -NPError NPN_GetURL(NPP instance, const char *url, const char *target) -{ - return g_pNavigatorFuncs->geturl(instance, url, target); -} - -NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData) -{ - int navMinorVers = g_pNavigatorFuncs->version & 0xFF; - NPError err; - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) { - err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData); - } - else { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - - -NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file) -{ - return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file); -} - -/* Requests that a number of bytes be provided on a stream. Typically - this would be used if a stream was in "pull" mode. An optional - position can be provided for streams which are seekable. -*/ -NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) -{ - return g_pNavigatorFuncs->requestread(stream, rangeList); -} - -/* Creates a new stream of data from the plug-in to be interpreted - by Netscape in the current window. -*/ -NPError NPN_NewStream(NPP instance, NPMIMEType type, - const char* target, NPStream** stream) -{ - int navMinorVersion = g_pNavigatorFuncs->version & 0xFF; - NPError err; - - if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) { - err = g_pNavigatorFuncs->newstream(instance, type, target, stream); - } - else { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -/* Provides len bytes of data. -*/ -int32_t NPN_Write(NPP instance, NPStream *stream, - int32_t len, void *buffer) -{ - int navMinorVersion = g_pNavigatorFuncs->version & 0xFF; - int32_t result; - - if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) { - result = g_pNavigatorFuncs->write(instance, stream, len, buffer); - } - else { - result = -1; - } - return result; -} - -/* Closes a stream object. -reason indicates why the stream was closed. -*/ -NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - int navMinorVersion = g_pNavigatorFuncs->version & 0xFF; - NPError err; - - if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) { - err = g_pNavigatorFuncs->destroystream(instance, stream, reason); - } - else { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -/* Provides a text status message in the Netscape client user interface -*/ -void NPN_Status(NPP instance, const char *message) -{ - g_pNavigatorFuncs->status(instance, message); -} - -/* returns the user agent string of Navigator, which contains version info -*/ -const char* NPN_UserAgent(NPP instance) -{ - return g_pNavigatorFuncs->uagent(instance); -} - -/* allocates memory from the Navigator's memory space. Necessary so that - saved instance data may be freed by Navigator when exiting. -*/ - - -void* NPN_MemAlloc(uint32_t size) -{ - return g_pNavigatorFuncs->memalloc(size); -} - -/* reciprocal of MemAlloc() above -*/ -void NPN_MemFree(void* ptr) -{ - g_pNavigatorFuncs->memfree(ptr); -} - -/* private function to Netscape. do not use! -*/ -void NPN_ReloadPlugins(NPBool reloadPages) -{ - g_pNavigatorFuncs->reloadplugins(reloadPages); -} - -NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result) -{ - return g_pNavigatorFuncs->getvalue(instance, variable, result); -} diff --git a/embedding/browser/activex/src/plugin/nsAxSecurityPolicy.js b/embedding/browser/activex/src/plugin/nsAxSecurityPolicy.js deleted file mode 100644 index 1fabb201b6a..00000000000 --- a/embedding/browser/activex/src/plugin/nsAxSecurityPolicy.js +++ /dev/null @@ -1,232 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -const NS_IACTIVEXSECURITYPOLICY_CONTRACTID = - "@mozilla.org/nsactivexsecuritypolicy;1"; -const NS_IACTIVEXSECURITYPOLICY_CID = - Components.ID("{B9BDB43B-109E-44b8-858C-B68C6C3DF86F}"); - -const nsISupports = Components.interfaces.nsISupports; -const nsIObserver = Components.interfaces.nsIObserver; -const nsIActiveXSecurityPolicy = Components.interfaces.nsIActiveXSecurityPolicy; - -/////////////////////////////////////////////////////////////////////////////// -// Constants representing some default flag combinations of varying degrees -// of safety. - -// No controls at all -const kTotalSecurityHostingFlags = - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_NOTHING; - -// Host only safe controls, no downloading or scripting -const kHighSecurityHostingFlags = - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_SAFE_OBJECTS; - -// Host and script safe controls and allow downloads -const kMediumSecurityGlobalHostingFlags = - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_SAFE_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_DOWNLOAD_CONTROLS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS; - -// Host any control and script safe controls -const kLowSecurityHostFlags = - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_SAFE_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_DOWNLOAD_CONTROLS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_ALL_OBJECTS; - -// Goodbye cruel world -const kNoSecurityHostingFlags = - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_SAFE_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_DOWNLOAD_CONTROLS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_SCRIPT_ALL_OBJECTS | - nsIActiveXSecurityPolicy.HOSTING_FLAGS_HOST_ALL_OBJECTS; - -/////////////////////////////////////////////////////////////////////////////// -// Constants representing the default hosting flag values when there is -// no pref value. Note that these should be as tight as possible except for -// testing purposes. - -const kDefaultGlobalHostingFlags = kMediumSecurityGlobalHostingFlags; -const kDefaultOtherHostingFlags = kMediumSecurityGlobalHostingFlags; - -// Preferences security policy reads from -const kHostingPrefPart1 = "security.xpconnect.activex."; -const kHostingPrefPart2 = ".hosting_flags"; -const kGlobalHostingFlagsPref = kHostingPrefPart1 + "global" + kHostingPrefPart2; - -var gPref = null; - -function addPrefListener(observer, prefStr) -{ - try { - if (gPref == null) { - var prefService = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - gPref = prefService.getBranch(null); - } - var pbi = gPref.QueryInterface(Components.interfaces.nsIPrefBranch2); - pbi.addObserver(prefStr, observer, false); - } catch(ex) { - dump("Failed to observe prefs: " + ex + "\n"); - } -} - -function AxSecurityPolicy() -{ - addPrefListener(this, kGlobalHostingFlagsPref); - this.syncPrefs(); - this.globalHostingFlags = kDefaultGlobalHostingFlags; -} - -AxSecurityPolicy.prototype = { - syncPrefs: function() - { - var hostingFlags = this.globalHostingFlags; - try { - if (gPref == null) { - var prefService = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - gPref = prefService.getBranch(null); - } - hostingFlags = gPref.getIntPref(kGlobalHostingFlagsPref); - } - catch (ex) { - dump("Failed to read control hosting flags from \"" + kGlobalHostingFlagsPref + "\"\n"); - hostingFlags = kDefaultGlobalHostingFlags; - } - if (hostingFlags != this.globalHostingFlags) - { - dump("Global activex hosting flags have changed value to " + hostingFlags + "\n"); - this.globalHostingFlags = hostingFlags - } - }, - - // nsIActiveXSecurityPolicy - getHostingFlags: function(context) - { - var hostingFlags; - if (context == null || context == "global") { - hostingFlags = this.globalHostingFlags; - } - else { - try { - var prefName = kHostingPrefPart1 + context + kHostingPrefPart2; - hostingFlags = gPref.getIntPref(prefName); - } - catch (ex) { - dump("Failed to read control hosting prefs for \"" + context + "\" from \"" + prefName + "\" pref\n"); - hostingFlags = kDefaultOtherHostingFlags; - } - hostingFlags = kDefaultOtherHostingFlags; - } - return hostingFlags; - }, - // nsIObserver - observe: function(subject, topic, prefName) - { - if (topic != "nsPref:changed") - return; - this.syncPrefs(); - - }, - // nsISupports - QueryInterface: function(iid) { - if (iid.equals(nsISupports) || - iid.equals(nsIActiveXSecurityPolicy) || - iid.equals(nsIObserver)) - return this; - - throw Components.results.NS_ERROR_NO_INTERFACE; - } -}; - -/* factory for AxSecurityPolicy */ -var AxSecurityPolicyFactory = { - createInstance: function (outer, iid) - { - if (outer != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - if (!iid.equals(nsISupports) && - !iid.equals(nsIActiveXSecurityPolicy) && - !iid.equals(nsIObserver)) - throw Components.results.NS_ERROR_INVALID_ARG; - return new AxSecurityPolicy(); - } -}; - - -var AxSecurityPolicyModule = { - registerSelf: function (compMgr, fileSpec, location, type) - { - debug("*** Registering axsecurity policy.\n"); - compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); - compMgr.registerFactoryLocation( - NS_IACTIVEXSECURITYPOLICY_CID , - "ActiveX Security Policy Service", - NS_IACTIVEXSECURITYPOLICY_CONTRACTID, - fileSpec, - location, - type); - }, - unregisterSelf: function(compMgr, fileSpec, location) - { - compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); - compMgr.unregisterFactoryLocation(NS_IACTIVEXSECURITYPOLICY_CID, fileSpec); - }, - getClassObject: function(compMgr, cid, iid) - { - if (cid.equals(NS_IACTIVEXSECURITYPOLICY_CID)) - return AxSecurityPolicyFactory; - - if (!iid.equals(Components.interfaces.nsIFactory)) - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - - throw Components.results.NS_ERROR_NO_INTERFACE; - }, - canUnload: function(compMgr) - { - return true; - } -}; - -/* entrypoint */ -function NSGetModule(compMgr, fileSpec) { - return AxSecurityPolicyModule; -} - - diff --git a/embedding/browser/activex/src/plugin/nsIMozAxPlugin.idl b/embedding/browser/activex/src/plugin/nsIMozAxPlugin.idl deleted file mode 100644 index 59e9796d607..00000000000 --- a/embedding/browser/activex/src/plugin/nsIMozAxPlugin.idl +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is - * Netscape Communications, Inc. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -interface nsIVariant; - -[scriptable, uuid(b30c2717-2bbf-4475-9ddf-9e26f893f32a)] -interface nsIMozAxPlugin : nsISupports -{ - void invoke(in string str); - void invoke1(in string str, in nsIVariant a); - void invoke2(in string str, in nsIVariant a, in nsIVariant b); - void invoke3(in string str, in nsIVariant a, in nsIVariant b, in nsIVariant c); - void invoke4(in string str, in nsIVariant a, in nsIVariant b, in nsIVariant c, in nsIVariant d); - - /* Set and get values */ - nsIVariant getProperty(in string propertyName); - void setProperty(in string propertyName, in nsIVariant propertyValue); -}; diff --git a/embedding/browser/activex/src/plugin/plugin.sln b/embedding/browser/activex/src/plugin/plugin.sln deleted file mode 100644 index 6d02314dc34..00000000000 --- a/embedding/browser/activex/src/plugin/plugin.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin", "plugin.vcproj", "{E992202E-EF6C-48DC-96F4-9522F09411EE}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {E992202E-EF6C-48DC-96F4-9522F09411EE}.Debug.ActiveCfg = Debug|Win32 - {E992202E-EF6C-48DC-96F4-9522F09411EE}.Debug.Build.0 = Debug|Win32 - {E992202E-EF6C-48DC-96F4-9522F09411EE}.Release.ActiveCfg = Release|Win32 - {E992202E-EF6C-48DC-96F4-9522F09411EE}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/embedding/browser/activex/src/plugin/plugin.vcproj b/embedding/browser/activex/src/plugin/plugin.vcproj deleted file mode 100644 index 414a0907efe..00000000000 --- a/embedding/browser/activex/src/plugin/plugin.vcproj +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/embedding/browser/activex/src/plugin/resource.h b/embedding/browser/activex/src/plugin/resource.h deleted file mode 100644 index 905b525d2a1..00000000000 --- a/embedding/browser/activex/src/plugin/resource.h +++ /dev/null @@ -1 +0,0 @@ -// resource.h diff --git a/embedding/browser/activex/src/plugin/test.htm b/embedding/browser/activex/src/plugin/test.htm deleted file mode 100644 index d214a597dc7..00000000000 --- a/embedding/browser/activex/src/plugin/test.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Mozilla Plugin Test Page - - - - - -

This page is designed for Communicator 4.x with the Mozilla -ActiveX plugin installed! You also need to have the MS calendar control -installed to see anything

- -

This version uses the EMBED tag

-

- - -

- -

This version uses the OBJECT tag, with a few different parameter settings.

-

- - - - - - - - - - - - - -

- - - - diff --git a/embedding/browser/activex/src/pluginhostctrl/PluginHostCtrl.rgs b/embedding/browser/activex/src/pluginhostctrl/PluginHostCtrl.rgs deleted file mode 100644 index 988779dd667..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/PluginHostCtrl.rgs +++ /dev/null @@ -1,39 +0,0 @@ -HKCR -{ - Mozilla.PluginHostCtrl.1 = s 'MozillaPluginHostCtrl Class' - { - CLSID = s '{DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2}' - } - Mozilla.PluginHostCtrl = s 'MozillaPluginHostCtrl Class' - { - CLSID = s '{DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2}' - CurVer = s 'Mozilla.PluginHostCtrl.1' - } - NoRemove CLSID - { - ForceRemove {DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2} = s 'MozillaPluginHostCtrl Class' - { - ForceRemove 'Implemented Categories' - { - ForceRemove '{7DD95801-9882-11CF-9FA9-00AA006C42C4}' - ForceRemove '{7DD95802-9882-11CF-9FA9-00AA006C42C4}' - } - ProgID = s 'Mozilla.PluginHostCtrl.1' - VersionIndependentProgID = s 'Mozilla.PluginHostCtrl' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - ForceRemove 'Control' - ForceRemove 'Insertable' - ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 101' - 'MiscStatus' = s '0' - { - '1' = s '131473' - } - 'TypeLib' = s '{5C670C1C-33E2-4B67-8D1E-CC2CF8091A0A}' - 'Version' = s '1.0' - } - } -} diff --git a/embedding/browser/activex/src/pluginhostctrl/README.txt b/embedding/browser/activex/src/pluginhostctrl/README.txt deleted file mode 100644 index 7429af168c9..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/README.txt +++ /dev/null @@ -1,83 +0,0 @@ -ActiveX control for hosting Netscape plugins in IE -================================================== - -This folder contains an ActiveX control that allows you to host -NP API compatible plugins within Internet Explorer. It's pretty simple to -use and is a self-contained DLL called pluginhostctrl.dll. It has no runtime -or build dependencies on any other -part of the Mozilla - - -To build -======== - -1. Open pluginhostctrl.dsp -2. Build "Win32 Debug" or another target -3. Open some of the test files in IE to verify it works - -The control currently reads plugins from your most current Netscape 4.x -installation. There is no support for Mozilla or NS 6.x yet. - -A note to developers: If you intend to modify this control IN ANY WAY then -you MUST also change the CLSID. This is necessary to prevent your control -from registering itself over this control or vice versa. - -Use a tool such as guidgen.exe or uuidgen.exe to create a new CLSID. - - -Manual installation -=================== - -Assuming you have the precompiled DLL and wish to install it on a machine, -you must register it: - -regsvr32 pluginhostctrl.dll - -You must have administrator privileges to install a new control on -operating systems such as Windows NT, 2000 & XP. - - -Usage -===== - -Insert some HTML like this into your content: - - - - - - - - -The CLSID attribute tells IE to create an instance of the plugin hosting -control, the width and height specify the dimensions in pixels. - -The following attributes have tag equivalents: - -* is equivalent to TYPE - Specifies the MIME type of the plugin. The control uses this value to - determine which plugin it should create to handle the content. - -* is equivalent to SRC - Specifies an URL for the initial stream of data to feed the plugin. - If you havent't specified a "type" PARAM, the control will attempt to use - the MIME type of this stream to create the correct plugin. - -* is equivalent to PLUGINSPAGE - Specifies a URL where the plugin may be installed from. The default - plugin will redirect you to this page when you do not have the correct - plugin installed. - -You may also supply any custom plugin parameters as additional -elements. - - -Still to do -=========== - -* Only hosts windowed plugins. -* Doesn't work for the Adobe Acrobat plugin yet. -* No progress indication to show when there is network activity -* Plugins cannot create writeable streams. -* Package pluginhostctrl.dll into a CAB file automatic installation in IE. diff --git a/embedding/browser/activex/src/pluginhostctrl/StdAfx.cpp b/embedding/browser/activex/src/pluginhostctrl/StdAfx.cpp deleted file mode 100644 index 9ee408b7a75..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/StdAfx.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#ifdef _ATL_STATIC_REGISTRY -#include -#include -#endif - -// #include diff --git a/embedding/browser/activex/src/pluginhostctrl/StdAfx.h b/embedding/browser/activex/src/pluginhostctrl/StdAfx.h deleted file mode 100644 index bf6be20558b..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/StdAfx.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// 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__113F2370_7A1B_4C16_BDFB_37785C884DA6__INCLUDED_) -#define AFX_STDAFX_H__113F2370_7A1B_4C16_BDFB_37785C884DA6__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define STRICT -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0403 -#endif -#define _ATL_APARTMENT_THREADED - -#include -//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 -#include -#include -#include -#include -#include - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#include "npapi.h" -#include "npupp.h" - - -#endif // !defined(AFX_STDAFX_H__113F2370_7A1B_4C16_BDFB_37785C884DA6__INCLUDED) diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/README.txt b/embedding/browser/activex/src/pluginhostctrl/cab/README.txt deleted file mode 100644 index 156f0c983d9..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/cab/README.txt +++ /dev/null @@ -1,58 +0,0 @@ -Mozilla ActiveX Control for hosting Plug-ins - -Adam Lock - - -Want to generate a CAB file for the plugin host control? - -First off you need the Cabinet SDK and the signing tools: - - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp - http://msdn.microsoft.com/MSDN-FILES/027/000/219/codesign.exe - -More informative blurb about signing is here: - - http://www.verisign.com/support/tlc/codesign/install.html - -Please don't email me questions about signing since I'm just following the -instructions in these links. - -Install the CAB and signing tools somewhere and edit the line in makecab.bat -to specify the correct PATH to these programs. - -Next build the pluginhostctrl.dll (e.g. from the ReleaseMinSize target) and type - - makecab ..\ReleaseMinSize\pluginhostctrl.dll - -This produces pluginhostctrl.cab which you can place on a webserver somewhere -so IE can download it when it's specified in the tag, e.g. - - - - -The makecab script automatically signs the CAB file with a TEST CERTIFICATE. YOu -will be prompted to create or enter a password - just make one up and remember -it. - - DO NOT DISTRIBUTE CAB FILES SIGNED WITH THE TEST CERTIFICATE!!!! - -If you want to sign the CAB file with a real certificate, run makecab like this: - - makecab ..\ReleaseMinSize\pluginhostctrl.dll xx.cer xx.key xx.spc - -Where xx.* files are your real certificate, key and your software publisher -certificate. If you don't have a real certificate you need to visit somewhere -like Verisign and buy one. - -There is a sample verify.htm page that you may load in IE to see if the -control installs and runs correctly. - -STILL TO DO: - - o Figure out what's wrong with pluginhostctrl.inf that stops atl.dll from - installing. For the time being atl.dll is commented out of the .inf file - which means it won't be installed and the plugin won't work if its not - installed already. - o Script is untested with a real key/cert/spc but should work. diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat b/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat deleted file mode 100755 index f331fae5748..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat +++ /dev/null @@ -1,70 +0,0 @@ -@echo off - -set OLDPATH=%PATH% -set PATH=d:\m\cabsdk\bin;d:\m\codesign\bin;%PATH% - -set OUTDIR=.\out -set OUTCAB=.\pluginhostctrl.cab - -set PLUGINHOSTCTRLDLL=%1 -set CERTFILE=%2 -set KEYFILE=%3 -set SPCFILE=%4 - -REM === Check arguments === - -if NOT .%PLUGINHOSTCTRLDLL%.==.. goto have_pluginhostctrl -echo Usage : %0 pluginhostctrl [certfile keyfile spcfile] -echo . -echo Specify the path to the pluginhostctrl.dll file as the first argument -echo and optionally the certificate and keyfile as extra arguments. -goto end -:have_pluginhostctrl -if EXIST %PLUGINHOSTCTRLDLL% goto valid_pluginhostctrl -echo ERROR: The specified pluginhostctrl.dll file "%PLUGINHOSTCTRLDLL%" does not exist. -goto end -:valid_pluginhostctrl - - -REM === Make the CAB file === - -mkdir %OUTDIR% -copy %PLUGINHOSTCTRLDLL% %OUTDIR% -copy redist\*.* %OUTDIR% -copy pluginhostctrl.inf %OUTDIR% -cabarc -s 6144 -r -P %OUTDIR%\ N %OUTCAB% out\*.* - - -REM === Generate a test certificate to sign this thing with === - -if NOT .%TESTCERT%.==.. goto end_testcert -echo Generating a test certificate... -set KEYFILE=.\test.key -set CERTFILE=.\test.cer -set SPCFILE=.\test.spc -makecert -sv %KEYFILE% -n "CN=testcert.untrusted.org" %CERTFILE% -cert2spc %CERTFILE% %SPCFILE% -:end_testcert - - -REM === Sign the CAB file === - -if .%CERTFILE%.==.. goto the_end -if .%KEYFILE%.==.. goto the_end -if .%SPCFILE%.==.. goto the_end -if NOT EXIST %CERTFILE% goto the_end -if NOT EXIST %KEYFILE% goto the_end -if NOT EXIST %SPCFILE% goto the_end -echo Signing %OUTCAB% -signcode -spc %SPCFILE% -v %KEYFILE% -n "Mozilla ActiveX control for hosting plugins" %OUTCAB% - - -REM == THE END === - -:the_end -set PATH=%OLDPATH% -set OLDPATH= -set OUTCAB= -set CERTFILE= -set KEYFILE= -set SPCFILE= diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf b/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf deleted file mode 100644 index 7ba88918c61..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf +++ /dev/null @@ -1,22 +0,0 @@ -; pluginhostctrl.inf -[version] -signature="$CHICAGO$" -AdvancedINF=2.0 - -[Add.Code] -pluginhostctrl.dll=pluginhostctrl.dll -;atl.dll=atl.dll - -; Required DLLs - -[pluginhostctrl.dll] -file-win32-x86=thiscab -clsid={DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2} -FileVersion=1,0,0,1 -RegisterServer=yes - -;[atl.dll] -;file-win32-x86=thiscab -;DestDir=11 -;RegisterServer=yes -;FileVersion=6,0,0,8449 diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/redist/ATL.DLL b/embedding/browser/activex/src/pluginhostctrl/cab/redist/ATL.DLL deleted file mode 100644 index 6b7a8b0c9b2..00000000000 Binary files a/embedding/browser/activex/src/pluginhostctrl/cab/redist/ATL.DLL and /dev/null differ diff --git a/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm b/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm deleted file mode 100644 index cc1a7684568..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/cab/verify.htm +++ /dev/null @@ -1,12 +0,0 @@ - - - CAB file verification - - -

Test page to verify CAB file was created and signed correctly

- - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/npn.cpp b/embedding/browser/activex/src/pluginhostctrl/npn.cpp deleted file mode 100644 index ebfc247294f..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/npn.cpp +++ /dev/null @@ -1,487 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - */ -#include "stdafx.h" - -#include "npn.h" -#include "Pluginhostctrl.h" - -#include "nsPluginHostWnd.h" - -static NPError -_OpenURL(NPP npp, const char *szURL, const char *szTarget, void *pNotifyData, const char *pData, uint32 len, NPBool isFile) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - void *postData = NULL; - uint32 postDataLen = 0; - if (pData) - { - if (!isFile) - { - postData = (void *) pData; - postDataLen = len; - } - else - { - // TODO read the file specified in the postdata param into memory - } - } - - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - // Other window targets - if (szTarget) - { - CComPtr cpBrowser; - pWnd->GetWebBrowserApp(&cpBrowser); - if (!cpBrowser) - { - return NPERR_GENERIC_ERROR; - } - - CComBSTR url(szURL); - - HRESULT hr; - - // Test if the input URL has a schema which means it's relative, - // otherwise consider it to be relative to the current URL - - WCHAR szSchema[10]; - const DWORD cbSchema = sizeof(szSchema) / sizeof(szSchema[0]); - DWORD cbSchemaUsed = 0; - - memset(szSchema, 0, cbSchema); - hr = CoInternetParseUrl(url.m_str, PARSE_SCHEMA, 0, - szSchema, cbSchema, &cbSchemaUsed, 0); - - if (hr != S_OK || cbSchemaUsed == 0) - { - // Convert relative URLs to absolute, so that they can be loaded - // by the Browser - - CComBSTR bstrCurrentURL; - cpBrowser->get_LocationURL(&bstrCurrentURL); - - if (bstrCurrentURL.Length()) - { - USES_CONVERSION; - DWORD cbNewURL = (url.Length() + bstrCurrentURL.Length() + 1) * sizeof(WCHAR); - DWORD cbNewURLUsed = 0; - WCHAR *pszNewURL = (WCHAR *) calloc(cbNewURL, 1); - ATLASSERT(pszNewURL); - - CoInternetCombineUrl( - bstrCurrentURL.m_str, - url.m_str, - 0, - pszNewURL, - cbNewURL, - &cbNewURLUsed, - 0); - - ATLASSERT(cbNewURLUsed < cbNewURL); - - url = pszNewURL; - free(pszNewURL); - } - } - - CComVariant vFlags; - CComVariant vTarget(szTarget); - CComVariant vPostData; - CComVariant vHeaders; - - // Initialise postdata - if (postData) - { - // According to the documentation. - // The post data specified by PostData is passed as a SAFEARRAY - // structure. The variant should be of type VT_ARRAY and point to - // a SAFEARRAY. The SAFEARRAY should be of element type VT_UI1, - // dimension one, and have an element count equal to the number of - // bytes of post data. - - SAFEARRAYBOUND saBound[1]; - saBound[0].lLbound = 0; - saBound[0].cElements = len; - vPostData.vt = VT_ARRAY | VT_UI1; - vPostData.parray = SafeArrayCreate(VT_UI1, 1, saBound); - SafeArrayLock(vPostData.parray); - memcpy(vPostData.parray->pvData, postData, postDataLen); - SafeArrayUnlock(vPostData.parray); - } - - cpBrowser->Navigate(url, &vFlags, &vTarget, &vPostData, &vHeaders); - // TODO listen to navigation & send a URL notify to plugin when completed - return NPERR_NO_ERROR; - } - - USES_CONVERSION; - HRESULT hr = pWnd->OpenURLStream(A2CT(szURL), pNotifyData, postData, postDataLen); - return SUCCEEDED(hr) ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; -} - - -NPError NP_EXPORT -NPN_GetURL(NPP npp, const char* relativeURL, const char* target) -{ - return _OpenURL(npp, relativeURL, target, NULL, NULL, 0, FALSE); -} - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_GetURLNotify(NPP npp, - const char* relativeURL, - const char* target, - void* notifyData) -{ - if (strncmp("javascript:", relativeURL, 11) == 0) - return NPERR_INVALID_URL; - - return _OpenURL(npp, relativeURL, target, notifyData, NULL, 0, FALSE); -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_PostURLNotify(NPP npp, - const char *relativeURL, - const char *target, - uint32 len, - const char *buf, - NPBool file, - void *notifyData) -{ - return _OpenURL(npp, relativeURL, target, notifyData, buf, len, file); -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_PostURL(NPP npp, - const char *relativeURL, - const char *target, - uint32 len, - const char *buf, - NPBool file) -{ - return _OpenURL(npp, relativeURL, target, NULL, buf, len, file); -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_NewStream(NPP npp, NPMIMEType type, const char* window, NPStream* *result) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - return NPERR_GENERIC_ERROR; -} - - -//////////////////////////////////////////////////////////////////////// -int32 NP_EXPORT -NPN_Write(NPP npp, NPStream *pstream, int32 len, void *buffer) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - return NPERR_GENERIC_ERROR; -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_DestroyStream(NPP npp, NPStream *pstream, NPError reason) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - return NPERR_GENERIC_ERROR; -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_Status(NPP npp, const char *message) -{ - if (!npp) - { - return; - } - - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - // Update the status bar in the browser - CComPtr cpBrowser; - pWnd->GetWebBrowserApp(&cpBrowser); - if (cpBrowser) - { - USES_CONVERSION; - cpBrowser->put_StatusText(A2OLE(message)); - } -} - - -//////////////////////////////////////////////////////////////////////// -void * NP_EXPORT -NPN_MemAlloc (uint32 size) -{ - return malloc(size); -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_MemFree (void *ptr) -{ - if (ptr) - { - free(ptr); - } -} - - -//////////////////////////////////////////////////////////////////////// -uint32 NP_EXPORT -NPN_MemFlush(uint32 size) -{ - return 0; -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_ReloadPlugins(NPBool reloadPages) -{ -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_InvalidateRect(NPP npp, NPRect *invalidRect) -{ - if (!npp) - { - return; - } - - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - RECT *prc = NULL; - RECT rcInvalid; - if (invalidRect) - { - prc = &rcInvalid; - prc->left = invalidRect->left; - prc->bottom = invalidRect->bottom; - prc->top = invalidRect->top; - prc->right = invalidRect->right; - } - pWnd->InvalidateRect(prc, FALSE); -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_InvalidateRegion(NPP npp, NPRegion invalidRegion) -{ - if (!npp) - { - return; - } - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - pWnd->InvalidateRgn(invalidRegion, FALSE); -} - - -//////////////////////////////////////////////////////////////////////// -void NP_EXPORT -NPN_ForceRedraw(NPP npp) -{ - if (!npp) - { - return; - } - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - pWnd->InvalidateRect(NULL, FALSE); -} - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_GetValue(NPP npp, NPNVariable variable, void *result) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - if (!result) - { - return NPERR_INVALID_PARAM; - } - - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - CComPtr cpBrowser; - pWnd->GetWebBrowserApp(&cpBrowser); - - // Test the variable - switch (variable) - { - case NPNVnetscapeWindow: - *((HWND *) result) = pWnd->m_hWnd; - break; - case NPNVjavascriptEnabledBool: - // TODO - *((NPBool *) result) = FALSE; - break; - case NPNVasdEnabledBool: - *((NPBool *) result) = FALSE; - break; - case NPNVisOfflineBool: - *((NPBool *) result) = FALSE; - if (cpBrowser) - { - CComQIPtr cpBrowser2 = cpBrowser; - if (cpBrowser2) - { - VARIANT_BOOL bOffline = VARIANT_FALSE; - cpBrowser2->get_Offline(&bOffline); - *((NPBool *) result) = (bOffline == VARIANT_TRUE) ? TRUE : FALSE; - } - } - break; - default: - return NPERR_GENERIC_ERROR; - } - return NPERR_NO_ERROR; -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_SetValue(NPP npp, NPPVariable variable, void *result) -{ - if (!npp) - { - return NPERR_INVALID_INSTANCE_ERROR; - } - - nsPluginHostWnd *pWnd = (nsPluginHostWnd *) npp->ndata; - ATLASSERT(pWnd); - - switch (variable) - { - case NPPVpluginWindowBool: - { - pWnd->SetPluginWindowless((result == NULL) ? true : false); - } - return NPERR_NO_ERROR; - case NPPVpluginTransparentBool: - { - pWnd->SetPluginTransparent((result != NULL) ? true : false); - } - return NPERR_NO_ERROR; - } - - return NPERR_GENERIC_ERROR; -} - - -//////////////////////////////////////////////////////////////////////// -NPError NP_EXPORT -NPN_RequestRead(NPStream *pstream, NPByteRange *rangeList) -{ - if (!pstream || !rangeList || !pstream->ndata) - { - return NPERR_INVALID_PARAM; - } - - return NPERR_GENERIC_ERROR; -} - -//////////////////////////////////////////////////////////////////////// -JRIEnv* NP_EXPORT -NPN_GetJavaEnv(void) -{ - return NULL; -} - - -//////////////////////////////////////////////////////////////////////// -const char * NP_EXPORT -NPN_UserAgent(NPP npp) -{ - return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6"; -} - - -//////////////////////////////////////////////////////////////////////// -java_lang_Class* NP_EXPORT -NPN_GetJavaClass(void* handle) -{ - return NULL; -} - - -//////////////////////////////////////////////////////////////////////// -jref NP_EXPORT -NPN_GetJavaPeer(NPP npp) -{ - return NULL; -} - - diff --git a/embedding/browser/activex/src/pluginhostctrl/npn.h b/embedding/browser/activex/src/pluginhostctrl/npn.h deleted file mode 100644 index 1579d6334ed..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/npn.h +++ /dev/null @@ -1,116 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef NPN_H -#define NPN_H - -#include "npapi.h" -#include "npupp.h" - -#define NP_EXPORT - -//////////////////////////////////////////////////////////////////////// -// stub functions that are exported to the 4.x plugin as entry -// points via the CALLBACKS variable. -// -NPError NP_EXPORT -NPN_RequestRead(NPStream *pstream, NPByteRange *rangeList); - -NPError NP_EXPORT -NPN_GetURLNotify(NPP npp, const char* relativeURL, const char* target, void* notifyData); - -NPError NP_EXPORT -NPN_GetValue(NPP npp, NPNVariable variable, void *r_value); - -NPError NP_EXPORT -NPN_SetValue(NPP npp, NPPVariable variable, void *r_value); - -NPError NP_EXPORT -NPN_GetURL(NPP npp, const char* relativeURL, const char* target); - -NPError NP_EXPORT -NPN_PostURLNotify(NPP npp, const char* relativeURL, const char *target, - uint32 len, const char *buf, NPBool file, void* notifyData); - -NPError NP_EXPORT -NPN_PostURL(NPP npp, const char* relativeURL, const char *target, uint32 len, - const char *buf, NPBool file); - -NPError NP_EXPORT -NPN_NewStream(NPP npp, NPMIMEType type, const char* window, NPStream** pstream); - -int32 NP_EXPORT -NPN_Write(NPP npp, NPStream *pstream, int32 len, void *buffer); - -NPError NP_EXPORT -NPN_DestroyStream(NPP npp, NPStream *pstream, NPError reason); - -void NP_EXPORT -NPN_Status(NPP npp, const char *message); - -void* NP_EXPORT -NPN_MemAlloc (uint32 size); - -void NP_EXPORT -NPN_MemFree (void *ptr); - -uint32 NP_EXPORT -NPN_MemFlush(uint32 size); - -void NP_EXPORT -NPN_ReloadPlugins(NPBool reloadPages); - -void NP_EXPORT -NPN_InvalidateRect(NPP npp, NPRect *invalidRect); - -void NP_EXPORT -NPN_InvalidateRegion(NPP npp, NPRegion invalidRegion); - -const char* NP_EXPORT -NPN_UserAgent(NPP npp); - -JRIEnv* NP_EXPORT -NPN_GetJavaEnv(void); - -jref NP_EXPORT -NPN_GetJavaPeer(NPP npp); - -java_lang_Class* NP_EXPORT -NPN_GetJavaClass(void* handle); - -void NP_EXPORT -NPN_ForceRedraw(NPP npp); - -#endif diff --git a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.cpp b/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.cpp deleted file mode 100644 index 4903a9852af..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include "Pluginhostctrl.h" -#include "nsPluginHostCtrl.h" - -///////////////////////////////////////////////////////////////////////////// -// nsPluginHostCtrl - -nsPluginHostCtrl::nsPluginHostCtrl() -{ - m_bWindowOnly = TRUE; -} - -nsPluginHostCtrl::~nsPluginHostCtrl() -{ -} - - -HRESULT nsPluginHostCtrl::GetWebBrowserApp(IWebBrowserApp **pBrowser) -{ - ATLASSERT(pBrowser); - if (!pBrowser) - { - return E_INVALIDARG; - } - - // Get the web browser through the site the control is attached to. - // Note: The control could be running in some other container than IE - // so code shouldn't expect this function to work all the time. - - CComPtr cpWebBrowser; - CComQIPtr cpServiceProvider = m_spClientSite; - - HRESULT hr; - if (cpServiceProvider) - { - hr = cpServiceProvider->QueryService(IID_IWebBrowserApp, &cpWebBrowser); - } - if (!cpWebBrowser) - { - return E_FAIL; - } - - *pBrowser = cpWebBrowser; - (*pBrowser)->AddRef(); - - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// IMozPluginHostCtrl - -STDMETHODIMP nsPluginHostCtrl::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog) -{ - CComQIPtr cpPropBag2 = pPropBag; - if (cpPropBag2) - { - // Read *all* the properties via IPropertyBag2 and store them somewhere - // so they can be fed into the plugin instance at creation.. - ULONG nProperties; - cpPropBag2->CountProperties(&nProperties); - if (nProperties > 0) - { - PROPBAG2 *pProperties = (PROPBAG2 *) malloc(sizeof(PROPBAG2) * nProperties); - ULONG nPropertiesGotten = 0; - cpPropBag2->GetPropertyInfo(0, nProperties, pProperties, &nPropertiesGotten); - for (ULONG i = 0; i < nPropertiesGotten; i++) - { - if (pProperties[i].vt == VT_BSTR) - { - USES_CONVERSION; - CComVariant v; - HRESULT hrRead; - cpPropBag2->Read(1, &pProperties[i], NULL, &v, &hrRead); - AddPluginParam(OLE2A(pProperties[i].pstrName), OLE2A(v.bstrVal)); - } - if (pProperties[i].pstrName) - { - CoTaskMemFree(pProperties[i].pstrName); - } - } - free(pProperties); - } - } - return IPersistPropertyBagImpl::Load(pPropBag, pErrorLog); -} - -/////////////////////////////////////////////////////////////////////////////// -// IMozPluginHostCtrl - -STDMETHODIMP nsPluginHostCtrl::get_PluginContentType(BSTR *pVal) -{ - return GetPluginContentType(pVal); -} - -STDMETHODIMP nsPluginHostCtrl::put_PluginContentType(BSTR newVal) -{ - return SetPluginContentType(newVal); -} - -STDMETHODIMP nsPluginHostCtrl::get_PluginSource(BSTR *pVal) -{ - return GetPluginSource(pVal); -} - -STDMETHODIMP nsPluginHostCtrl::put_PluginSource(BSTR newVal) -{ - return SetPluginSource(newVal); -} - -STDMETHODIMP nsPluginHostCtrl::get_PluginsPage(BSTR *pVal) -{ - return GetPluginsPage(pVal); -} - -STDMETHODIMP nsPluginHostCtrl::put_PluginsPage(BSTR newVal) -{ - return SetPluginsPage(newVal); -} diff --git a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.h b/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.h deleted file mode 100644 index 5ba7eb4ef87..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.h +++ /dev/null @@ -1,169 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// nsPluginHostCtrl.h : Declaration of the nsPluginHostCtrl - -#ifndef __PLUGINHOSTCTRL_H_ -#define __PLUGINHOSTCTRL_H_ - -#include "resource.h" // main symbols -#include - -#include "nsPluginHostWnd.h" -#include "nsPluginWnd.h" - -///////////////////////////////////////////////////////////////////////////// -// nsPluginHostCtrl -class ATL_NO_VTABLE nsPluginHostCtrl : - public CComObjectRootEx, - public CStockPropImpl, - public CComControl, - public IPersistStreamInitImpl, - public IOleControlImpl, - public IOleObjectImpl, - public IOleInPlaceActiveObjectImpl, - public IViewObjectExImpl, - public IOleInPlaceObjectWindowlessImpl, - public ISupportErrorInfo, - public IConnectionPointContainerImpl, - public IPersistStorageImpl, - public IPersistPropertyBagImpl, - public ISpecifyPropertyPagesImpl, - public IQuickActivateImpl, - public IDataObjectImpl, - public IProvideClassInfo2Impl<&CLSID_MozPluginHostCtrl, &DIID__IMozPluginHostCtrlEvents, &LIBID_PLUGINHOSTCTRLLib>, - public IPropertyNotifySinkCP, - public CComCoClass -{ -protected: - virtual ~nsPluginHostCtrl(); - -public: - nsPluginHostCtrl(); - -DECLARE_REGISTRY_RESOURCEID(IDR_PLUGINHOSTCTRL) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(nsPluginHostCtrl) - COM_INTERFACE_ENTRY(IMozPluginHostCtrl) - COM_INTERFACE_ENTRY2(IDispatch, IMozPluginHostCtrl) - COM_INTERFACE_ENTRY(IViewObjectEx) - COM_INTERFACE_ENTRY(IViewObject2) - COM_INTERFACE_ENTRY(IViewObject) - COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY(IOleInPlaceObject) - COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless) - COM_INTERFACE_ENTRY(IOleInPlaceActiveObject) - COM_INTERFACE_ENTRY(IOleControl) - COM_INTERFACE_ENTRY(IOleObject) - COM_INTERFACE_ENTRY(IPersistStreamInit) - COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit) - COM_INTERFACE_ENTRY(IPersistPropertyBag) - COM_INTERFACE_ENTRY(ISupportErrorInfo) - COM_INTERFACE_ENTRY(IConnectionPointContainer) -// COM_INTERFACE_ENTRY(ISpecifyPropertyPages) - COM_INTERFACE_ENTRY(IQuickActivate) - COM_INTERFACE_ENTRY(IPersistStorage) - COM_INTERFACE_ENTRY(IDataObject) - COM_INTERFACE_ENTRY(IProvideClassInfo) - COM_INTERFACE_ENTRY(IProvideClassInfo2) -END_COM_MAP() - -BEGIN_PROP_MAP(nsPluginHostCtrl) - PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4) - PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4) - PROP_ENTRY("HWND", DISPID_HWND, CLSID_NULL) - PROP_ENTRY("Text", DISPID_TEXT, CLSID_NULL) - // Mozilla plugin host control properties - PROP_ENTRY("type", 1, CLSID_NULL) - PROP_ENTRY("src", 2, CLSID_NULL) - PROP_ENTRY("pluginspage", 3, CLSID_NULL) - // Example entries - // PROP_ENTRY("Property Description", dispid, clsid) - // PROP_PAGE(CLSID_StockColorPage) -END_PROP_MAP() - -BEGIN_CONNECTION_POINT_MAP(nsPluginHostCtrl) - CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink) -END_CONNECTION_POINT_MAP() - -BEGIN_MSG_MAP(nsPluginHostWnd) - CHAIN_MSG_MAP(nsPluginHostWnd) -END_MSG_MAP() - - -// Handler prototypes: -// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); -// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); -// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); - -// ISupportsErrorInfo - STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) - { - static const IID* arr[] = - { - &IID_IMozPluginHostCtrl, - }; - for (int i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include "nsPluginHostWnd.h" - -#include "nsURLDataCallback.h" - -#include "npn.h" - -#define NS_4XPLUGIN_CALLBACK(_type, _name) _type (__stdcall * _name) - -typedef NS_4XPLUGIN_CALLBACK(NPError, NP_GETENTRYPOINTS) (NPPluginFuncs* pCallbacks); -typedef NS_4XPLUGIN_CALLBACK(NPError, NP_PLUGININIT) (const NPNetscapeFuncs* pCallbacks); -typedef NS_4XPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) (void); - -const kArraySizeIncrement = 10; - -nsSimpleArray nsPluginHostWnd::m_LoadedPlugins; - -nsPluginHostWnd::nsPluginHostWnd() : - m_bPluginIsAlive(false), - m_bCreatePluginFromStreamData(false), - m_bPluginIsWindowless(false), - m_bPluginIsTransparent(false), - m_pLoadedPlugin(NULL), - m_nArgs(0), - m_nArgsMax(0), - m_pszArgNames(NULL), - m_pszArgValues(NULL) -{ - InitPluginCallbacks(); - memset(&m_NPPFuncs, 0, sizeof(m_NPPFuncs)); -} - -nsPluginHostWnd::~nsPluginHostWnd() -{ -} - -LRESULT nsPluginHostWnd::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -{ - SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_CLIPCHILDREN); - - // Load a list of plugins - CreatePluginList( - PLUGINS_FROM_IE | PLUGINS_FROM_NS4X | - PLUGINS_FROM_FIREFOX | PLUGINS_FROM_MOZILLA); - - HRESULT hr = E_FAIL; - if (m_bstrContentType.Length() == 0 && - m_bstrSource.Length() != 0) - { - USES_CONVERSION; - // Do a late instantiation of the plugin based on the content type of - // the stream data. - m_bCreatePluginFromStreamData = true; - hr = OpenURLStream(OLE2T(m_bstrSource), NULL, NULL, 0); - } - else - { - // Create a plugin based upon the specified content type property - USES_CONVERSION; - hr = LoadPluginByContentType(OLE2T(m_bstrContentType)); - if (SUCCEEDED(hr)) - { - hr = CreatePluginInstance(); - if (m_bstrSource.Length()) - { - OpenURLStream(OLE2T(m_bstrSource), NULL, NULL, 0); - } - } - } - - return SUCCEEDED(hr) ? 0 : -1; -} - -LRESULT nsPluginHostWnd::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -{ - DestroyPluginInstance(); - UnloadPlugin(); - CleanupPluginList(); - return 0; -} - -LRESULT nsPluginHostWnd::OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) -{ - SizeToFitPluginInstance(); - return 0; -} - -LRESULT nsPluginHostWnd::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - PAINTSTRUCT ps; - HDC hdc = BeginPaint(&ps); - - RECT rc; - GetClientRect(&rc); - - if (m_bPluginIsWindowless && m_NPPFuncs.event) - { - if (this->m_bPluginIsTransparent) - { - int x = 0; - const int inc = 20; - for (int i = rc.left; i < rc.right; i += inc) - { - const COLORREF c1 = RGB(255, 120, 120); - const COLORREF c2 = RGB(120, 120, 255); - RECT rcStrip = rc; - HBRUSH hbr = CreateSolidBrush(x % 2 ? c1 : c2); - rcStrip.left = i; - rcStrip.right = i + inc; - FillRect(hdc, &rcStrip, hbr); - DeleteObject(hbr); - x++; - } - } - else - { - FillRect(hdc, &rc, (HBRUSH) GetStockObject(GRAY_BRUSH)); - } - - m_NPWindow.type = NPWindowTypeDrawable; - m_NPWindow.window = hdc; - m_NPWindow.x = 0; - m_NPWindow.y = 0; - m_NPWindow.width = rc.right - rc.left; - m_NPWindow.height = rc.bottom - rc.top; - m_NPWindow.clipRect.left = 0; - m_NPWindow.clipRect.top = 0; - m_NPWindow.clipRect.right = m_NPWindow.width; - m_NPWindow.clipRect.bottom = m_NPWindow.height; - - if (m_NPPFuncs.setwindow) - { - NPError npres = m_NPPFuncs.setwindow(&m_NPP, &m_NPWindow); - } - - NPRect paintRect; - paintRect.left = rc.left; - paintRect.top = rc.top; - paintRect.right = rc.right; - paintRect.bottom = rc.bottom; - - NPEvent evt; - evt.event = WM_PAINT; - evt.wParam = wParam; - evt.lParam = (LPARAM) &paintRect; - m_NPPFuncs.event(&m_NPP, &evt); - } - else - { - FillRect(hdc, &rc, (HBRUSH) GetStockObject(GRAY_BRUSH)); - } - - EndPaint(&ps); - - return 0; -} - -LRESULT nsPluginHostWnd::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) -{ - if (m_bPluginIsWindowless && m_NPPFuncs.event) - { - NPEvent evt; - evt.event = uMsg; - evt.wParam = wParam; - evt.lParam = lParam; - m_NPPFuncs.event(&m_NPP, &evt); - } - return 0; -} - -LRESULT nsPluginHostWnd::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) -{ - if (m_bPluginIsWindowless && m_NPPFuncs.event) - { - NPEvent evt; - evt.event = uMsg; - evt.wParam = wParam; - evt.lParam = lParam; - m_NPPFuncs.event(&m_NPP, &evt); - } - return 0; -} - -LRESULT nsPluginHostWnd::OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) -{ - if (m_bPluginIsWindowless && m_NPPFuncs.event) - { - NPEvent evt; - evt.event = uMsg; - evt.wParam = wParam; - evt.lParam = lParam; - m_NPPFuncs.event(&m_NPP, &evt); - } - return 0; -} - - -/////////////////////////////////////////////////////////////////////////////// - -NPNetscapeFuncs nsPluginHostWnd::g_NPNFuncs; - -HRESULT nsPluginHostWnd::InitPluginCallbacks() -{ - static BOOL gCallbacksSet = FALSE; - if (gCallbacksSet) - { - return S_OK; - } - - gCallbacksSet = TRUE; - - memset(&g_NPNFuncs, 0, sizeof(g_NPNFuncs)); - g_NPNFuncs.size = sizeof(g_NPNFuncs); - g_NPNFuncs.version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; - - g_NPNFuncs.geturl = NewNPN_GetURLProc(NPN_GetURL); - g_NPNFuncs.posturl = NewNPN_PostURLProc(NPN_PostURL); - g_NPNFuncs.requestread = NewNPN_RequestReadProc(NPN_RequestRead); - g_NPNFuncs.newstream = NewNPN_NewStreamProc(NPN_NewStream); - g_NPNFuncs.write = NewNPN_WriteProc(NPN_Write); - g_NPNFuncs.destroystream = NewNPN_DestroyStreamProc(NPN_DestroyStream); - g_NPNFuncs.status = NewNPN_StatusProc(NPN_Status); - g_NPNFuncs.uagent = NewNPN_UserAgentProc(NPN_UserAgent); - g_NPNFuncs.memalloc = NewNPN_MemAllocProc(NPN_MemAlloc); - g_NPNFuncs.memfree = NewNPN_MemFreeProc(NPN_MemFree); - g_NPNFuncs.memflush = NewNPN_MemFlushProc(NPN_MemFlush); - g_NPNFuncs.reloadplugins = NewNPN_ReloadPluginsProc(NPN_ReloadPlugins); - g_NPNFuncs.getJavaEnv = NewNPN_GetJavaEnvProc(NPN_GetJavaEnv); - g_NPNFuncs.getJavaPeer = NewNPN_GetJavaPeerProc(NPN_GetJavaPeer); - g_NPNFuncs.geturlnotify = NewNPN_GetURLNotifyProc(NPN_GetURLNotify); - g_NPNFuncs.posturlnotify = NewNPN_PostURLNotifyProc(NPN_PostURLNotify); - g_NPNFuncs.getvalue = NewNPN_GetValueProc(NPN_GetValue); - g_NPNFuncs.setvalue = NewNPN_SetValueProc(NPN_SetValue); - g_NPNFuncs.invalidaterect = NewNPN_InvalidateRectProc(NPN_InvalidateRect); - g_NPNFuncs.invalidateregion = NewNPN_InvalidateRegionProc(NPN_InvalidateRegion); - g_NPNFuncs.forceredraw = NewNPN_ForceRedrawProc(NPN_ForceRedraw); - - return S_OK; -} - -HRESULT nsPluginHostWnd::GetWebBrowserApp(IWebBrowserApp **pBrowser) -{ - // Override this method if there is a way to get this iface - ATLASSERT(pBrowser); - if (!pBrowser) - { - return E_INVALIDARG; - } - *pBrowser = NULL; - return S_OK; -} - -void nsPluginHostWnd::SetPluginWindowless(bool bWindowless) -{ - m_bPluginIsWindowless = bWindowless; -} - -void nsPluginHostWnd::SetPluginTransparent(bool bTransparent) -{ - m_bPluginIsTransparent = bTransparent; -} - -HRESULT nsPluginHostWnd::GetBaseURL(TCHAR **ppszBaseURL) -{ - ATLASSERT(ppszBaseURL); - *ppszBaseURL = NULL; - - CComPtr cpWebBrowser; - GetWebBrowserApp(&cpWebBrowser); - if (!cpWebBrowser) - { - return E_FAIL; - } - - USES_CONVERSION; - CComBSTR bstrURL; - cpWebBrowser->get_LocationURL(&bstrURL); - - DWORD cbBaseURL = (bstrURL.Length() + 1) * sizeof(WCHAR); - DWORD cbBaseURLUsed = 0; - WCHAR *pszBaseURL = (WCHAR *) malloc(cbBaseURL); - ATLASSERT(pszBaseURL); - - CoInternetParseUrl( - bstrURL.m_str, - PARSE_ROOTDOCUMENT, - 0, - pszBaseURL, - cbBaseURL, - &cbBaseURLUsed, - 0); - - *ppszBaseURL = _tcsdup(W2T(pszBaseURL)); - free(pszBaseURL); - - return S_OK; -} - -HRESULT nsPluginHostWnd::LoadPluginByContentType(const TCHAR *pszContentType) -{ - TCHAR * pszPluginPath = NULL; - - // Set the content type - USES_CONVERSION; - SetPluginContentType(T2OLE(pszContentType)); - - // Search for a plugin that can handle this content - HRESULT hr = FindPluginPathByContentType(pszContentType, &pszPluginPath); - if (FAILED(hr)) - { - // Try the default 'catch-all' plugin - hr = FindPluginPathByContentType(_T("*"), &pszPluginPath); - if (FAILED(hr)) - { - return hr; - } - } - - hr = LoadPlugin(pszPluginPath); - free(pszPluginPath); - - return hr; -} - - - -HRESULT nsPluginHostWnd::GetPluginContentType(BSTR *pVal) -{ - if (!pVal) - { - return E_INVALIDARG; - } - *pVal = m_bstrContentType.Copy(); - return S_OK; -} - -HRESULT nsPluginHostWnd::SetPluginContentType(BSTR newVal) -{ - // Security. Copying the source BSTR this way ensures that embedded NULL - // characters do not end up in the destination BSTR. SysAllocString will - // create a copy truncated at the first NULL char. - m_bstrContentType.Empty(); - m_bstrContentType.Attach(SysAllocString(newVal)); - return S_OK; -} - -HRESULT nsPluginHostWnd::GetPluginSource(BSTR *pVal) -{ - if (!pVal) - { - return E_INVALIDARG; - } - *pVal = m_bstrSource.Copy(); - return S_OK; -} - -HRESULT nsPluginHostWnd::SetPluginSource(BSTR newVal) -{ - // Security. Copying the source BSTR this way ensures that embedded NULL - // characters do not end up in the destination BSTR. SysAllocString will - // create a copy truncated at the first NULL char. - m_bstrSource.Empty(); - m_bstrSource.Attach(SysAllocString(newVal)); - return S_OK; -} - -HRESULT nsPluginHostWnd::GetPluginsPage(BSTR *pVal) -{ - if (!pVal) - { - return E_INVALIDARG; - } - *pVal = m_bstrPluginsPage.Copy(); - return S_OK; -} - -HRESULT nsPluginHostWnd::SetPluginsPage(BSTR newVal) -{ - // Security. Copying the source BSTR this way ensures that embedded NULL - // characters do not end up in the destination BSTR. SysAllocString will - // create a copy truncated at the first NULL char. - m_bstrPluginsPage.Empty(); - m_bstrPluginsPage.Attach(SysAllocString(newVal)); - return S_OK; -} - -HRESULT nsPluginHostWnd::ReadPluginsFromGeckoAppPath(const TCHAR *szAppName) -{ - const TCHAR szGeneralKey[] = _T("SOFTWARE\\Mozilla\\"); - const size_t nGeneralKeyLen = sizeof(szGeneralKey) / sizeof(TCHAR); - - const size_t nMainKeyLen = nGeneralKeyLen + _tcslen(szAppName); - - TCHAR *szMainKey = new TCHAR[nMainKeyLen]; - memset(szMainKey, 0, nMainKeyLen * sizeof(TCHAR)); - _tcscpy(szMainKey, szGeneralKey); - _tcscat(szMainKey, szAppName); - - CRegKey keyGeneral; - if (keyGeneral.Open(HKEY_LOCAL_MACHINE, szMainKey, KEY_READ) == ERROR_SUCCESS) - { - // First find the Current Version - TCHAR szVersion[64]; - const size_t nVersionLen = sizeof(szVersion) / sizeof(szVersion[0]); - memset(szVersion, 0, sizeof(szVersion)); - - DWORD nVersion = nVersionLen; - keyGeneral.QueryStringValue(_T("CurrentVersion"), szVersion, &nVersion); - if (nVersion > 0) - { - TCHAR *szBracket = _tcschr(szVersion, TCHAR('(')); - if (szBracket) - { - while (szBracket >= szVersion) - { - if (*szBracket == TCHAR(' ') || *szBracket == TCHAR('(')) - { - *szBracket = TCHAR('\0'); - szBracket--; - } - else - break; - } - } - nVersion = _tcslen(szVersion); - - TCHAR *szKey = new TCHAR[nMainKeyLen + nVersion + 32]; - _tcscpy(szKey, szMainKey); - _tcscat(szKey, _T(" ")); - _tcscat(szKey, szVersion); - _tcscat(szKey, _T("\\Extensions")); - - CRegKey key; - if (key.Open(HKEY_LOCAL_MACHINE, szKey, KEY_READ) == ERROR_SUCCESS) - { - TCHAR szPluginsDir[_MAX_PATH]; - memset(szPluginsDir, 0, sizeof(szPluginsDir)); - DWORD nPluginsDir = sizeof(szPluginsDir) / sizeof(szPluginsDir[0]); - key.QueryStringValue(_T("Plugins"), szPluginsDir, &nPluginsDir); - if (szPluginsDir[0]) - { - CreatePluginListFrom(szPluginsDir); - } - } - delete []szKey; - } - } - delete []szMainKey; - return S_OK; -} - -HRESULT nsPluginHostWnd::CreatePluginList(unsigned long ulFlags) -{ - // This function trawls through the plugin directory and builds a list - // of plugins and what MIME types each plugin handles. - - CleanupPluginList(); - - // Firefox - if (ulFlags & PLUGINS_FROM_FIREFOX) - { - ReadPluginsFromGeckoAppPath(_T("Mozilla Firefox")); - } - - // Mozilla - if (ulFlags & PLUGINS_FROM_MOZILLA) - { - ReadPluginsFromGeckoAppPath(_T("Mozilla")); - } - - // Try and obtain a path to the plugins in Netscape 4.x - if (ulFlags & PLUGINS_FROM_NS4X) - { - TCHAR szPluginsDir[_MAX_PATH]; - memset(szPluginsDir, 0, sizeof(szPluginsDir)); - - CRegKey keyNS; - const TCHAR *kNav4xKey = _T("Software\\Netscape\\Netscape Navigator"); - if (keyNS.Open(HKEY_LOCAL_MACHINE, kNav4xKey, KEY_READ) == ERROR_SUCCESS) - { - TCHAR szVersion[10]; - DWORD nVersion = sizeof(szVersion) / sizeof(szVersion[0]); - keyNS.QueryValue(szVersion, _T("CurrentVersion"), &nVersion); - - CRegKey keyVersion; - if (keyVersion.Open(keyNS, szVersion, KEY_READ) == ERROR_SUCCESS) - { - CRegKey keyMain; - if (keyMain.Open(keyVersion, _T("Main"), KEY_READ) == ERROR_SUCCESS) - { - DWORD nPluginsDir = sizeof(szPluginsDir) / sizeof(szPluginsDir[0]); - keyMain.QueryValue(szPluginsDir, _T("Plugins Directory"), &nPluginsDir); - keyMain.Close(); - } - keyVersion.Close(); - } - keyNS.Close(); - } - if (szPluginsDir[0]) - { - CreatePluginListFrom(szPluginsDir); - } - } - - // Try and obtain a path to the plugins in Internet Explorer - if (ulFlags & PLUGINS_FROM_IE) - { - TCHAR szPluginsDir[_MAX_PATH]; - memset(szPluginsDir, 0, sizeof(szPluginsDir)); - - CRegKey keyIE; - const TCHAR *kIEKey = _T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\IEXPLORE.EXE"); - if (keyIE.Open(HKEY_LOCAL_MACHINE, kIEKey, KEY_READ) == ERROR_SUCCESS) - { - DWORD nPluginsDir = sizeof(szPluginsDir) / sizeof(szPluginsDir[0]); - keyIE.QueryValue(szPluginsDir, _T("Path"), &nPluginsDir); - - TCHAR *szSemiColon = _tcschr(szPluginsDir, _TCHAR(';')); - if (szSemiColon) - { - *szSemiColon = _TCHAR('\0'); - } - - ULONG nLen = _tcslen(szPluginsDir); - if (nLen > 0 && szPluginsDir[nLen - 1] == _TCHAR('\\')) - { - szPluginsDir[nLen - 1] = _TCHAR('\0'); - } - _tcscat(szPluginsDir, _T("\\Plugins")); - - keyIE.Close(); - } - if (szPluginsDir[0]) - { - CreatePluginListFrom(szPluginsDir); - } - } - - return S_OK; -} - -HRESULT nsPluginHostWnd::CreatePluginListFrom(const TCHAR *szPluginsDir) -{ - HANDLE hFind; - WIN32_FIND_DATA finddata; - - // Change to the plugin directory - TCHAR szCurrentDir[MAX_PATH + 1]; - GetCurrentDirectory(sizeof(szCurrentDir) / sizeof(szCurrentDir[0]), szCurrentDir); - SetCurrentDirectory(szPluginsDir); - - // Search for files matching the "np*dll" pattern - hFind = FindFirstFile(_T("np*dll"), &finddata); - if (hFind != INVALID_HANDLE_VALUE) - { - do { - PluginInfo *pInfo = new PluginInfo; - if (!pInfo) - { - CleanupPluginList(); - SetCurrentDirectory(szCurrentDir); - return E_OUTOFMEMORY; - } - if (SUCCEEDED(GetPluginInfo(finddata.cFileName, pInfo))) - { - pInfo->szPluginName = _tcsdup(finddata.cFileName); - pInfo->szPluginPath = _tcsdup(szPluginsDir); - m_Plugins.AppendElement(pInfo); - } - else - { - ATLTRACE(_T("Error: Cannot plugin info for \"%s\".\n"), finddata.cFileName); - delete pInfo; - } - } while (FindNextFile(hFind, &finddata)); - FindClose(hFind); - } - - SetCurrentDirectory(szCurrentDir); - - return S_OK; -} - - -HRESULT nsPluginHostWnd::CleanupPluginList() -{ - // Free the memory used by the plugin info list - for (unsigned long i = 0; i < m_Plugins.Count(); i++) - { - PluginInfo *pI = m_Plugins[i]; - if (pI->szMIMEType) - free(pI->szMIMEType); - if (pI->szPluginName) - free(pI->szPluginName); - if (pI->szPluginPath) - free(pI->szPluginPath); - free(pI); - } - m_Plugins.Empty(); - return S_OK; -} - - -HRESULT nsPluginHostWnd::GetPluginInfo(const TCHAR *pszPluginPath, PluginInfo *pInfo) -{ - // Get the version info from the plugin - USES_CONVERSION; - DWORD nVersionInfoSize; - DWORD nZero = 0; - void *pVersionInfo = NULL; - nVersionInfoSize = GetFileVersionInfoSize((TCHAR *)pszPluginPath, &nZero); - if (nVersionInfoSize) - { - pVersionInfo = malloc(nVersionInfoSize); - } - if (!pVersionInfo) - { - return E_OUTOFMEMORY; - } - - GetFileVersionInfo((TCHAR *)pszPluginPath, NULL, nVersionInfoSize, pVersionInfo); - - // Extract the MIMEType info - TCHAR *szValue = NULL; - UINT nValueLength = 0; - if (!VerQueryValue(pVersionInfo, - _T("\\StringFileInfo\\040904E4\\MIMEType"), - (void **) &szValue, &nValueLength)) - { - return E_FAIL; - } - - if (pInfo) - { - pInfo->szMIMEType = _tcsdup(szValue); - } - - free(pVersionInfo); - - return S_OK; -} - -HRESULT nsPluginHostWnd::FindPluginPathByContentType(const TCHAR *pszContentType, TCHAR **ppszPluginPath) -{ - *ppszPluginPath = NULL; - - if (pszContentType == NULL) - { - return E_FAIL; - } - - // Search the list of plugins for one that will handle the content type - TCHAR szPluginPath[_MAX_PATH + 1]; - unsigned long nContentType = _tcslen(pszContentType); - for (unsigned long i = 0; i < m_Plugins.Count(); i++) - { - PluginInfo *pI = m_Plugins[i]; - if (pI->szMIMEType) - { - TCHAR *pszMIMEType = pI->szMIMEType; - do { - if (_tcsncmp(pszContentType, pszMIMEType, nContentType) == 0) - { - // Found a match - _tmakepath(szPluginPath, NULL, - pI->szPluginPath, pI->szPluginName, NULL); - *ppszPluginPath = _tcsdup(szPluginPath); - return S_OK; - } - // Check the other types the plugin handles - pszMIMEType = _tcschr(pszMIMEType, TCHAR('|')); - if (pszMIMEType) - { - pszMIMEType++; - } - } while (pszMIMEType && *pszMIMEType); - } - } - - return E_FAIL; -} - -HRESULT nsPluginHostWnd::LoadPlugin(const TCHAR *szPluginPath) -{ - ATLASSERT(m_pLoadedPlugin == NULL); - if (m_pLoadedPlugin) - { - return E_UNEXPECTED; - } - - // TODO critical section - - // Test if the plugin has already been loaded - for (unsigned long i = 0; i < m_LoadedPlugins.Count(); i++) - { - if (_tcscmp(m_LoadedPlugins[i]->szFullPath, szPluginPath) == 0) - { - m_pLoadedPlugin = m_LoadedPlugins[i]; - memcpy(&m_NPPFuncs, &m_pLoadedPlugin->NPPFuncs, sizeof(m_NPPFuncs)); - m_pLoadedPlugin->nRefCount++; - return S_OK; - } - } - - // Plugin library is being loaded for the first time so initialise it - // and store an entry in the loaded plugins array. - - HINSTANCE hInstance = LoadLibrary(szPluginPath); - if (!hInstance) - { - return E_FAIL; - } - - m_pLoadedPlugin = new LoadedPluginInfo; - if (!m_pLoadedPlugin) - { - ATLASSERT(m_pLoadedPlugin); - return E_OUTOFMEMORY; - } - - // Get the plugin function entry points - NP_GETENTRYPOINTS pfnGetEntryPoints = - (NP_GETENTRYPOINTS) GetProcAddress(hInstance, "NP_GetEntryPoints"); - if (pfnGetEntryPoints) - { - pfnGetEntryPoints(&m_NPPFuncs); - } - - // Tell the plugin to initialize itself - NP_PLUGININIT pfnInitialize = (NP_PLUGININIT) - GetProcAddress(hInstance, "NP_Initialize"); - if (!pfnInitialize) - { - pfnInitialize = (NP_PLUGININIT) - GetProcAddress(hInstance, "NP_PluginInit"); - } - if (pfnInitialize) - { - pfnInitialize(&g_NPNFuncs); - } - - // Create a new entry for the plugin - m_pLoadedPlugin->szFullPath = _tcsdup(szPluginPath); - m_pLoadedPlugin->nRefCount = 1; - m_pLoadedPlugin->hInstance = hInstance; - memcpy(&m_pLoadedPlugin->NPPFuncs, &m_NPPFuncs, sizeof(m_NPPFuncs)); - - // Add it to the array - m_LoadedPlugins.AppendElement(m_pLoadedPlugin); - - return S_OK; -} - -HRESULT nsPluginHostWnd::UnloadPlugin() -{ - if (!m_pLoadedPlugin) - { - return E_FAIL; - } - - // TODO critical section - - ATLASSERT(m_pLoadedPlugin->nRefCount > 0); - if (m_pLoadedPlugin->nRefCount == 1) - { - NP_PLUGINSHUTDOWN pfnShutdown = (NP_PLUGINSHUTDOWN) - GetProcAddress( - m_pLoadedPlugin->hInstance, - "NP_Shutdown"); - if (pfnShutdown) - { - pfnShutdown(); - } - FreeLibrary(m_pLoadedPlugin->hInstance); - - // Delete the entry from the array - m_LoadedPlugins.RemoveElement(m_pLoadedPlugin); - free(m_pLoadedPlugin->szFullPath); - delete m_pLoadedPlugin; - } - else - { - m_pLoadedPlugin->nRefCount--; - } - - m_pLoadedPlugin = NULL; - - return S_OK; -} - - -HRESULT nsPluginHostWnd::AddPluginParam(const char *szName, const char *szValue) -{ - ATLASSERT(szName); - ATLASSERT(szValue); - if (!szName || !szValue) - { - return E_INVALIDARG; - } - - // Skip params that already there - for (unsigned long i = 0; i < m_nArgs; i++) - { - if (stricmp(szName, m_pszArgNames[i]) == 0) - { - return S_OK; - } - } - - // Add the value - if (!m_pszArgNames) - { - ATLASSERT(!m_pszArgValues); - m_nArgsMax = kArraySizeIncrement; - m_pszArgNames = (char **) malloc(sizeof(char *) * m_nArgsMax); - m_pszArgValues = (char **) malloc(sizeof(char *) * m_nArgsMax); - } - else if (m_nArgs == m_nArgsMax) - { - m_nArgsMax += kArraySizeIncrement; - m_pszArgNames = (char **) realloc(m_pszArgNames, sizeof(char *) * m_nArgsMax); - m_pszArgValues = (char **) realloc(m_pszArgValues, sizeof(char *) * m_nArgsMax); - } - if (!m_pszArgNames || !m_pszArgValues) - { - return E_OUTOFMEMORY; - } - - m_pszArgNames[m_nArgs] = strdup(szName); - m_pszArgValues[m_nArgs] = strdup(szValue); - - m_nArgs++; - - return S_OK; -} - - -HRESULT nsPluginHostWnd::CreatePluginInstance() -{ - m_NPP.pdata = NULL; - m_NPP.ndata = this; - - USES_CONVERSION; - char *szContentType = strdup(OLE2A(m_bstrContentType.m_str)); - - // Create a child window to house the plugin - RECT rc; - GetClientRect(&rc); -// m_wndPlugin.Create(m_hWnd, rc, NULL, WS_CHILD | WS_VISIBLE); - -// m_NPWindow.window = (void *) m_wndPlugin.m_hWnd; - m_NPWindow.window = (void *) m_hWnd; - m_NPWindow.type = NPWindowTypeWindow; - - if (m_NPPFuncs.newp) - { - // Create the arguments to be fed into the plugin - if (m_bstrSource.m_str) - { - AddPluginParam("SRC", OLE2A(m_bstrSource.m_str)); - } - if (m_bstrContentType.m_str) - { - AddPluginParam("TYPE", OLE2A(m_bstrContentType.m_str)); - } - if (m_bstrPluginsPage.m_str) - { - AddPluginParam("PLUGINSPAGE", OLE2A(m_bstrPluginsPage.m_str)); - } - char szTmp[50]; - sprintf(szTmp, "%d", (int) (rc.right - rc.left)); - AddPluginParam("WIDTH", szTmp); - sprintf(szTmp, "%d", (int) (rc.bottom - rc.top)); - AddPluginParam("HEIGHT", szTmp); - - NPSavedData *pSaved = NULL; - - // Create the plugin instance - NPError npres = m_NPPFuncs.newp(szContentType, &m_NPP, NP_EMBED, - (short) m_nArgs, m_pszArgNames, m_pszArgValues, pSaved); - - if (npres != NPERR_NO_ERROR) - { - return E_FAIL; - } - } - - m_bPluginIsAlive = true; - - SizeToFitPluginInstance(); - - return S_OK; -} - -HRESULT nsPluginHostWnd::DestroyPluginInstance() -{ - if (!m_bPluginIsAlive) - { - return S_OK; - } - - // Destroy the plugin - if (m_NPPFuncs.destroy) - { - NPSavedData *pSavedData = NULL; - NPError npres = m_NPPFuncs.destroy(&m_NPP, &pSavedData); - - // TODO could store saved data instead of just deleting it. - if (pSavedData && pSavedData->buf) - { - NPN_MemFree(pSavedData->buf); - } - } - - // Destroy the arguments - if (m_pszArgNames) - { - for (unsigned long i = 0; i < m_nArgs; i++) - { - free(m_pszArgNames[i]); - } - free(m_pszArgNames); - m_pszArgNames = NULL; - } - if (m_pszArgValues) - { - for (unsigned long i = 0; i < m_nArgs; i++) - { - free(m_pszArgValues[i]); - } - free(m_pszArgValues); - m_pszArgValues = NULL; - } - - //m_wndPlugin.DestroyWindow(); - - m_bPluginIsAlive = false; - - return S_OK; -} - -HRESULT nsPluginHostWnd::SizeToFitPluginInstance() -{ - if (!m_bPluginIsAlive) - { - return S_OK; - } - - // Resize the plugin to fit the window - - RECT rc; - GetClientRect(&rc); - - //m_wndPlugin.SetWindowPos(HWND_TOP, - // rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, - // SWP_NOZORDER); - - m_NPWindow.x = 0; - m_NPWindow.y = 0; - m_NPWindow.width = rc.right - rc.left; - m_NPWindow.height = rc.bottom - rc.top; - m_NPWindow.clipRect.left = 0; - m_NPWindow.clipRect.top = 0; - m_NPWindow.clipRect.right = m_NPWindow.width; - m_NPWindow.clipRect.bottom = m_NPWindow.height; - - if (m_NPPFuncs.setwindow) - { - NPError npres = m_NPPFuncs.setwindow(&m_NPP, &m_NPWindow); - } - - return S_OK; -} - -HRESULT nsPluginHostWnd::OpenURLStream(const TCHAR *szURL, void *pNotifyData, const void *pPostData, unsigned long nPostDataLength) -{ - nsURLDataCallback::OpenURL(this, szURL, pNotifyData, pPostData, nPostDataLength); - return S_OK; -} diff --git a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostWnd.h b/embedding/browser/activex/src/pluginhostctrl/nsPluginHostWnd.h deleted file mode 100644 index 69049f57281..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsPluginHostWnd.h +++ /dev/null @@ -1,263 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef PLUGINHOSTWND_H -#define PLUGINHOSTWND_H - -#include "nsPluginWnd.h" - -class nsURLDataCallback; - -template -class nsSimpleArray -{ - Entry *m_pData; - unsigned long m_nSize; - unsigned long m_nMaxSize; - unsigned long m_nExpandArrayBy; -public: - nsSimpleArray(unsigned long nExpandArrayBy = 10) : - m_pData(NULL), - m_nSize(0), - m_nMaxSize(0), - m_nExpandArrayBy(nExpandArrayBy) - { - } - - virtual ~nsSimpleArray() - { - Empty(); - } - - Entry ElementAt(unsigned long aIndex) const - { - ATLASSERT(aIndex < m_nSize); - return m_pData[aIndex]; - } - - Entry operator[](unsigned long aIndex) const - { - return ElementAt(aIndex); - } - - void AppendElement(Entry entry) - { - if (!m_pData) - { - m_nMaxSize = m_nExpandArrayBy; - m_pData = (Entry *) malloc(sizeof(Entry) * m_nMaxSize); - } - else if (m_nSize == m_nMaxSize) - { - m_nMaxSize += m_nExpandArrayBy; - m_pData = (Entry *) realloc(m_pData, sizeof(Entry) * m_nMaxSize); - } - ATLASSERT(m_pData); - if (m_pData) - { - m_pData[m_nSize++] = entry; - } - } - - void RemoveElementAt(unsigned long nIndex) - { - ATLASSERT(aIndex < m_nSize); - if (nIndex < m_nSize) - { - m_nSize--; - if (m_nSize > 0) - { - m_pData[nIndex] = m_pData[m_nSize - 1]; - m_nSize--; - } - } - } - - void RemoveElement(Entry entry) - { - unsigned long i = 0; - while (i < m_nSize) - { - if (m_pData[i] == entry) - { - m_nSize--; - if (m_nSize > 0) - { - m_pData[i] = m_pData[m_nSize - 1]; - m_nSize--; - } - continue; - } - i++; - } - } - - void Empty() - { - if (m_pData) - { - free(m_pData); - m_pData = NULL; - m_nSize = m_nMaxSize = 0; - } - } - BOOL IsEmpty() const { return m_nSize == 0 ? TRUE : FALSE; } - unsigned long Count() const { return m_nSize; } -}; - - -#define PLUGINS_FROM_IE 0x1 -#define PLUGINS_FROM_NS4X 0x2 -#define PLUGINS_FROM_FIREFOX 0x4 -#define PLUGINS_FROM_MOZILLA 0x8 - -class nsPluginHostWnd : public CWindowImpl -{ -public: - nsPluginHostWnd(); - virtual ~nsPluginHostWnd(); - -DECLARE_WND_CLASS(_T("MozCtrlPluginHostWindow")) - -BEGIN_MSG_MAP(nsPluginHostWnd) - MESSAGE_HANDLER(WM_CREATE, OnCreate) - MESSAGE_HANDLER(WM_DESTROY, OnDestroy) - MESSAGE_HANDLER(WM_SIZE, OnSize) - MESSAGE_HANDLER(WM_PAINT, OnPaint) - MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) - MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) - MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) -// CHAIN_MSG_MAP(CWindowImpl) -END_MSG_MAP() - -// Windows message handlers -public: - 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*/); - LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - -public: - CComBSTR m_bstrText; - -public: - CComBSTR m_bstrContentType; - CComBSTR m_bstrSource; - CComBSTR m_bstrPluginsPage; - - // Array of plugins - struct PluginInfo - { - TCHAR *szPluginPath; - TCHAR *szPluginName; - TCHAR *szMIMEType; - }; - - nsSimpleArray m_Plugins; - - // Array of names and values to pass to the new plugin - unsigned long m_nArgs; - unsigned long m_nArgsMax; - char **m_pszArgNames; - char **m_pszArgValues; - - // Array of loaded plugins which is shared amongst instances of this control - struct LoadedPluginInfo - { - TCHAR *szFullPath; // Path + plugin name - HINSTANCE hInstance; - DWORD nRefCount; - NPPluginFuncs NPPFuncs; - }; - - static nsSimpleArray m_LoadedPlugins; - - LoadedPluginInfo *m_pLoadedPlugin; - - NPWindow m_NPWindow; - - static NPNetscapeFuncs g_NPNFuncs; - static HRESULT InitPluginCallbacks(); - - HRESULT CreatePluginList(unsigned long ulFlags); - HRESULT CreatePluginListFrom(const TCHAR *szPluginsDir); - HRESULT CleanupPluginList(); - HRESULT GetPluginInfo(const TCHAR * pszPluginPath, PluginInfo *pInfo); - -public: - NPP_t m_NPP; - bool m_bPluginIsAlive; - bool m_bCreatePluginFromStreamData; - bool m_bPluginIsWindowless; - bool m_bPluginIsTransparent; - - nsPluginWnd m_wndPlugin; - - // Struct holding pointers to the functions within the plugin - NPPluginFuncs m_NPPFuncs; - - virtual HRESULT GetWebBrowserApp(IWebBrowserApp **pBrowser); - - HRESULT GetBaseURL(TCHAR **szBaseURL); - - HRESULT GetPluginSource(/*[out, retval]*/ BSTR *pVal); - HRESULT SetPluginSource(/*[in]*/ BSTR newVal); - HRESULT GetPluginContentType(/*[out, retval]*/ BSTR *pVal); - HRESULT SetPluginContentType(/*[in]*/ BSTR newVal); - HRESULT GetPluginsPage(/*[out, retval]*/ BSTR *pVal); - HRESULT SetPluginsPage(/*[in]*/ BSTR newVal); - - HRESULT AddPluginParam(const char *szName, const char *szValue); - HRESULT LoadPluginByContentType(const TCHAR *pszContentType); - HRESULT ReadPluginsFromGeckoAppPath(const TCHAR *szAppName); - HRESULT LoadPlugin(const TCHAR *pszPluginPath); - HRESULT FindPluginPathByContentType(const TCHAR *pszContentType, TCHAR **ppszPluginPath); - HRESULT UnloadPlugin(); - - HRESULT OpenURLStream(const TCHAR *szURL, void *pNotifyData, const void *pPostData, unsigned long nDataLength); - - HRESULT CreatePluginInstance(); - HRESULT DestroyPluginInstance(); - HRESULT SizeToFitPluginInstance(); - - void SetPluginWindowless(bool bWindowless); - void SetPluginTransparent(bool bTransparent); -}; - -#endif diff --git a/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.cpp b/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.cpp deleted file mode 100644 index 4ad1a1f1270..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" -#include "pluginhostctrl.h" -#include "nsPluginWnd.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -nsPluginWnd::nsPluginWnd() -{ - -} - -nsPluginWnd::~nsPluginWnd() -{ - -} - -LRESULT nsPluginWnd::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - PAINTSTRUCT ps; - HDC hdc; - RECT rc; - - hdc = BeginPaint(&ps); - GetClientRect(&rc); - FillRect(hdc, &rc, (HBRUSH) GetStockObject(LTGRAY_BRUSH)); - EndPaint(&ps); - - return 0; -} diff --git a/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.h b/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.h deleted file mode 100644 index 6eecba549af..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef __PLUGINWND_H_ -#define __PLUGINWND_H_ - -class nsPluginWnd : public CWindowImpl -{ -public: - nsPluginWnd(); - virtual ~nsPluginWnd(); - - DECLARE_WND_CLASS(_T("MozCtrlPluginWindow")) - -BEGIN_MSG_MAP(nsPluginWnd) - MESSAGE_HANDLER(WM_PAINT, OnPaint) -END_MSG_MAP() - - LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - -}; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.cpp b/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.cpp deleted file mode 100644 index 4e5c156533c..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdafx.h" - -#include - -#include "Pluginhostctrl.h" -#include "nsPluginHostWnd.h" -#include "nsURLDataCallback.h" - - -///////////////////////////////////////////////////////////////////////////// -// nsURLDataCallback - -nsURLDataCallback::nsURLDataCallback() : - m_pOwner(NULL), - m_pNotifyData(NULL), - m_szContentType(NULL), - m_szURL(NULL), - m_nDataPos(0), - m_nDataMax(0), - m_hPostData(NULL), - m_bSaveToTempFile(FALSE), - m_bNotifyOnWrite(TRUE), - m_szTempFileName(NULL), - m_pTempFile(NULL) -{ - memset(&m_NPStream, 0, sizeof(m_NPStream)); - m_NPStream.ndata = this; -} - -nsURLDataCallback::~nsURLDataCallback() -{ - SetPostData(NULL, 0); - SetURL(NULL); - SetContentType(NULL); - if (m_pTempFile) - { - fclose(m_pTempFile); - remove(m_szTempFileName); - } - if (m_szTempFileName) - { - free(m_szTempFileName); - } -} - -void nsURLDataCallback::SetPostData(const void *pData, unsigned long nSize) -{ - // Copy the post data into an HGLOBAL so it can be given to the - // bind object during the call to GetBindInfo - if (m_hPostData) - { - GlobalFree(m_hPostData); - m_hPostData = NULL; - } - if (pData) - { - m_hPostData = GlobalAlloc(GHND, nSize); - if (m_hPostData) - { - void *pPostData = GlobalLock(m_hPostData); - ATLASSERT(pPostData); - memcpy(pPostData, pData, nSize); - GlobalUnlock(m_hPostData); - } - } -} - -HRESULT nsURLDataCallback::OpenURL(nsPluginHostWnd *pOwner, const TCHAR *szURL, void *pNotifyData, const void *pPostData, unsigned long nPostDataSize) -{ - // Create the callback object - CComObject *pCallback = NULL; - CComObject::CreateInstance(&pCallback); - if (!pCallback) - { - return E_OUTOFMEMORY; - } - pCallback->AddRef(); - - // Initialise it - pCallback->SetOwner(pOwner); - pCallback->SetNotifyData(pNotifyData); - if (pPostData && nPostDataSize > 0) - { - pCallback->SetPostData(pPostData, nPostDataSize); - } - - USES_CONVERSION; - pCallback->SetURL(T2CA(szURL)); - - // Create an object window on this thread that will be sent messages when - // something happens on the worker thread. - RECT rcPos = {0, 0, 10, 10}; - pCallback->Create(HWND_DESKTOP, rcPos); - - // Start the worker thread - _beginthread(StreamThread, 0, pCallback); - - return S_OK; -} - -void __cdecl nsURLDataCallback::StreamThread(void *pData) -{ - HRESULT hr = CoInitialize(NULL); - ATLASSERT(SUCCEEDED(hr)); - - CComObject *pThis = (CComObject *) pData; - - // Open the URL - hr = URLOpenStream(NULL, pThis->m_szURL, 0, static_cast(pThis)); - ATLASSERT(SUCCEEDED(hr)); - - // Pump messages until WM_QUIT arrives - BOOL bQuit = FALSE; - while (!bQuit) - { - MSG msg; - if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (GetMessage(&msg, NULL, 0, 0)) - { - DispatchMessage(&msg); - } - else - { - bQuit = TRUE; - } - } - } - - CoUninitialize(); - _endthread(); -} - -/////////////////////////////////////////////////////////////////////////////// -// Windows message handlers - -LRESULT nsURLDataCallback::OnNPPNewStream(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - _NewStreamData *pNewStreamData = (_NewStreamData *) lParam; - - // Notify the plugin that a new stream has been created - if (m_pOwner->m_NPPFuncs.newstream) - { - NPError npres = m_pOwner->m_NPPFuncs.newstream( - pNewStreamData->npp, - pNewStreamData->contenttype, - pNewStreamData->stream, - pNewStreamData->seekable, - pNewStreamData->stype); - - // How does the plugin want its data? - switch (*(pNewStreamData->stype)) - { - case NP_NORMAL: - m_bSaveToTempFile = FALSE; - m_bNotifyOnWrite = TRUE; - break; - case NP_ASFILEONLY: - m_bNotifyOnWrite = FALSE; - m_bSaveToTempFile = TRUE; - break; - case NP_ASFILE: - m_bNotifyOnWrite = TRUE; - m_bSaveToTempFile = TRUE; - break; - case NP_SEEK: - // TODO!!! - ATLASSERT(0); - break; - } - } - return 0; -} - -LRESULT nsURLDataCallback::OnNPPDestroyStream(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - _DestroyStreamData *pDestroyStreamData = (_DestroyStreamData *) lParam; - - // Tell the plugin the name of the temporary file containing the data - if (m_bSaveToTempFile) - { - // Close the file - if (m_pTempFile) - { - fclose(m_pTempFile); - } - - // Determine whether the plugin should be told the name of the temp - // file depending on whether it completed properly or not. - char *szTempFileName = NULL; - if (pDestroyStreamData->reason == NPRES_DONE && - m_pTempFile) - { - szTempFileName = m_szTempFileName; - } - - // Notify the plugin - if (m_pOwner->m_NPPFuncs.asfile) - { - m_pOwner->m_NPPFuncs.asfile( - pDestroyStreamData->npp, - pDestroyStreamData->stream, - szTempFileName); - } - - // Remove the file if it wasn't passed into the plugin - if (!szTempFileName || - !m_pOwner->m_NPPFuncs.asfile) - { - remove(szTempFileName); - } - - // Cleanup strings & pointers - if (m_szTempFileName) - { - free(m_szTempFileName); - m_szTempFileName = NULL; - } - m_pTempFile = NULL; - } - - // Notify the plugin that the stream has been closed - if (m_pOwner->m_NPPFuncs.destroystream) - { - m_pOwner->m_NPPFuncs.destroystream( - pDestroyStreamData->npp, - pDestroyStreamData->stream, - pDestroyStreamData->reason); - } - - return 0; -} - -LRESULT nsURLDataCallback::OnNPPURLNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - _UrlNotifyData *pUrlNotifyData = (_UrlNotifyData *) lParam; - - // Notify the plugin that the url has loaded - if (m_pNotifyData && m_pOwner->m_NPPFuncs.urlnotify) - { - m_pOwner->m_NPPFuncs.urlnotify( - pUrlNotifyData->npp, - pUrlNotifyData->url, - pUrlNotifyData->reason, - pUrlNotifyData->notifydata); - } - return 0; -} - -LRESULT nsURLDataCallback::OnNPPWriteReady(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - _WriteReadyData *pWriteReadyData = (_WriteReadyData *) lParam; - if (m_pOwner->m_NPPFuncs.writeready && - m_bNotifyOnWrite) - { - pWriteReadyData->result = m_pOwner->m_NPPFuncs.writeready( - pWriteReadyData->npp, - pWriteReadyData->stream); - } - - return 0; -} - -LRESULT nsURLDataCallback::OnNPPWrite(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - _WriteData *pWriteData = (_WriteData *) lParam; - -#ifdef DUMP_STREAM_DATA_AS_HEX - // Dumps out the data to the display so you can see it's correct as its - // fed into the plugin. - const int kLineBreakAfter = 16; - const int kSpaceBreakAfter = 8; - ATLTRACE(_T("nsURLDataCallback::OnNPPWrite()\n")); - for (int i = 0; i < pWriteData->len; i++) - { - TCHAR szLine[100]; - TCHAR szTmp[20]; - if (i % kLineBreakAfter == 0) - { - _stprintf(szLine, _T("%04x "), i); - } - unsigned char b = ((unsigned char *) pWriteData->buffer)[i]; - _stprintf(szTmp, _T("%02X "), (unsigned int) b); - _tcscat(szLine, szTmp); - - if (i == pWriteData->len - 1 || - i % kLineBreakAfter == kLineBreakAfter - 1) - { - _tcscat(szLine, _T("\n")); - ATLTRACE(szLine); - } - else if (i % kSpaceBreakAfter == kSpaceBreakAfter - 1) - { - _tcscat(szLine, _T(" ")); - } - } - ATLTRACE(_T("--\n")); -#endif - - if (m_bSaveToTempFile) - { - if (!m_szTempFileName) - { - m_szTempFileName = strdup(_tempnam(NULL, "moz")); - } - if (!m_pTempFile) - { - m_pTempFile = fopen(m_szTempFileName, "wb"); - } - ATLASSERT(m_pTempFile); - if (m_pTempFile) - { - fwrite(pWriteData->buffer, 1, pWriteData->len, m_pTempFile); - } - } - - if (m_pOwner->m_NPPFuncs.write && - m_bNotifyOnWrite) - { - int32 nConsumed = m_pOwner->m_NPPFuncs.write( - pWriteData->npp, - pWriteData->stream, - pWriteData->offset, - pWriteData->len, - pWriteData->buffer); - if (nConsumed < 0) - { - // TODO destroy the stream! - } - ATLASSERT(nConsumed == pWriteData->len); - } - return 0; -} - -LRESULT nsURLDataCallback::OnClassCreatePluginInstance(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - // Test whether the plugin for this content type exists or not and if not, - // create it right now. - if (!m_pOwner->m_bPluginIsAlive && - m_pOwner->m_bCreatePluginFromStreamData) - { - if (FAILED(m_pOwner->LoadPluginByContentType(A2CT(m_szContentType))) || - FAILED(m_pOwner->CreatePluginInstance())) - { - return 1; - } - } - return 0; -} - -LRESULT nsURLDataCallback::OnClassCleanup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - DestroyWindow(); - Release(); - return 0; -} - -/////////////////////////////////////////////////////////////////////////////// -// IBindStatusCallback implementation - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnStartBinding( - /* [in] */ DWORD dwReserved, - /* [in] */ IBinding __RPC_FAR *pib) -{ - ATLTRACE(_T("nsURLDataCallback::OnStartBinding()\n")); - m_cpBinding = pib; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::GetPriority( - /* [out] */ LONG __RPC_FAR *pnPriority) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnLowResource( - /* [in] */ DWORD reserved) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnProgress( - /* [in] */ ULONG ulProgress, - /* [in] */ ULONG ulProgressMax, - /* [in] */ ULONG ulStatusCode, - /* [in] */ LPCWSTR szStatusText) -{ - switch (ulStatusCode) - { - case BINDSTATUS_BEGINDOWNLOADDATA: - case BINDSTATUS_REDIRECTING: - { - USES_CONVERSION; - SetURL(W2A(szStatusText)); - } - break; - - case BINDSTATUS_MIMETYPEAVAILABLE: - { - USES_CONVERSION; - SetContentType(W2A(szStatusText)); - } - break; - } - - m_nDataMax = ulProgressMax; - return S_OK; -} - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnStopBinding( - /* [in] */ HRESULT hresult, - /* [unique][in] */ LPCWSTR szError) -{ - ATLTRACE(_T("nsURLDataCallback::OnStopBinding()\n")); - if (m_pOwner && m_pOwner->m_bPluginIsAlive) - { - // TODO check for aborted ops and send NPRES_USER_BREAK - NPReason reason = SUCCEEDED(hresult) ? NPRES_DONE : NPRES_NETWORK_ERR; - - // Notify the plugin that the stream has been closed - _DestroyStreamData destroyStreamData; - destroyStreamData.npp = &m_pOwner->m_NPP; - destroyStreamData.stream = &m_NPStream; - destroyStreamData.reason = reason; - SendMessage(WM_NPP_DESTROYSTREAM, 0, (LPARAM) &destroyStreamData); - - // Notify the plugin that the url has loaded - _UrlNotifyData urlNotifyData; - urlNotifyData.npp = &m_pOwner->m_NPP; - urlNotifyData.url = m_szURL; - urlNotifyData.reason = reason; - urlNotifyData.notifydata = m_pNotifyData; - SendMessage(WM_NPP_URLNOTIFY, 0, (LPARAM) &urlNotifyData); - } - - m_cpBinding.Release(); - - SendMessage(WM_CLASS_CLEANUP); - PostQuitMessage(0); - - return S_OK; -} - -/* [local] */ HRESULT STDMETHODCALLTYPE nsURLDataCallback::GetBindInfo( - /* [out] */ DWORD __RPC_FAR *grfBINDF, - /* [unique][out][in] */ BINDINFO __RPC_FAR *pbindinfo) -{ - *grfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | - BINDF_GETNEWESTVERSION; - - ULONG cbSize = pbindinfo->cbSize; - memset(pbindinfo, 0, cbSize); // zero out structure - pbindinfo->cbSize = cbSize; - if (m_hPostData) - { - pbindinfo->dwBindVerb = BINDVERB_POST; - pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; - pbindinfo->stgmedData.hGlobal = m_hPostData; - } - else - { - pbindinfo->dwBindVerb = BINDVERB_GET; - } - - return S_OK ; -} - -/* [local] */ HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnDataAvailable( - /* [in] */ DWORD grfBSCF, - /* [in] */ DWORD dwSize, - /* [in] */ FORMATETC __RPC_FAR *pformatetc, - /* [in] */ STGMEDIUM __RPC_FAR *pstgmed) -{ - ATLTRACE(_T("nsURLDataCallback::OnDataAvailable()\n")); - if (pstgmed->tymed != TYMED_ISTREAM || - !pstgmed->pstm) - { - return S_OK; - } - if (!m_pOwner) - { - return S_OK; - } - - // Notify the plugin that a stream has been opened - if (grfBSCF & BSCF_FIRSTDATANOTIFICATION) - { - USES_CONVERSION; - - // Test if there is a plugin yet. If not try and create one for this - // kind of content. - if (SendMessage(WM_CLASS_CREATEPLUGININSTANCE)) - { - m_cpBinding->Abort(); - return S_OK; - } - - // Tell the plugin that there is a new stream of data - m_NPStream.url = m_szURL; - m_NPStream.end = 0; - m_NPStream.lastmodified = 0; - m_NPStream.notifyData = m_pNotifyData; - - uint16 stype = NP_NORMAL; - _NewStreamData newStreamData; - newStreamData.npp = &m_pOwner->m_NPP; - newStreamData.contenttype = m_szContentType; - newStreamData.stream = &m_NPStream; - newStreamData.seekable = FALSE; - newStreamData.stype = &stype; - SendMessage(WM_NPP_NEWSTREAM, 0, (LPARAM) &newStreamData); - } - if (!m_pOwner->m_bPluginIsAlive) - { - return S_OK; - } - - m_NPStream.end = m_nDataMax; - - ATLTRACE(_T("Data for stream %s (%d of %d bytes are available)\n"), m_szURL, dwSize, m_NPStream.end); - - // Feed the stream data into the plugin - HRESULT hr; - char bData[16384]; - while (m_nDataPos < dwSize) - { - ULONG nBytesToRead = dwSize - m_nDataPos; - ULONG nBytesRead = 0; - - if (nBytesToRead > sizeof(bData)) - { - nBytesToRead = sizeof(bData); - } - - // How many bytes can the plugin cope with? - _WriteReadyData writeReadyData; - writeReadyData.npp = &m_pOwner->m_NPP; - writeReadyData.stream = &m_NPStream; - writeReadyData.result = nBytesToRead; - SendMessage(WM_NPP_WRITEREADY, 0, (LPARAM) &writeReadyData); - if (nBytesToRead > writeReadyData.result) - { - nBytesToRead = writeReadyData.result; - } - - // Read 'n' feed - ATLTRACE(_T(" Reading %d bytes\n"), (int) nBytesToRead); - hr = pstgmed->pstm->Read(&bData, nBytesToRead, &nBytesRead); - - _WriteData writeData; - writeData.npp = &m_pOwner->m_NPP; - writeData.stream = &m_NPStream; - writeData.offset = m_nDataPos; - writeData.len = nBytesRead; - writeData.buffer = bData; - SendMessage(WM_NPP_WRITE, 0, (LPARAM) &writeData); - - m_nDataPos += nBytesRead; - } - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::OnObjectAvailable( - /* [in] */ REFIID riid, - /* [iid_is][in] */ IUnknown __RPC_FAR *punk) -{ - return S_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// IAuthenticate implementation - -HRESULT STDMETHODCALLTYPE nsURLDataCallback::Authenticate( - /* [out] */ HWND __RPC_FAR *phwnd, - /* [out] */ LPWSTR __RPC_FAR *pszUsername, - /* [out] */ LPWSTR __RPC_FAR *pszPassword) -{ - ATLTRACE(_T("nsURLDataCallback::Authenticate()\n")); - - // Caller wants to pose a password dialog so get a parent HWND for it. - *phwnd = HWND_DESKTOP; - if (m_pOwner) - { - *phwnd = m_pOwner->m_hWnd; - CComPtr cpBrowser; - m_pOwner->GetWebBrowserApp(&cpBrowser); - if (cpBrowser) - { - long hwnd = NULL; - cpBrowser->get_HWND(&hwnd); - if (hwnd) - { - *phwnd = (HWND) hwnd; - } - } - } - - // Caller will figure these out for itself - *pszUsername = NULL; - *pszPassword = NULL; - - return S_OK; -} diff --git a/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.h b/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.h deleted file mode 100644 index 22315539d3f..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.h +++ /dev/null @@ -1,222 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef __NSURLDATACALLBACK_H_ -#define __NSURLDATACALLBACK_H_ - -#include "resource.h" // main symbols - -#include - -#include "npapi.h" - -class nsPluginHostWnd; - -#define WM_NPP_NEWSTREAM WM_USER -#define WM_NPP_DESTROYSTREAM WM_USER + 1 -#define WM_NPP_URLNOTIFY WM_USER + 2 -#define WM_NPP_WRITEREADY WM_USER + 3 -#define WM_NPP_WRITE WM_USER + 4 - -#define WM_CLASS_CLEANUP WM_USER + 10 -#define WM_CLASS_CREATEPLUGININSTANCE WM_USER + 11 - -struct _DestroyStreamData -{ - NPP npp; - NPStream *stream; - NPReason reason; -}; - -struct _UrlNotifyData -{ - NPP npp; - char *url; - NPReason reason; - void *notifydata; -}; - -struct _NewStreamData -{ - NPP npp; - char *contenttype; - NPStream *stream; - NPBool seekable; - uint16 *stype; -}; - -struct _WriteReadyData -{ - NPP npp; - NPStream *stream; - int32 result; -}; - -struct _WriteData -{ - NPP npp; - NPStream *stream; - int32 offset; - int32 len; - void* buffer; -}; - -///////////////////////////////////////////////////////////////////////////// -// nsURLDataCallback -class ATL_NO_VTABLE nsURLDataCallback : - public CComObjectRootEx, - public CWindowImpl, - public CComCoClass, - public IBindStatusCallback, - public IAuthenticate -{ -public: - nsURLDataCallback(); - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(nsURLDataCallback) - COM_INTERFACE_ENTRY(IBindStatusCallback) - COM_INTERFACE_ENTRY(IAuthenticate) -END_COM_MAP() - - DECLARE_WND_CLASS(_T("MozStreamWindow")) - -BEGIN_MSG_MAP(nsURLDataCallback) - MESSAGE_HANDLER(WM_NPP_NEWSTREAM, OnNPPNewStream) - MESSAGE_HANDLER(WM_NPP_DESTROYSTREAM, OnNPPDestroyStream) - MESSAGE_HANDLER(WM_NPP_URLNOTIFY, OnNPPURLNotify) - MESSAGE_HANDLER(WM_NPP_WRITEREADY, OnNPPWriteReady) - MESSAGE_HANDLER(WM_NPP_WRITE, OnNPPWrite) - MESSAGE_HANDLER(WM_CLASS_CLEANUP, OnClassCleanup) - MESSAGE_HANDLER(WM_CLASS_CREATEPLUGININSTANCE, OnClassCreatePluginInstance) -END_MSG_MAP() - - LRESULT OnNPPNewStream(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnNPPDestroyStream(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnNPPURLNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnNPPWriteReady(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnNPPWrite(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - - LRESULT OnClassCreatePluginInstance(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - LRESULT OnClassCleanup(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - -protected: - virtual ~nsURLDataCallback(); - -protected: - nsPluginHostWnd *m_pOwner; - void *m_pNotifyData; - HGLOBAL m_hPostData; - - NPStream m_NPStream; - unsigned long m_nDataPos; - unsigned long m_nDataMax; - - char *m_szContentType; - char *m_szURL; - - BOOL m_bSaveToTempFile; - BOOL m_bNotifyOnWrite; - FILE *m_pTempFile; - char *m_szTempFileName; - - CComPtr m_cpBinding; - - void SetURL(const char *szURL) - { - if (m_szURL) { free(m_szURL); m_szURL = NULL; } - if (szURL) { m_szURL = strdup(szURL); } - } - void SetContentType(const char *szContentType) - { - if (m_szContentType) { free(m_szContentType); m_szContentType = NULL; } - if (szContentType) { m_szContentType = strdup(szContentType); } - } - void SetPostData(const void *pData, unsigned long nSize); - void SetOwner(nsPluginHostWnd *pOwner) { m_pOwner = pOwner; } - void SetNotifyData(void *pNotifyData) { m_pNotifyData = pNotifyData; } - - static void __cdecl StreamThread(void *pThis); - -public: - static HRESULT OpenURL(nsPluginHostWnd *pOwner, const TCHAR *szURL, void *pNotifyData, const void *pData, unsigned long nSize); - -// IBindStatusCallback -public: - virtual HRESULT STDMETHODCALLTYPE OnStartBinding( - /* [in] */ DWORD dwReserved, - /* [in] */ IBinding __RPC_FAR *pib); - - virtual HRESULT STDMETHODCALLTYPE GetPriority( - /* [out] */ LONG __RPC_FAR *pnPriority); - - virtual HRESULT STDMETHODCALLTYPE OnLowResource( - /* [in] */ DWORD reserved); - - virtual HRESULT STDMETHODCALLTYPE OnProgress( - /* [in] */ ULONG ulProgress, - /* [in] */ ULONG ulProgressMax, - /* [in] */ ULONG ulStatusCode, - /* [in] */ LPCWSTR szStatusText); - - virtual HRESULT STDMETHODCALLTYPE OnStopBinding( - /* [in] */ HRESULT hresult, - /* [unique][in] */ LPCWSTR szError); - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetBindInfo( - /* [out] */ DWORD __RPC_FAR *grfBINDF, - /* [unique][out][in] */ BINDINFO __RPC_FAR *pbindinfo); - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE OnDataAvailable( - /* [in] */ DWORD grfBSCF, - /* [in] */ DWORD dwSize, - /* [in] */ FORMATETC __RPC_FAR *pformatetc, - /* [in] */ STGMEDIUM __RPC_FAR *pstgmed); - - virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable( - /* [in] */ REFIID riid, - /* [iid_is][in] */ IUnknown __RPC_FAR *punk); - -// IAuthenticate -public: - virtual HRESULT STDMETHODCALLTYPE Authenticate( - /* [out] */ HWND __RPC_FAR *phwnd, - /* [out] */ LPWSTR __RPC_FAR *pszUsername, - /* [out] */ LPWSTR __RPC_FAR *pszPassword); -}; - -#endif //__NSURLDATACALLBACK_H_ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginho.bmp b/embedding/browser/activex/src/pluginhostctrl/pluginho.bmp deleted file mode 100644 index 122976492c7..00000000000 Binary files a/embedding/browser/activex/src/pluginhostctrl/pluginho.bmp and /dev/null differ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.cpp b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.cpp deleted file mode 100644 index aadea029400..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - */ - -// pluginhostctrl.cpp : Implementation of DLL Exports. - - -// Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, -// run nmake -f pluginhostctrlps.mk in the project directory. - -#include "stdafx.h" -#include "resource.h" -#include -#include "pluginhostctrl.h" - -#include "pluginhostctrl_i.c" -#include "nsPluginHostCtrl.h" - -CComModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) - OBJECT_ENTRY(CLSID_MozPluginHostCtrl, nsPluginHostCtrl) -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, &LIBID_PLUGINHOSTCTRLLib); - 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) -{ - return _Module.UnregisterServer(TRUE); -} - - diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.def b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.def deleted file mode 100644 index 7366b3dc1cf..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.def +++ /dev/null @@ -1,9 +0,0 @@ -; pluginhostctrl.def : Declares the module parameters. - -LIBRARY "pluginhostctrl.DLL" - -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.dsp b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.dsp deleted file mode 100644 index 50517dda0d9..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.dsp +++ /dev/null @@ -1,272 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pluginhostctrl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=pluginhostctrl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pluginhostctrl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pluginhostctrl.mak" CFG="pluginhostctrl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pluginhostctrl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pluginhostctrl - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "pluginhostctrl - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pluginhostctrl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX- /ZI /Od /I "pluginsdk_include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE RSC /l 0x1809 /d "_DEBUG" -# ADD RSC /l 0x1809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib version.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# Begin Custom Build - Performing registration -OutDir=.\Debug -TargetPath=.\Debug\pluginhostctrl.dll -InputPath=.\Debug\pluginhostctrl.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "pluginhostctrl - Win32 Release MinSize" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseMinSize" -# PROP BASE Intermediate_Dir "ReleaseMinSize" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinSize" -# PROP Intermediate_Dir "ReleaseMinSize" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX- /O1 /I "pluginsdk_include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_MIN_CRT" /D "_ATL_DLL" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x1809 /d "NDEBUG" -# ADD RSC /l 0x1809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib version.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseMinSize -TargetPath=.\ReleaseMinSize\pluginhostctrl.dll -InputPath=.\ReleaseMinSize\pluginhostctrl.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "pluginhostctrl - Win32 Release MinDependency" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseMinDependency" -# PROP BASE Intermediate_Dir "ReleaseMinDependency" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinDependency" -# PROP Intermediate_Dir "ReleaseMinDependency" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX- /O1 /I "pluginsdk_include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x1809 /d "NDEBUG" -# ADD RSC /l 0x1809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib version.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseMinDependency -TargetPath=.\ReleaseMinDependency\pluginhostctrl.dll -InputPath=.\ReleaseMinDependency\pluginhostctrl.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "pluginhostctrl - Win32 Debug" -# Name "pluginhostctrl - Win32 Release MinSize" -# Name "pluginhostctrl - Win32 Release MinDependency" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\npn.cpp -# End Source File -# Begin Source File - -SOURCE=.\nsPluginHostCtrl.cpp -# End Source File -# Begin Source File - -SOURCE=.\nsPluginWnd.cpp -# End Source File -# Begin Source File - -SOURCE=.\nsURLDataCallback.cpp -# End Source File -# Begin Source File - -SOURCE=.\pluginhostctrl.cpp -# End Source File -# Begin Source File - -SOURCE=.\pluginhostctrl.def -# End Source File -# Begin Source File - -SOURCE=.\pluginhostctrl.idl -# ADD MTL /tlb ".\pluginhostctrl.tlb" /h "pluginhostctrl.h" /iid "pluginhostctrl_i.c" /Oicf -# End Source File -# Begin Source File - -SOURCE=.\pluginhostctrl.rc -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\npn.h -# End Source File -# Begin Source File - -SOURCE=.\nsPluginHostCtrl.h -# End Source File -# Begin Source File - -SOURCE=.\nsPluginWnd.h -# End Source File -# Begin Source File - -SOURCE=.\nsURLDataCallback.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\PluginHostCtrl.rgs -# End Source File -# End Group -# Begin Group "Test Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tests\ns4x_reference_test3.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test1.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test2.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test3.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test4.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test5.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test6.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test7.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test8.htm -# End Source File -# Begin Source File - -SOURCE=.\tests\test9.htm -# End Source File -# End Group -# Begin Source File - -SOURCE=.\PluginHostCtrlUI.htm -# End Source File -# End Target -# End Project diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.idl b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.idl deleted file mode 100644 index 8491c2b5eb1..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.idl +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Netscape security libraries. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1994-2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Adam Lock - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -// pluginhostctrl.idl : IDL source for pluginhostctrl.dll -// - -// This file will be processed by the MIDL tool to -// produce the type library (pluginhostctrl.tlb) and marshalling code. - -import "oaidl.idl"; -import "ocidl.idl"; -#include "olectl.h" - - - [ - object, - uuid(A37A5B60-071D-4885-AD8A-CC6B57F691CF), - dual, - helpstring("IMozPluginHostCtrl Interface"), - pointer_default(unique) - ] - interface IMozPluginHostCtrl : IDispatch - { - [propget, id(DISPID_HWND)] - HRESULT Window([out, retval]long* phwnd); - [propput, id(DISPID_TEXT)] - HRESULT Text([in]BSTR strText); - [propget, id(DISPID_TEXT)] - HRESULT Text([out, retval]BSTR* pstrText); - [propget, id(1), helpstring("property PluginContentType")] HRESULT PluginContentType([out, retval] BSTR *pVal); - [propput, id(1), helpstring("property PluginContentType")] HRESULT PluginContentType([in] BSTR newVal); - [propget, id(2), helpstring("property PluginSource")] HRESULT PluginSource([out, retval] BSTR *pVal); - [propput, id(2), helpstring("property PluginSource")] HRESULT PluginSource([in] BSTR newVal); - [propget, id(3), helpstring("property PluginsPage")] HRESULT PluginsPage([out, retval] BSTR *pVal); - [propput, id(3), helpstring("property PluginsPage")] HRESULT PluginsPage([in] BSTR newVal); - }; - -[ - uuid(5C670C1C-33E2-4B67-8D1E-CC2CF8091A0A), - version(1.0), - helpstring("pluginhostctrl 1.0 Type Library") -] -library PLUGINHOSTCTRLLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(A059405B-2AFC-4C24-9140-F9AD6FE2B11B), - helpstring("_IMozPluginHostCtrlEvents Interface") - ] - dispinterface _IMozPluginHostCtrlEvents - { - properties: - methods: - }; - - [ - uuid(DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2), - helpstring("Mozilla PluginHostCtrl Class") - ] - coclass MozPluginHostCtrl - { - [default] interface IMozPluginHostCtrl; - [default, source] dispinterface _IMozPluginHostCtrlEvents; - }; -}; diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.rc b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.rc deleted file mode 100644 index 0430e2f38a2..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.rc +++ /dev/null @@ -1,132 +0,0 @@ -//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 ""pluginhostctrl.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", "pluginhostctrl Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "pluginhostctrl\0" - VALUE "LegalCopyright", "Copyright 2001\0" - VALUE "OriginalFilename", "pluginhostctrl.DLL\0" - VALUE "ProductName", "pluginhostctrl 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 - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_PLUGINHOSTCTRL BITMAP DISCARDABLE "pluginho.bmp" - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_PLUGINHOSTCTRL REGISTRY DISCARDABLE "PluginHostCtrl.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PROJNAME "pluginhostctrl" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -1 TYPELIB "pluginhostctrl.tlb" - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.sln b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.sln deleted file mode 100644 index 8f2dff710ed..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pluginhostctrl", "pluginhostctrl.vcproj", "{2E8F0B45-A837-4C6C-A072-E89771A90B3A}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - ConfigName.2 = Release MinDependency - ConfigName.3 = Release MinSize - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Debug.ActiveCfg = Debug|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Debug.Build.0 = Debug|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release.ActiveCfg = Release MinDependency|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release.Build.0 = Release MinDependency|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release MinDependency.ActiveCfg = Release MinDependency|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release MinDependency.Build.0 = Release MinDependency|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release MinSize.ActiveCfg = Release MinSize|Win32 - {2E8F0B45-A837-4C6C-A072-E89771A90B3A}.Release MinSize.Build.0 = Release MinSize|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.vcproj b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.vcproj deleted file mode 100644 index 2124f75f151..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.vcproj +++ /dev/null @@ -1,373 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.def b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.def deleted file mode 100644 index 579c7338821..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.def +++ /dev/null @@ -1,11 +0,0 @@ - -LIBRARY "pluginhostctrlPS" - -DESCRIPTION 'Proxy/Stub DLL' - -EXPORTS - DllGetClassObject @1 PRIVATE - DllCanUnloadNow @2 PRIVATE - GetProxyDllInfo @3 PRIVATE - DllRegisterServer @4 PRIVATE - DllUnregisterServer @5 PRIVATE diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.mk b/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.mk deleted file mode 100644 index 195c66a66b4..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.mk +++ /dev/null @@ -1,16 +0,0 @@ - -pluginhostctrlps.dll: dlldata.obj pluginhostctrl_p.obj pluginhostctrl_i.obj - link /dll /out:pluginhostctrlps.dll /def:pluginhostctrlps.def /entry:DllMain dlldata.obj pluginhostctrl_p.obj pluginhostctrl_i.obj \ - kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \ - -.c.obj: - cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \ - $< - -clean: - @del pluginhostctrlps.dll - @del pluginhostctrlps.lib - @del pluginhostctrlps.exp - @del dlldata.obj - @del pluginhostctrl_p.obj - @del pluginhostctrl_i.obj diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni.h deleted file mode 100644 index b75c0e55744..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni.h +++ /dev/null @@ -1,1815 +0,0 @@ -/* - * @(#)jni.h 1.26 97/01/27 - */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Java Runtime Interface. - * - * The Initial Developer of the Original Code is - * Sun Microsystems, Inc. and Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1993-1996 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * We used part of Netscape's Java Runtime Interface (JRI) as the starting - * point of our design and implementation. - */ - -#ifndef JNI_H -#define JNI_H - -#include -#include - -/* jni_md.h contains the machine-dependent typedefs for jbyte, jint - and jlong */ - -#include "jni_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * JNI Types - */ - -typedef unsigned char jboolean; -typedef unsigned short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; - -typedef jint jsize; - -#ifdef __cplusplus - -class _jobject {}; -class _jclass : public _jobject {}; -class _jthrowable : public _jobject {}; -class _jstring : public _jobject {}; -class _jarray : public _jobject {}; -class _jbooleanArray : public _jarray {}; -class _jbyteArray : public _jarray {}; -class _jcharArray : public _jarray {}; -class _jshortArray : public _jarray {}; -class _jintArray : public _jarray {}; -class _jlongArray : public _jarray {}; -class _jfloatArray : public _jarray {}; -class _jdoubleArray : public _jarray {}; -class _jobjectArray : public _jarray {}; - -typedef _jobject *jobject; -typedef _jclass *jclass; -typedef _jthrowable *jthrowable; -typedef _jstring *jstring; -typedef _jarray *jarray; -typedef _jbooleanArray *jbooleanArray; -typedef _jbyteArray *jbyteArray; -typedef _jcharArray *jcharArray; -typedef _jshortArray *jshortArray; -typedef _jintArray *jintArray; -typedef _jlongArray *jlongArray; -typedef _jfloatArray *jfloatArray; -typedef _jdoubleArray *jdoubleArray; -typedef _jobjectArray *jobjectArray; - -#else - -struct _jobject; - -typedef struct _jobject *jobject; -typedef jobject jclass; -typedef jobject jthrowable; -typedef jobject jstring; -typedef jobject jarray; -typedef jarray jbooleanArray; -typedef jarray jbyteArray; -typedef jarray jcharArray; -typedef jarray jshortArray; -typedef jarray jintArray; -typedef jarray jlongArray; -typedef jarray jfloatArray; -typedef jarray jdoubleArray; -typedef jarray jobjectArray; - -#endif - -typedef jobject jref; /* For transition---not meant to be part of public - API anymore.*/ - -typedef union jvalue { - jboolean z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong j; - jfloat f; - jdouble d; - jobject l; -} jvalue; - -struct _jfieldID; -typedef struct _jfieldID *jfieldID; - -struct _jmethodID; -typedef struct _jmethodID *jmethodID; - -/* - * jboolean constants - */ - -#define JNI_FALSE 0 -#define JNI_TRUE 1 - -/* - * possible return values for JNI functions. - */ - -#define JNI_OK 0 -#define JNI_ERR (-1) - -/* - * used in ReleaseScalarArrayElements - */ - -#define JNI_COMMIT 1 -#define JNI_ABORT 2 - -/* - * used in RegisterNatives to describe native method name, signature, - * and function pointer. - */ - -typedef struct { - char *name; - char *signature; - void *fnPtr; -} JNINativeMethod; - -/* - * JNI Native Method Interface. - */ - -struct JNINativeInterface_; - -struct JNIEnv_; - -#ifdef __cplusplus -typedef JNIEnv_ JNIEnv; -#else -typedef const struct JNINativeInterface_ *JNIEnv; -#endif - -/* - * JNI Invocation Interface. - */ - -struct JNIInvokeInterface_; - -struct JavaVM_; - -#ifdef __cplusplus -typedef JavaVM_ JavaVM; -#else -typedef const struct JNIInvokeInterface_ *JavaVM; -#endif - -struct JNINativeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - jint (*GetVersion)(JNIEnv *env); - - jclass (*DefineClass) - (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len); - jclass (*FindClass) - (JNIEnv *env, const char *name); - - void *reserved4; - void *reserved5; - void *reserved6; - - jclass (*GetSuperclass) - (JNIEnv *env, jclass sub); - jboolean (*IsAssignableFrom) - (JNIEnv *env, jclass sub, jclass sup); - void *reserved7; - - - jint (*_Throw) - (JNIEnv *env, jthrowable obj); - jint (*ThrowNew) - (JNIEnv *env, jclass clazz, const char *msg); - jthrowable (*ExceptionOccurred) - (JNIEnv *env); - void (*ExceptionDescribe) - (JNIEnv *env); - void (*ExceptionClear) - (JNIEnv *env); - void (*FatalError) - (JNIEnv *env, const char *msg); - void *reserved8; - void *reserved9; - - jobject (*NewGlobalRef) - (JNIEnv *env, jobject lobj); - void (*DeleteGlobalRef) - (JNIEnv *env, jobject gref); - void (*DeleteLocalRef) - (JNIEnv *env, jobject obj); - jboolean (*IsSameObject) - (JNIEnv *env, jobject obj1, jobject obj2); - void *reserved10; - void *reserved11; - - jobject (*AllocObject) - (JNIEnv *env, jclass clazz); - jobject (*NewObject) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (*NewObjectV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (*NewObjectA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jclass (*GetObjectClass) - (JNIEnv *env, jobject obj); - jboolean (*IsInstanceOf) - (JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (*GetMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (*CallObjectMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jobject (*CallObjectMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jobject (*CallObjectMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jboolean (*CallBooleanMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jboolean (*CallBooleanMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jboolean (*CallBooleanMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jbyte (*CallByteMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (*CallByteMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jbyte (*CallByteMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jchar (*CallCharMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (*CallCharMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jchar (*CallCharMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jshort (*CallShortMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (*CallShortMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jshort (*CallShortMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jint (*CallIntMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (*CallIntMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jint (*CallIntMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jlong (*CallLongMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (*CallLongMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jlong (*CallLongMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jfloat (*CallFloatMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (*CallFloatMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jfloat (*CallFloatMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jdouble (*CallDoubleMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jdouble (*CallDoubleMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jdouble (*CallDoubleMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - void (*CallVoidMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (*CallVoidMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - void (*CallVoidMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jobject (*CallNonvirtualObjectMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jobject (*CallNonvirtualObjectMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jobject (*CallNonvirtualObjectMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jboolean (*CallNonvirtualBooleanMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jboolean (*CallNonvirtualBooleanMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jboolean (*CallNonvirtualBooleanMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jbyte (*CallNonvirtualByteMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jbyte (*CallNonvirtualByteMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jbyte (*CallNonvirtualByteMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jchar (*CallNonvirtualCharMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jchar (*CallNonvirtualCharMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jchar (*CallNonvirtualCharMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jshort (*CallNonvirtualShortMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jshort (*CallNonvirtualShortMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jshort (*CallNonvirtualShortMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jint (*CallNonvirtualIntMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jint (*CallNonvirtualIntMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jint (*CallNonvirtualIntMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jlong (*CallNonvirtualLongMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jlong (*CallNonvirtualLongMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jlong (*CallNonvirtualLongMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jfloat (*CallNonvirtualFloatMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jfloat (*CallNonvirtualFloatMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jfloat (*CallNonvirtualFloatMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jdouble (*CallNonvirtualDoubleMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jdouble (*CallNonvirtualDoubleMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jdouble (*CallNonvirtualDoubleMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - void (*CallNonvirtualVoidMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - void (*CallNonvirtualVoidMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - void (*CallNonvirtualVoidMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jfieldID (*GetFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (*GetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (*GetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (*GetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (*GetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (*GetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jint (*GetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (*GetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (*GetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (*GetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - - void (*SetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); - void (*SetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); - void (*SetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (*SetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (*SetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (*SetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (*SetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (*SetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (*SetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); - - jmethodID (*GetStaticMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (*CallStaticObjectMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (*CallStaticObjectMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (*CallStaticObjectMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jboolean (*CallStaticBooleanMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jboolean (*CallStaticBooleanMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jboolean (*CallStaticBooleanMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jbyte (*CallStaticByteMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jbyte (*CallStaticByteMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jbyte (*CallStaticByteMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jchar (*CallStaticCharMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jchar (*CallStaticCharMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jchar (*CallStaticCharMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jshort (*CallStaticShortMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jshort (*CallStaticShortMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jshort (*CallStaticShortMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jint (*CallStaticIntMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jint (*CallStaticIntMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jint (*CallStaticIntMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jlong (*CallStaticLongMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jlong (*CallStaticLongMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jlong (*CallStaticLongMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jfloat (*CallStaticFloatMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jfloat (*CallStaticFloatMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jfloat (*CallStaticFloatMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jdouble (*CallStaticDoubleMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jdouble (*CallStaticDoubleMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jdouble (*CallStaticDoubleMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - void (*CallStaticVoidMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, ...); - void (*CallStaticVoidMethodV) - (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); - void (*CallStaticVoidMethodA) - (JNIEnv *env, jclass cls, jmethodID methodID, jvalue * args); - - jfieldID (*GetStaticFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - jobject (*GetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (*GetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jbyte (*GetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (*GetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (*GetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (*GetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (*GetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (*GetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (*GetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (*SetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); - void (*SetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); - void (*SetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); - void (*SetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); - void (*SetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); - void (*SetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); - void (*SetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); - void (*SetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); - void (*SetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); - - jstring (*NewString) - (JNIEnv *env, const jchar *unicode, jsize len); - jsize (*GetStringLength) - (JNIEnv *env, jstring str); - const jchar *(*GetStringChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (*ReleaseStringChars) - (JNIEnv *env, jstring str, const jchar *chars); - - jstring (*NewStringUTF) - (JNIEnv *env, const char *utf); - jsize (*GetStringUTFLength) - (JNIEnv *env, jstring str); - const char* (*GetStringUTFChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (*ReleaseStringUTFChars) - (JNIEnv *env, jstring str, const char* chars); - - - jsize (*GetArrayLength) - (JNIEnv *env, jarray array); - - jobjectArray (*NewObjectArray) - (JNIEnv *env, jsize len, jclass clazz, jobject init); - jobject (*GetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index); - void (*SetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index, jobject val); - - jbooleanArray (*NewBooleanArray) - (JNIEnv *env, jsize len); - jbyteArray (*NewByteArray) - (JNIEnv *env, jsize len); - jcharArray (*NewCharArray) - (JNIEnv *env, jsize len); - jshortArray (*NewShortArray) - (JNIEnv *env, jsize len); - jintArray (*NewIntArray) - (JNIEnv *env, jsize len); - jlongArray (*NewLongArray) - (JNIEnv *env, jsize len); - jfloatArray (*NewFloatArray) - (JNIEnv *env, jsize len); - jdoubleArray (*NewDoubleArray) - (JNIEnv *env, jsize len); - - jboolean * (*GetBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *isCopy); - jbyte * (*GetByteArrayElements) - (JNIEnv *env, jbyteArray array, jboolean *isCopy); - jchar * (*GetCharArrayElements) - (JNIEnv *env, jcharArray array, jboolean *isCopy); - jshort * (*GetShortArrayElements) - (JNIEnv *env, jshortArray array, jboolean *isCopy); - jint * (*GetIntArrayElements) - (JNIEnv *env, jintArray array, jboolean *isCopy); - jlong * (*GetLongArrayElements) - (JNIEnv *env, jlongArray array, jboolean *isCopy); - jfloat * (*GetFloatArrayElements) - (JNIEnv *env, jfloatArray array, jboolean *isCopy); - jdouble * (*GetDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jboolean *isCopy); - - void (*ReleaseBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); - void (*ReleaseByteArrayElements) - (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); - void (*ReleaseCharArrayElements) - (JNIEnv *env, jcharArray array, jchar *elems, jint mode); - void (*ReleaseShortArrayElements) - (JNIEnv *env, jshortArray array, jshort *elems, jint mode); - void (*ReleaseIntArrayElements) - (JNIEnv *env, jintArray array, jint *elems, jint mode); - void (*ReleaseLongArrayElements) - (JNIEnv *env, jlongArray array, jlong *elems, jint mode); - void (*ReleaseFloatArrayElements) - (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); - void (*ReleaseDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); - - void (*GetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (*GetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (*GetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (*GetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (*GetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (*GetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (*GetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (*GetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - void (*SetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (*SetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (*SetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (*SetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (*SetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (*SetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (*SetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (*SetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - jint (*RegisterNatives) - (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); - jint (*UnregisterNatives) - (JNIEnv *env, jclass clazz); - - jint (*MonitorEnter) - (JNIEnv *env, jobject obj); - jint (*MonitorExit) - (JNIEnv *env, jobject obj); - - jint (*GetJavaVM) - (JNIEnv *env, JavaVM **vm); -}; - -/* - * We use inlined functions for C++ so that programmers can write: - * - * env->FindClass("java/lang/String") - * - * in C++ rather than: - * - * (*env)->FindClass(env, "java/lang/String") - * - * in C. - */ - -struct JNIEnv_ { - const struct JNINativeInterface_ *functions; - void *reserved0; - void *reserved1[6]; -#ifdef __cplusplus - - jint GetVersion() { - return functions->GetVersion(this); - } - jclass DefineClass(const char *name, jobject loader, const jbyte *buf, - jsize len) { - return functions->DefineClass(this, name, loader, buf, len); - } - jclass FindClass(const char *name) { - return functions->FindClass(this, name); - } - jclass GetSuperclass(jclass sub) { - return functions->GetSuperclass(this, sub); - } - jboolean IsAssignableFrom(jclass sub, jclass sup) { - return functions->IsAssignableFrom(this, sub, sup); - } - - jint _Throw(jthrowable obj) { - return functions->_Throw(this, obj); - } - jint ThrowNew(jclass clazz, const char *msg) { - return functions->ThrowNew(this, clazz, msg); - } - jthrowable ExceptionOccurred() { - return functions->ExceptionOccurred(this); - } - void ExceptionDescribe() { - functions->ExceptionDescribe(this); - } - void ExceptionClear() { - functions->ExceptionClear(this); - } - void FatalError(const char *msg) { - functions->FatalError(this, msg); - } - - jobject NewGlobalRef(jobject lobj) { - return functions->NewGlobalRef(this,lobj); - } - void DeleteGlobalRef(jobject gref) { - functions->DeleteGlobalRef(this,gref); - } - void DeleteLocalRef(jobject obj) { - functions->DeleteLocalRef(this, obj); - } - - jboolean IsSameObject(jobject obj1, jobject obj2) { - return functions->IsSameObject(this,obj1,obj2); - } - - jobject AllocObject(jclass clazz) { - return functions->AllocObject(this,clazz); - } - jobject NewObject(jclass clazz, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args, methodID); - result = functions->NewObjectV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject NewObjectV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->NewObjectV(this,clazz,methodID,args); - } - jobject NewObjectA(jclass clazz, jmethodID methodID, - jvalue *args) { - return functions->NewObjectA(this,clazz,methodID,args); - } - - jclass GetObjectClass(jobject obj) { - return functions->GetObjectClass(this,obj); - } - jboolean IsInstanceOf(jobject obj, jclass clazz) { - return functions->IsInstanceOf(this,obj,clazz); - } - - jmethodID GetMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetMethodID(this,clazz,name,sig); - } - - jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallObjectMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jobject CallObjectMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallObjectMethodV(this,obj,methodID,args); - } - jobject CallObjectMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallObjectMethodA(this,obj,methodID,args); - } - - jboolean CallBooleanMethod(jobject obj, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallBooleanMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallBooleanMethodV(this,obj,methodID,args); - } - jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallBooleanMethodA(this,obj,methodID, args); - } - - jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallByteMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jbyte CallByteMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallByteMethodV(this,obj,methodID,args); - } - jbyte CallByteMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallByteMethodA(this,obj,methodID,args); - } - - jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallCharMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jchar CallCharMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallCharMethodV(this,obj,methodID,args); - } - jchar CallCharMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallCharMethodA(this,obj,methodID,args); - } - - jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallShortMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jshort CallShortMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallShortMethodV(this,obj,methodID,args); - } - jshort CallShortMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallShortMethodA(this,obj,methodID,args); - } - - jint CallIntMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallIntMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jint CallIntMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallIntMethodV(this,obj,methodID,args); - } - jint CallIntMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallIntMethodA(this,obj,methodID,args); - } - - jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallLongMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jlong CallLongMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallLongMethodV(this,obj,methodID,args); - } - jlong CallLongMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallLongMethodA(this,obj,methodID,args); - } - - jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallFloatMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jfloat CallFloatMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallFloatMethodV(this,obj,methodID,args); - } - jfloat CallFloatMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallFloatMethodA(this,obj,methodID,args); - } - - jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallDoubleMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallDoubleMethodV(this,obj,methodID,args); - } - jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallDoubleMethodA(this,obj,methodID,args); - } - - void CallVoidMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallVoidMethodV(this,obj,methodID,args); - va_end(args); - } - void CallVoidMethodV(jobject obj, jmethodID methodID, - va_list args) { - functions->CallVoidMethodV(this,obj,methodID,args); - } - void CallVoidMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - functions->CallVoidMethodA(this,obj,methodID,args); - } - - jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - } - jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualObjectMethodA(this,obj,clazz, - methodID,args); - } - - jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - } - jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, - methodID, args); - } - - jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - } - jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualByteMethodA(this,obj,clazz, - methodID,args); - } - - jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - } - jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualCharMethodA(this,obj,clazz, - methodID,args); - } - - jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - } - jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualShortMethodA(this,obj,clazz, - methodID,args); - } - - jint CallNonvirtualIntMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - } - jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualIntMethodA(this,obj,clazz, - methodID,args); - } - - jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - } - jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualLongMethodA(this,obj,clazz, - methodID,args); - } - - jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - } - jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - return functions->CallNonvirtualFloatMethodA(this,obj,clazz, - methodID,args); - } - - jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - } - jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, - methodID,args); - } - - void CallNonvirtualVoidMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - va_end(args); - } - void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - } - void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); - } - - jfieldID GetFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetFieldID(this,clazz,name,sig); - } - - jobject GetObjectField(jobject obj, jfieldID fieldID) { - return functions->GetObjectField(this,obj,fieldID); - } - jboolean GetBooleanField(jobject obj, jfieldID fieldID) { - return functions->GetBooleanField(this,obj,fieldID); - } - jbyte GetByteField(jobject obj, jfieldID fieldID) { - return functions->GetByteField(this,obj,fieldID); - } - jchar GetCharField(jobject obj, jfieldID fieldID) { - return functions->GetCharField(this,obj,fieldID); - } - jshort GetShortField(jobject obj, jfieldID fieldID) { - return functions->GetShortField(this,obj,fieldID); - } - jint GetIntField(jobject obj, jfieldID fieldID) { - return functions->GetIntField(this,obj,fieldID); - } - jlong GetLongField(jobject obj, jfieldID fieldID) { - return functions->GetLongField(this,obj,fieldID); - } - jfloat GetFloatField(jobject obj, jfieldID fieldID) { - return functions->GetFloatField(this,obj,fieldID); - } - jdouble GetDoubleField(jobject obj, jfieldID fieldID) { - return functions->GetDoubleField(this,obj,fieldID); - } - - void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { - functions->SetObjectField(this,obj,fieldID,val); - } - void SetBooleanField(jobject obj, jfieldID fieldID, - jboolean val) { - functions->SetBooleanField(this,obj,fieldID,val); - } - void SetByteField(jobject obj, jfieldID fieldID, - jbyte val) { - functions->SetByteField(this,obj,fieldID,val); - } - void SetCharField(jobject obj, jfieldID fieldID, - jchar val) { - functions->SetCharField(this,obj,fieldID,val); - } - void SetShortField(jobject obj, jfieldID fieldID, - jshort val) { - functions->SetShortField(this,obj,fieldID,val); - } - void SetIntField(jobject obj, jfieldID fieldID, - jint val) { - functions->SetIntField(this,obj,fieldID,val); - } - void SetLongField(jobject obj, jfieldID fieldID, - jlong val) { - functions->SetLongField(this,obj,fieldID,val); - } - void SetFloatField(jobject obj, jfieldID fieldID, - jfloat val) { - functions->SetFloatField(this,obj,fieldID,val); - } - void SetDoubleField(jobject obj, jfieldID fieldID, - jdouble val) { - functions->SetDoubleField(this,obj,fieldID,val); - } - - jmethodID GetStaticMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticMethodID(this,clazz,name,sig); - } - - jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, - ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->CallStaticObjectMethodV(this,clazz,methodID,args); - } - jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, - jvalue *args) { - return functions->CallStaticObjectMethodA(this,clazz,methodID,args); - } - - jboolean CallStaticBooleanMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jboolean CallStaticBooleanMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - } - jboolean CallStaticBooleanMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); - } - - jbyte CallStaticByteMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallStaticByteMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jbyte CallStaticByteMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticByteMethodV(this,clazz,methodID,args); - } - jbyte CallStaticByteMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticByteMethodA(this,clazz,methodID,args); - } - - jchar CallStaticCharMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallStaticCharMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jchar CallStaticCharMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticCharMethodV(this,clazz,methodID,args); - } - jchar CallStaticCharMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticCharMethodA(this,clazz,methodID,args); - } - - jshort CallStaticShortMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallStaticShortMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jshort CallStaticShortMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticShortMethodV(this,clazz,methodID,args); - } - jshort CallStaticShortMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticShortMethodA(this,clazz,methodID,args); - } - - jint CallStaticIntMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallStaticIntMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jint CallStaticIntMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticIntMethodV(this,clazz,methodID,args); - } - jint CallStaticIntMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticIntMethodA(this,clazz,methodID,args); - } - - jlong CallStaticLongMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallStaticLongMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jlong CallStaticLongMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticLongMethodV(this,clazz,methodID,args); - } - jlong CallStaticLongMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticLongMethodA(this,clazz,methodID,args); - } - - jfloat CallStaticFloatMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jfloat CallStaticFloatMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticFloatMethodV(this,clazz,methodID,args); - } - jfloat CallStaticFloatMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticFloatMethodA(this,clazz,methodID,args); - } - - jdouble CallStaticDoubleMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jdouble CallStaticDoubleMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - } - jdouble CallStaticDoubleMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); - } - - void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallStaticVoidMethodV(this,cls,methodID,args); - va_end(args); - } - void CallStaticVoidMethodV(jclass cls, jmethodID methodID, - va_list args) { - functions->CallStaticVoidMethodV(this,cls,methodID,args); - } - void CallStaticVoidMethodA(jclass cls, jmethodID methodID, - jvalue * args) { - functions->CallStaticVoidMethodA(this,cls,methodID,args); - } - - jfieldID GetStaticFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticFieldID(this,clazz,name,sig); - } - jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticObjectField(this,clazz,fieldID); - } - jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticBooleanField(this,clazz,fieldID); - } - jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticByteField(this,clazz,fieldID); - } - jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticCharField(this,clazz,fieldID); - } - jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticShortField(this,clazz,fieldID); - } - jint GetStaticIntField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticIntField(this,clazz,fieldID); - } - jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticLongField(this,clazz,fieldID); - } - jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticFloatField(this,clazz,fieldID); - } - jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticDoubleField(this,clazz,fieldID); - } - - void SetStaticObjectField(jclass clazz, jfieldID fieldID, - jobject value) { - functions->SetStaticObjectField(this,clazz,fieldID,value); - } - void SetStaticBooleanField(jclass clazz, jfieldID fieldID, - jboolean value) { - functions->SetStaticBooleanField(this,clazz,fieldID,value); - } - void SetStaticByteField(jclass clazz, jfieldID fieldID, - jbyte value) { - functions->SetStaticByteField(this,clazz,fieldID,value); - } - void SetStaticCharField(jclass clazz, jfieldID fieldID, - jchar value) { - functions->SetStaticCharField(this,clazz,fieldID,value); - } - void SetStaticShortField(jclass clazz, jfieldID fieldID, - jshort value) { - functions->SetStaticShortField(this,clazz,fieldID,value); - } - void SetStaticIntField(jclass clazz, jfieldID fieldID, - jint value) { - functions->SetStaticIntField(this,clazz,fieldID,value); - } - void SetStaticLongField(jclass clazz, jfieldID fieldID, - jlong value) { - functions->SetStaticLongField(this,clazz,fieldID,value); - } - void SetStaticFloatField(jclass clazz, jfieldID fieldID, - jfloat value) { - functions->SetStaticFloatField(this,clazz,fieldID,value); - } - void SetStaticDoubleField(jclass clazz, jfieldID fieldID, - jdouble value) { - functions->SetStaticDoubleField(this,clazz,fieldID,value); - } - - jstring NewString(const jchar *unicode, jsize len) { - return functions->NewString(this,unicode,len); - } - jsize GetStringLength(jstring str) { - return functions->GetStringLength(this,str); - } - const jchar *GetStringChars(jstring str, jboolean *isCopy) { - return functions->GetStringChars(this,str,isCopy); - } - void ReleaseStringChars(jstring str, const jchar *chars) { - functions->ReleaseStringChars(this,str,chars); - } - - jstring NewStringUTF(const char *utf) { - return functions->NewStringUTF(this,utf); - } - jsize GetStringUTFLength(jstring str) { - return functions->GetStringUTFLength(this,str); - } - const char* GetStringUTFChars(jstring str, jboolean *isCopy) { - return functions->GetStringUTFChars(this,str,isCopy); - } - void ReleaseStringUTFChars(jstring str, const char* chars) { - functions->ReleaseStringUTFChars(this,str,chars); - } - - jsize GetArrayLength(jarray array) { - return functions->GetArrayLength(this,array); - } - - jobjectArray NewObjectArray(jsize len, jclass clazz, - jobject init) { - return functions->NewObjectArray(this,len,clazz,init); - } - jobject GetObjectArrayElement(jobjectArray array, jsize index) { - return functions->GetObjectArrayElement(this,array,index); - } - void SetObjectArrayElement(jobjectArray array, jsize index, - jobject val) { - functions->SetObjectArrayElement(this,array,index,val); - } - - jbooleanArray NewBooleanArray(jsize len) { - return functions->NewBooleanArray(this,len); - } - jbyteArray NewByteArray(jsize len) { - return functions->NewByteArray(this,len); - } - jcharArray NewCharArray(jsize len) { - return functions->NewCharArray(this,len); - } - jshortArray NewShortArray(jsize len) { - return functions->NewShortArray(this,len); - } - jintArray NewIntArray(jsize len) { - return functions->NewIntArray(this,len); - } - jlongArray NewLongArray(jsize len) { - return functions->NewLongArray(this,len); - } - jfloatArray NewFloatArray(jsize len) { - return functions->NewFloatArray(this,len); - } - jdoubleArray NewDoubleArray(jsize len) { - return functions->NewDoubleArray(this,len); - } - - jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { - return functions->GetBooleanArrayElements(this,array,isCopy); - } - jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { - return functions->GetByteArrayElements(this,array,isCopy); - } - jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { - return functions->GetCharArrayElements(this,array,isCopy); - } - jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { - return functions->GetShortArrayElements(this,array,isCopy); - } - jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { - return functions->GetIntArrayElements(this,array,isCopy); - } - jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { - return functions->GetLongArrayElements(this,array,isCopy); - } - jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { - return functions->GetFloatArrayElements(this,array,isCopy); - } - jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { - return functions->GetDoubleArrayElements(this,array,isCopy); - } - - void ReleaseBooleanArrayElements(jbooleanArray array, - jboolean *elems, - jint mode) { - functions->ReleaseBooleanArrayElements(this,array,elems,mode); - } - void ReleaseByteArrayElements(jbyteArray array, - jbyte *elems, - jint mode) { - functions->ReleaseByteArrayElements(this,array,elems,mode); - } - void ReleaseCharArrayElements(jcharArray array, - jchar *elems, - jint mode) { - functions->ReleaseCharArrayElements(this,array,elems,mode); - } - void ReleaseShortArrayElements(jshortArray array, - jshort *elems, - jint mode) { - functions->ReleaseShortArrayElements(this,array,elems,mode); - } - void ReleaseIntArrayElements(jintArray array, - jint *elems, - jint mode) { - functions->ReleaseIntArrayElements(this,array,elems,mode); - } - void ReleaseLongArrayElements(jlongArray array, - jlong *elems, - jint mode) { - functions->ReleaseLongArrayElements(this,array,elems,mode); - } - void ReleaseFloatArrayElements(jfloatArray array, - jfloat *elems, - jint mode) { - functions->ReleaseFloatArrayElements(this,array,elems,mode); - } - void ReleaseDoubleArrayElements(jdoubleArray array, - jdouble *elems, - jint mode) { - functions->ReleaseDoubleArrayElements(this,array,elems,mode); - } - - void GetBooleanArrayRegion(jbooleanArray array, - jsize start, jsize len, jboolean *buf) { - functions->GetBooleanArrayRegion(this,array,start,len,buf); - } - void GetByteArrayRegion(jbyteArray array, - jsize start, jsize len, jbyte *buf) { - functions->GetByteArrayRegion(this,array,start,len,buf); - } - void GetCharArrayRegion(jcharArray array, - jsize start, jsize len, jchar *buf) { - functions->GetCharArrayRegion(this,array,start,len,buf); - } - void GetShortArrayRegion(jshortArray array, - jsize start, jsize len, jshort *buf) { - functions->GetShortArrayRegion(this,array,start,len,buf); - } - void GetIntArrayRegion(jintArray array, - jsize start, jsize len, jint *buf) { - functions->GetIntArrayRegion(this,array,start,len,buf); - } - void GetLongArrayRegion(jlongArray array, - jsize start, jsize len, jlong *buf) { - functions->GetLongArrayRegion(this,array,start,len,buf); - } - void GetFloatArrayRegion(jfloatArray array, - jsize start, jsize len, jfloat *buf) { - functions->GetFloatArrayRegion(this,array,start,len,buf); - } - void GetDoubleArrayRegion(jdoubleArray array, - jsize start, jsize len, jdouble *buf) { - functions->GetDoubleArrayRegion(this,array,start,len,buf); - } - - void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, - jboolean *buf) { - functions->SetBooleanArrayRegion(this,array,start,len,buf); - } - void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, - jbyte *buf) { - functions->SetByteArrayRegion(this,array,start,len,buf); - } - void SetCharArrayRegion(jcharArray array, jsize start, jsize len, - jchar *buf) { - functions->SetCharArrayRegion(this,array,start,len,buf); - } - void SetShortArrayRegion(jshortArray array, jsize start, jsize len, - jshort *buf) { - functions->SetShortArrayRegion(this,array,start,len,buf); - } - void SetIntArrayRegion(jintArray array, jsize start, jsize len, - jint *buf) { - functions->SetIntArrayRegion(this,array,start,len,buf); - } - void SetLongArrayRegion(jlongArray array, jsize start, jsize len, - jlong *buf) { - functions->SetLongArrayRegion(this,array,start,len,buf); - } - void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, - jfloat *buf) { - functions->SetFloatArrayRegion(this,array,start,len,buf); - } - void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, - jdouble *buf) { - functions->SetDoubleArrayRegion(this,array,start,len,buf); - } - - jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - return functions->RegisterNatives(this,clazz,methods,nMethods); - } - jint UnregisterNatives(jclass clazz) { - return functions->UnregisterNatives(this,clazz); - } - - jint MonitorEnter(jobject obj) { - return functions->MonitorEnter(this,obj); - } - jint MonitorExit(jobject obj) { - return functions->MonitorExit(this,obj); - } - - jint GetJavaVM(JavaVM **vm) { - return functions->GetJavaVM(this,vm); - } - -#endif /* __cplusplus */ -}; - -/* These structures will be VM-specific. */ - -typedef struct JDK1_1InitArgs { - jint reserved0; - void *reserved1; - - jint checkSource; - jint nativeStackSize; - jint javaStackSize; - jint minHeapSize; - jint maxHeapSize; - jint verifyMode; - char *classpath; - - jint (*vfprintf)(FILE *fp, const char *format, va_list args); - void (*exit)(jint code); - void (*abort)(); - - jint enableClassGC; - jint enableVerboseGC; - jint disableAsyncGC; - jint verbose; - jint debugAgent; - jint debugPort; -} JDK1_1InitArgs; - -typedef struct JDK1_1AttachArgs { - void * __padding; /* C compilers don't allow empty structures. */ -} JDK1_1AttachArgs; - -/* End VM-specific. */ - -struct JNIInvokeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - jint (*DestroyJavaVM)(JavaVM *vm); - - jint (*AttachCurrentThread) - (JavaVM *vm, JNIEnv **penv, void *args); - - jint (*DetachCurrentThread)(JavaVM *vm); -}; - -struct JavaVM_ { - const struct JNIInvokeInterface_ *functions; - void *reserved0; - void *reserved1; - void *reserved2; -#ifdef __cplusplus - - jint DestroyJavaVM() { - return functions->DestroyJavaVM(this); - } - jint AttachCurrentThread(JNIEnv **penv, void *args) { - return functions->AttachCurrentThread(this, penv, args); - } - jint DetachCurrentThread() { - return functions->DetachCurrentThread(this); - } - -#endif -}; - -void JNICALL JNI_GetDefaultJavaVMInitArgs(void *); - -jint JNICALL JNI_CreateJavaVM(JavaVM **, JNIEnv **, void *); - -jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* JNI_H */ - - diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni_md.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni_md.h deleted file mode 100644 index fd7c0786bba..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni_md.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Java Runtime Interface. - * - * The Initial Developer of the Original Code is - * Sun Microsystems, Inc. - * Portions created by the Initial Developer are Copyright (C) 1993-1996 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef JNI_MD_H -#define JNI_MD_H - -#include "jri_md.h" - -#define JNICALL JRI_CALLBACK - -#ifdef XP_WIN -#define JNIEXPORT __declspec(dllexport) -#else -#define JNIEXPORT -#endif - -#endif /* JNI_MD_H */ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri.h deleted file mode 100644 index 590be8d0074..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri.h +++ /dev/null @@ -1,685 +0,0 @@ -/* -*- Mode: C; tab-width: 4; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Java Runtime Interface. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1996 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef JRI_H -#define JRI_H - -#include "jritypes.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/******************************************************************************* - * JRIEnv - ******************************************************************************/ - -/* The type of the JRIEnv interface. */ -typedef struct JRIEnvInterface JRIEnvInterface; - -/* The type of a JRIEnv instance. */ -typedef const JRIEnvInterface* JRIEnv; - -/******************************************************************************* - * JRIEnv Operations - ******************************************************************************/ - -#define JRI_DefineClass(env, classLoader, buf, bufLen) \ - (((*(env))->DefineClass)(env, JRI_DefineClass_op, classLoader, buf, bufLen)) - -#define JRI_FindClass(env, name) \ - (((*(env))->FindClass)(env, JRI_FindClass_op, name)) - -#define JRI_Throw(env, obj) \ - (((*(env))->Throw)(env, JRI_Throw_op, obj)) - -#define JRI_ThrowNew(env, clazz, message) \ - (((*(env))->ThrowNew)(env, JRI_ThrowNew_op, clazz, message)) - -#define JRI_ExceptionOccurred(env) \ - (((*(env))->ExceptionOccurred)(env, JRI_ExceptionOccurred_op)) - -#define JRI_ExceptionDescribe(env) \ - (((*(env))->ExceptionDescribe)(env, JRI_ExceptionDescribe_op)) - -#define JRI_ExceptionClear(env) \ - (((*(env))->ExceptionClear)(env, JRI_ExceptionClear_op)) - -#define JRI_NewGlobalRef(env, ref) \ - (((*(env))->NewGlobalRef)(env, JRI_NewGlobalRef_op, ref)) - -#define JRI_DisposeGlobalRef(env, gref) \ - (((*(env))->DisposeGlobalRef)(env, JRI_DisposeGlobalRef_op, gref)) - -#define JRI_GetGlobalRef(env, gref) \ - (((*(env))->GetGlobalRef)(env, JRI_GetGlobalRef_op, gref)) - -#define JRI_SetGlobalRef(env, gref, ref) \ - (((*(env))->SetGlobalRef)(env, JRI_SetGlobalRef_op, gref, ref)) - -#define JRI_IsSameObject(env, a, b) \ - (((*(env))->IsSameObject)(env, JRI_IsSameObject_op, a, b)) - -#define JRI_NewObject(env) ((*(env))->NewObject) -#define JRI_NewObjectV(env, clazz, methodID, args) \ - (((*(env))->NewObjectV)(env, JRI_NewObject_op_va_list, clazz, methodID, args)) -#define JRI_NewObjectA(env, clazz, method, args) \ - (((*(env))->NewObjectA)(env, JRI_NewObject_op_array, clazz, methodID, args)) - -#define JRI_GetObjectClass(env, obj) \ - (((*(env))->GetObjectClass)(env, JRI_GetObjectClass_op, obj)) - -#define JRI_IsInstanceOf(env, obj, clazz) \ - (((*(env))->IsInstanceOf)(env, JRI_IsInstanceOf_op, obj, clazz)) - -#define JRI_GetMethodID(env, clazz, name, sig) \ - (((*(env))->GetMethodID)(env, JRI_GetMethodID_op, clazz, name, sig)) - -#define JRI_CallMethod(env) ((*(env))->CallMethod) -#define JRI_CallMethodV(env, obj, methodID, args) \ - (((*(env))->CallMethodV)(env, JRI_CallMethod_op_va_list, obj, methodID, args)) -#define JRI_CallMethodA(env, obj, methodID, args) \ - (((*(env))->CallMethodA)(env, JRI_CallMethod_op_array, obj, methodID, args)) - -#define JRI_CallMethodBoolean(env) ((*(env))->CallMethodBoolean) -#define JRI_CallMethodBooleanV(env, obj, methodID, args) \ - (((*(env))->CallMethodBooleanV)(env, JRI_CallMethodBoolean_op_va_list, obj, methodID, args)) -#define JRI_CallMethodBooleanA(env, obj, methodID, args) \ - (((*(env))->CallMethodBooleanA)(env, JRI_CallMethodBoolean_op_array, obj, methodID, args)) - -#define JRI_CallMethodByte(env) ((*(env))->CallMethodByte) -#define JRI_CallMethodByteV(env, obj, methodID, args) \ - (((*(env))->CallMethodByteV)(env, JRI_CallMethodByte_op_va_list, obj, methodID, args)) -#define JRI_CallMethodByteA(env, obj, methodID, args) \ - (((*(env))->CallMethodByteA)(env, JRI_CallMethodByte_op_array, obj, methodID, args)) - -#define JRI_CallMethodChar(env) ((*(env))->CallMethodChar) -#define JRI_CallMethodCharV(env, obj, methodID, args) \ - (((*(env))->CallMethodCharV)(env, JRI_CallMethodChar_op_va_list, obj, methodID, args)) -#define JRI_CallMethodCharA(env, obj, methodID, args) \ - (((*(env))->CallMethodCharA)(env, JRI_CallMethodChar_op_array, obj, methodID, args)) - -#define JRI_CallMethodShort(env) ((*(env))->CallMethodShort) -#define JRI_CallMethodShortV(env, obj, methodID, args) \ - (((*(env))->CallMethodShortV)(env, JRI_CallMethodShort_op_va_list, obj, methodID, args)) -#define JRI_CallMethodShortA(env, obj, methodID, args) \ - (((*(env))->CallMethodShortA)(env, JRI_CallMethodShort_op_array, obj, methodID, args)) - -#define JRI_CallMethodInt(env) ((*(env))->CallMethodInt) -#define JRI_CallMethodIntV(env, obj, methodID, args) \ - (((*(env))->CallMethodIntV)(env, JRI_CallMethodInt_op_va_list, obj, methodID, args)) -#define JRI_CallMethodIntA(env, obj, methodID, args) \ - (((*(env))->CallMethodIntA)(env, JRI_CallMethodInt_op_array, obj, methodID, args)) - -#define JRI_CallMethodLong(env) ((*(env))->CallMethodLong) -#define JRI_CallMethodLongV(env, obj, methodID, args) \ - (((*(env))->CallMethodLongV)(env, JRI_CallMethodLong_op_va_list, obj, methodID, args)) -#define JRI_CallMethodLongA(env, obj, methodID, args) \ - (((*(env))->CallMethodLongA)(env, JRI_CallMethodLong_op_array, obj, methodID, args)) - -#define JRI_CallMethodFloat(env) ((*(env))->CallMethodFloat) -#define JRI_CallMethodFloatV(env, obj, methodID, args) \ - (((*(env))->CallMethodFloatV)(env, JRI_CallMethodFloat_op_va_list, obj, methodID, args)) -#define JRI_CallMethodFloatA(env, obj, methodID, args) \ - (((*(env))->CallMethodFloatA)(env, JRI_CallMethodFloat_op_array, obj, methodID, args)) - -#define JRI_CallMethodDouble(env) ((*(env))->CallMethodDouble) -#define JRI_CallMethodDoubleV(env, obj, methodID, args) \ - (((*(env))->CallMethodDoubleV)(env, JRI_CallMethodDouble_op_va_list, obj, methodID, args)) -#define JRI_CallMethodDoubleA(env, obj, methodID, args) \ - (((*(env))->CallMethodDoubleA)(env, JRI_CallMethodDouble_op_array, obj, methodID, args)) - -#define JRI_GetFieldID(env, clazz, name, sig) \ - (((*(env))->GetFieldID)(env, JRI_GetFieldID_op, clazz, name, sig)) - -#define JRI_GetField(env, obj, fieldID) \ - (((*(env))->GetField)(env, JRI_GetField_op, obj, fieldID)) - -#define JRI_GetFieldBoolean(env, obj, fieldID) \ - (((*(env))->GetFieldBoolean)(env, JRI_GetFieldBoolean_op, obj, fieldID)) - -#define JRI_GetFieldByte(env, obj, fieldID) \ - (((*(env))->GetFieldByte)(env, JRI_GetFieldByte_op, obj, fieldID)) - -#define JRI_GetFieldChar(env, obj, fieldID) \ - (((*(env))->GetFieldChar)(env, JRI_GetFieldChar_op, obj, fieldID)) - -#define JRI_GetFieldShort(env, obj, fieldID) \ - (((*(env))->GetFieldShort)(env, JRI_GetFieldShort_op, obj, fieldID)) - -#define JRI_GetFieldInt(env, obj, fieldID) \ - (((*(env))->GetFieldInt)(env, JRI_GetFieldInt_op, obj, fieldID)) - -#define JRI_GetFieldLong(env, obj, fieldID) \ - (((*(env))->GetFieldLong)(env, JRI_GetFieldLong_op, obj, fieldID)) - -#define JRI_GetFieldFloat(env, obj, fieldID) \ - (((*(env))->GetFieldFloat)(env, JRI_GetFieldFloat_op, obj, fieldID)) - -#define JRI_GetFieldDouble(env, obj, fieldID) \ - (((*(env))->GetFieldDouble)(env, JRI_GetFieldDouble_op, obj, fieldID)) - -#define JRI_SetField(env, obj, fieldID, value) \ - (((*(env))->SetField)(env, JRI_SetField_op, obj, fieldID, value)) - -#define JRI_SetFieldBoolean(env, obj, fieldID, value) \ - (((*(env))->SetFieldBoolean)(env, JRI_SetFieldBoolean_op, obj, fieldID, value)) - -#define JRI_SetFieldByte(env, obj, fieldID, value) \ - (((*(env))->SetFieldByte)(env, JRI_SetFieldByte_op, obj, fieldID, value)) - -#define JRI_SetFieldChar(env, obj, fieldID, value) \ - (((*(env))->SetFieldChar)(env, JRI_SetFieldChar_op, obj, fieldID, value)) - -#define JRI_SetFieldShort(env, obj, fieldID, value) \ - (((*(env))->SetFieldShort)(env, JRI_SetFieldShort_op, obj, fieldID, value)) - -#define JRI_SetFieldInt(env, obj, fieldID, value) \ - (((*(env))->SetFieldInt)(env, JRI_SetFieldInt_op, obj, fieldID, value)) - -#define JRI_SetFieldLong(env, obj, fieldID, value) \ - (((*(env))->SetFieldLong)(env, JRI_SetFieldLong_op, obj, fieldID, value)) - -#define JRI_SetFieldFloat(env, obj, fieldID, value) \ - (((*(env))->SetFieldFloat)(env, JRI_SetFieldFloat_op, obj, fieldID, value)) - -#define JRI_SetFieldDouble(env, obj, fieldID, value) \ - (((*(env))->SetFieldDouble)(env, JRI_SetFieldDouble_op, obj, fieldID, value)) - -#define JRI_IsSubclassOf(env, a, b) \ - (((*(env))->IsSubclassOf)(env, JRI_IsSubclassOf_op, a, b)) - -#define JRI_GetStaticMethodID(env, clazz, name, sig) \ - (((*(env))->GetStaticMethodID)(env, JRI_GetStaticMethodID_op, clazz, name, sig)) - -#define JRI_CallStaticMethod(env) ((*(env))->CallStaticMethod) -#define JRI_CallStaticMethodV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodV)(env, JRI_CallStaticMethod_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodA)(env, JRI_CallStaticMethod_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodBoolean(env) ((*(env))->CallStaticMethodBoolean) -#define JRI_CallStaticMethodBooleanV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodBooleanV)(env, JRI_CallStaticMethodBoolean_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodBooleanA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodBooleanA)(env, JRI_CallStaticMethodBoolean_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodByte(env) ((*(env))->CallStaticMethodByte) -#define JRI_CallStaticMethodByteV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodByteV)(env, JRI_CallStaticMethodByte_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodByteA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodByteA)(env, JRI_CallStaticMethodByte_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodChar(env) ((*(env))->CallStaticMethodChar) -#define JRI_CallStaticMethodCharV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodCharV)(env, JRI_CallStaticMethodChar_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodCharA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodCharA)(env, JRI_CallStaticMethodChar_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodShort(env) ((*(env))->CallStaticMethodShort) -#define JRI_CallStaticMethodShortV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodShortV)(env, JRI_CallStaticMethodShort_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodShortA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodShortA)(env, JRI_CallStaticMethodShort_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodInt(env) ((*(env))->CallStaticMethodInt) -#define JRI_CallStaticMethodIntV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodIntV)(env, JRI_CallStaticMethodInt_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodIntA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodIntA)(env, JRI_CallStaticMethodInt_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodLong(env) ((*(env))->CallStaticMethodLong) -#define JRI_CallStaticMethodLongV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodLongV)(env, JRI_CallStaticMethodLong_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodLongA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodLongA)(env, JRI_CallStaticMethodLong_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodFloat(env) ((*(env))->CallStaticMethodFloat) -#define JRI_CallStaticMethodFloatV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodFloatV)(env, JRI_CallStaticMethodFloat_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodFloatA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodFloatA)(env, JRI_CallStaticMethodFloat_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodDouble(env) ((*(env))->CallStaticMethodDouble) -#define JRI_CallStaticMethodDoubleV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodDoubleV)(env, JRI_CallStaticMethodDouble_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodDoubleA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodDoubleA)(env, JRI_CallStaticMethodDouble_op_array, clazz, methodID, args)) - -#define JRI_GetStaticFieldID(env, clazz, name, sig) \ - (((*(env))->GetStaticFieldID)(env, JRI_GetStaticFieldID_op, clazz, name, sig)) - -#define JRI_GetStaticField(env, clazz, fieldID) \ - (((*(env))->GetStaticField)(env, JRI_GetStaticField_op, clazz, fieldID)) - -#define JRI_GetStaticFieldBoolean(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldBoolean)(env, JRI_GetStaticFieldBoolean_op, clazz, fieldID)) - -#define JRI_GetStaticFieldByte(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldByte)(env, JRI_GetStaticFieldByte_op, clazz, fieldID)) - -#define JRI_GetStaticFieldChar(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldChar)(env, JRI_GetStaticFieldChar_op, clazz, fieldID)) - -#define JRI_GetStaticFieldShort(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldShort)(env, JRI_GetStaticFieldShort_op, clazz, fieldID)) - -#define JRI_GetStaticFieldInt(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldInt)(env, JRI_GetStaticFieldInt_op, clazz, fieldID)) - -#define JRI_GetStaticFieldLong(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldLong)(env, JRI_GetStaticFieldLong_op, clazz, fieldID)) - -#define JRI_GetStaticFieldFloat(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldFloat)(env, JRI_GetStaticFieldFloat_op, clazz, fieldID)) - -#define JRI_GetStaticFieldDouble(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldDouble)(env, JRI_GetStaticFieldDouble_op, clazz, fieldID)) - -#define JRI_SetStaticField(env, clazz, fieldID, value) \ - (((*(env))->SetStaticField)(env, JRI_SetStaticField_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldBoolean(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldBoolean)(env, JRI_SetStaticFieldBoolean_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldByte(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldByte)(env, JRI_SetStaticFieldByte_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldChar(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldChar)(env, JRI_SetStaticFieldChar_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldShort(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldShort)(env, JRI_SetStaticFieldShort_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldInt(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldInt)(env, JRI_SetStaticFieldInt_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldLong(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldLong)(env, JRI_SetStaticFieldLong_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldFloat(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldFloat)(env, JRI_SetStaticFieldFloat_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldDouble(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldDouble)(env, JRI_SetStaticFieldDouble_op, clazz, fieldID, value)) - -#define JRI_NewString(env, unicode, len) \ - (((*(env))->NewString)(env, JRI_NewString_op, unicode, len)) - -#define JRI_GetStringLength(env, string) \ - (((*(env))->GetStringLength)(env, JRI_GetStringLength_op, string)) - -#define JRI_GetStringChars(env, string) \ - (((*(env))->GetStringChars)(env, JRI_GetStringChars_op, string)) - -#define JRI_NewStringUTF(env, utf, len) \ - (((*(env))->NewStringUTF)(env, JRI_NewStringUTF_op, utf, len)) - -#define JRI_GetStringUTFLength(env, string) \ - (((*(env))->GetStringUTFLength)(env, JRI_GetStringUTFLength_op, string)) - -#define JRI_GetStringUTFChars(env, string) \ - (((*(env))->GetStringUTFChars)(env, JRI_GetStringUTFChars_op, string)) - -#define JRI_NewScalarArray(env, length, elementSig, initialElements) \ - (((*(env))->NewScalarArray)(env, JRI_NewScalarArray_op, length, elementSig, initialElements)) - -#define JRI_GetScalarArrayLength(env, array) \ - (((*(env))->GetScalarArrayLength)(env, JRI_GetScalarArrayLength_op, array)) - -#define JRI_GetScalarArrayElements(env, array) \ - (((*(env))->GetScalarArrayElements)(env, JRI_GetScalarArrayElements_op, array)) - -#define JRI_NewObjectArray(env, length, elementClass, initialElement) \ - (((*(env))->NewObjectArray)(env, JRI_NewObjectArray_op, length, elementClass, initialElement)) - -#define JRI_GetObjectArrayLength(env, array) \ - (((*(env))->GetObjectArrayLength)(env, JRI_GetObjectArrayLength_op, array)) - -#define JRI_GetObjectArrayElement(env, array, index) \ - (((*(env))->GetObjectArrayElement)(env, JRI_GetObjectArrayElement_op, array, index)) - -#define JRI_SetObjectArrayElement(env, array, index, value) \ - (((*(env))->SetObjectArrayElement)(env, JRI_SetObjectArrayElement_op, array, index, value)) - -#define JRI_RegisterNatives(env, clazz, nameAndSigArray, nativeProcArray) \ - (((*(env))->RegisterNatives)(env, JRI_RegisterNatives_op, clazz, nameAndSigArray, nativeProcArray)) - -#define JRI_UnregisterNatives(env, clazz) \ - (((*(env))->UnregisterNatives)(env, JRI_UnregisterNatives_op, clazz)) - -#define JRI_NewStringPlatform(env, string, len, encoding, encodingLength) \ - (((*(env))->NewStringPlatform)(env, JRI_NewStringPlatform_op, string, len, encoding, encodingLength)) - -#define JRI_GetStringPlatformChars(env, string, encoding, encodingLength) \ - (((*(env))->GetStringPlatformChars)(env, JRI_GetStringPlatformChars_op, string, encoding, encodingLength)) - - -/******************************************************************************* - * JRIEnv Interface - ******************************************************************************/ - -struct java_lang_ClassLoader; -struct java_lang_Class; -struct java_lang_Throwable; -struct java_lang_Object; -struct java_lang_String; - -struct JRIEnvInterface { - void* reserved0; - void* reserved1; - void* reserved2; - void* reserved3; - struct java_lang_Class* (*FindClass)(JRIEnv* env, jint op, const char* a); - void (*Throw)(JRIEnv* env, jint op, struct java_lang_Throwable* a); - void (*ThrowNew)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b); - struct java_lang_Throwable* (*ExceptionOccurred)(JRIEnv* env, jint op); - void (*ExceptionDescribe)(JRIEnv* env, jint op); - void (*ExceptionClear)(JRIEnv* env, jint op); - jglobal (*NewGlobalRef)(JRIEnv* env, jint op, void* a); - void (*DisposeGlobalRef)(JRIEnv* env, jint op, jglobal a); - void* (*GetGlobalRef)(JRIEnv* env, jint op, jglobal a); - void (*SetGlobalRef)(JRIEnv* env, jint op, jglobal a, void* b); - jbool (*IsSameObject)(JRIEnv* env, jint op, void* a, void* b); - void* (*NewObject)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - void* (*NewObjectV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - void* (*NewObjectA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - struct java_lang_Class* (*GetObjectClass)(JRIEnv* env, jint op, void* a); - jbool (*IsInstanceOf)(JRIEnv* env, jint op, void* a, struct java_lang_Class* b); - jint (*GetMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*CallMethod)(JRIEnv* env, jint op, void* a, jint b, ...); - void* (*CallMethodV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - void* (*CallMethodA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jbool (*CallMethodBoolean)(JRIEnv* env, jint op, void* a, jint b, ...); - jbool (*CallMethodBooleanV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jbool (*CallMethodBooleanA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jbyte (*CallMethodByte)(JRIEnv* env, jint op, void* a, jint b, ...); - jbyte (*CallMethodByteV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jbyte (*CallMethodByteA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jchar (*CallMethodChar)(JRIEnv* env, jint op, void* a, jint b, ...); - jchar (*CallMethodCharV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jchar (*CallMethodCharA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jshort (*CallMethodShort)(JRIEnv* env, jint op, void* a, jint b, ...); - jshort (*CallMethodShortV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jshort (*CallMethodShortA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jint (*CallMethodInt)(JRIEnv* env, jint op, void* a, jint b, ...); - jint (*CallMethodIntV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jint (*CallMethodIntA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jlong (*CallMethodLong)(JRIEnv* env, jint op, void* a, jint b, ...); - jlong (*CallMethodLongV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jlong (*CallMethodLongA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jfloat (*CallMethodFloat)(JRIEnv* env, jint op, void* a, jint b, ...); - jfloat (*CallMethodFloatV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jfloat (*CallMethodFloatA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jdouble (*CallMethodDouble)(JRIEnv* env, jint op, void* a, jint b, ...); - jdouble (*CallMethodDoubleV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jdouble (*CallMethodDoubleA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jint (*GetFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*GetField)(JRIEnv* env, jint op, void* a, jint b); - jbool (*GetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b); - jbyte (*GetFieldByte)(JRIEnv* env, jint op, void* a, jint b); - jchar (*GetFieldChar)(JRIEnv* env, jint op, void* a, jint b); - jshort (*GetFieldShort)(JRIEnv* env, jint op, void* a, jint b); - jint (*GetFieldInt)(JRIEnv* env, jint op, void* a, jint b); - jlong (*GetFieldLong)(JRIEnv* env, jint op, void* a, jint b); - jfloat (*GetFieldFloat)(JRIEnv* env, jint op, void* a, jint b); - jdouble (*GetFieldDouble)(JRIEnv* env, jint op, void* a, jint b); - void (*SetField)(JRIEnv* env, jint op, void* a, jint b, void* c); - void (*SetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b, jbool c); - void (*SetFieldByte)(JRIEnv* env, jint op, void* a, jint b, jbyte c); - void (*SetFieldChar)(JRIEnv* env, jint op, void* a, jint b, jchar c); - void (*SetFieldShort)(JRIEnv* env, jint op, void* a, jint b, jshort c); - void (*SetFieldInt)(JRIEnv* env, jint op, void* a, jint b, jint c); - void (*SetFieldLong)(JRIEnv* env, jint op, void* a, jint b, jlong c); - void (*SetFieldFloat)(JRIEnv* env, jint op, void* a, jint b, jfloat c); - void (*SetFieldDouble)(JRIEnv* env, jint op, void* a, jint b, jdouble c); - jbool (*IsSubclassOf)(JRIEnv* env, jint op, struct java_lang_Class* a, struct java_lang_Class* b); - jint (*GetStaticMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*CallStaticMethod)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - void* (*CallStaticMethodV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - void* (*CallStaticMethodA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jbool (*CallStaticMethodBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jbool (*CallStaticMethodBooleanV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jbool (*CallStaticMethodBooleanA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jbyte (*CallStaticMethodByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jbyte (*CallStaticMethodByteV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jbyte (*CallStaticMethodByteA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jchar (*CallStaticMethodChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jchar (*CallStaticMethodCharV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jchar (*CallStaticMethodCharA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jshort (*CallStaticMethodShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jshort (*CallStaticMethodShortV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jshort (*CallStaticMethodShortA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jint (*CallStaticMethodInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jint (*CallStaticMethodIntV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jint (*CallStaticMethodIntA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jlong (*CallStaticMethodLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jlong (*CallStaticMethodLongV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jlong (*CallStaticMethodLongA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jfloat (*CallStaticMethodFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jfloat (*CallStaticMethodFloatV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jfloat (*CallStaticMethodFloatA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jdouble (*CallStaticMethodDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jdouble (*CallStaticMethodDoubleV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jdouble (*CallStaticMethodDoubleA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jint (*GetStaticFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*GetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jbool (*GetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jbyte (*GetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jchar (*GetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jshort (*GetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jint (*GetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jlong (*GetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jfloat (*GetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jdouble (*GetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - void (*SetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, void* c); - void (*SetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbool c); - void (*SetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbyte c); - void (*SetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jchar c); - void (*SetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jshort c); - void (*SetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jint c); - void (*SetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jlong c); - void (*SetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jfloat c); - void (*SetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jdouble c); - struct java_lang_String* (*NewString)(JRIEnv* env, jint op, const jchar* a, jint b); - jint (*GetStringLength)(JRIEnv* env, jint op, struct java_lang_String* a); - const jchar* (*GetStringChars)(JRIEnv* env, jint op, struct java_lang_String* a); - struct java_lang_String* (*NewStringUTF)(JRIEnv* env, jint op, const jbyte* a, jint b); - jint (*GetStringUTFLength)(JRIEnv* env, jint op, struct java_lang_String* a); - const jbyte* (*GetStringUTFChars)(JRIEnv* env, jint op, struct java_lang_String* a); - void* (*NewScalarArray)(JRIEnv* env, jint op, jint a, const char* b, const jbyte* c); - jint (*GetScalarArrayLength)(JRIEnv* env, jint op, void* a); - jbyte* (*GetScalarArrayElements)(JRIEnv* env, jint op, void* a); - void* (*NewObjectArray)(JRIEnv* env, jint op, jint a, struct java_lang_Class* b, void* c); - jint (*GetObjectArrayLength)(JRIEnv* env, jint op, void* a); - void* (*GetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b); - void (*SetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b, void* c); - void (*RegisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a, char** b, void** c); - void (*UnregisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a); - struct java_lang_Class* (*DefineClass)(JRIEnv* env, jint op, struct java_lang_ClassLoader* a, jbyte* b, jsize bLen); - struct java_lang_String* (*NewStringPlatform)(JRIEnv* env, jint op, const jbyte* a, jint b, const jbyte* c, jint d); - const jbyte* (*GetStringPlatformChars)(JRIEnv* env, jint op, struct java_lang_String* a, const jbyte* b, jint c); -}; - -/* -** **************************************************************************** -** JRIEnv Operation IDs -** *************************************************************************** -*/ - -typedef enum JRIEnvOperations { - JRI_Reserved0_op, - JRI_Reserved1_op, - JRI_Reserved2_op, - JRI_Reserved3_op, - JRI_FindClass_op, - JRI_Throw_op, - JRI_ThrowNew_op, - JRI_ExceptionOccurred_op, - JRI_ExceptionDescribe_op, - JRI_ExceptionClear_op, - JRI_NewGlobalRef_op, - JRI_DisposeGlobalRef_op, - JRI_GetGlobalRef_op, - JRI_SetGlobalRef_op, - JRI_IsSameObject_op, - JRI_NewObject_op, - JRI_NewObject_op_va_list, - JRI_NewObject_op_array, - JRI_GetObjectClass_op, - JRI_IsInstanceOf_op, - JRI_GetMethodID_op, - JRI_CallMethod_op, - JRI_CallMethod_op_va_list, - JRI_CallMethod_op_array, - JRI_CallMethodBoolean_op, - JRI_CallMethodBoolean_op_va_list, - JRI_CallMethodBoolean_op_array, - JRI_CallMethodByte_op, - JRI_CallMethodByte_op_va_list, - JRI_CallMethodByte_op_array, - JRI_CallMethodChar_op, - JRI_CallMethodChar_op_va_list, - JRI_CallMethodChar_op_array, - JRI_CallMethodShort_op, - JRI_CallMethodShort_op_va_list, - JRI_CallMethodShort_op_array, - JRI_CallMethodInt_op, - JRI_CallMethodInt_op_va_list, - JRI_CallMethodInt_op_array, - JRI_CallMethodLong_op, - JRI_CallMethodLong_op_va_list, - JRI_CallMethodLong_op_array, - JRI_CallMethodFloat_op, - JRI_CallMethodFloat_op_va_list, - JRI_CallMethodFloat_op_array, - JRI_CallMethodDouble_op, - JRI_CallMethodDouble_op_va_list, - JRI_CallMethodDouble_op_array, - JRI_GetFieldID_op, - JRI_GetField_op, - JRI_GetFieldBoolean_op, - JRI_GetFieldByte_op, - JRI_GetFieldChar_op, - JRI_GetFieldShort_op, - JRI_GetFieldInt_op, - JRI_GetFieldLong_op, - JRI_GetFieldFloat_op, - JRI_GetFieldDouble_op, - JRI_SetField_op, - JRI_SetFieldBoolean_op, - JRI_SetFieldByte_op, - JRI_SetFieldChar_op, - JRI_SetFieldShort_op, - JRI_SetFieldInt_op, - JRI_SetFieldLong_op, - JRI_SetFieldFloat_op, - JRI_SetFieldDouble_op, - JRI_IsSubclassOf_op, - JRI_GetStaticMethodID_op, - JRI_CallStaticMethod_op, - JRI_CallStaticMethod_op_va_list, - JRI_CallStaticMethod_op_array, - JRI_CallStaticMethodBoolean_op, - JRI_CallStaticMethodBoolean_op_va_list, - JRI_CallStaticMethodBoolean_op_array, - JRI_CallStaticMethodByte_op, - JRI_CallStaticMethodByte_op_va_list, - JRI_CallStaticMethodByte_op_array, - JRI_CallStaticMethodChar_op, - JRI_CallStaticMethodChar_op_va_list, - JRI_CallStaticMethodChar_op_array, - JRI_CallStaticMethodShort_op, - JRI_CallStaticMethodShort_op_va_list, - JRI_CallStaticMethodShort_op_array, - JRI_CallStaticMethodInt_op, - JRI_CallStaticMethodInt_op_va_list, - JRI_CallStaticMethodInt_op_array, - JRI_CallStaticMethodLong_op, - JRI_CallStaticMethodLong_op_va_list, - JRI_CallStaticMethodLong_op_array, - JRI_CallStaticMethodFloat_op, - JRI_CallStaticMethodFloat_op_va_list, - JRI_CallStaticMethodFloat_op_array, - JRI_CallStaticMethodDouble_op, - JRI_CallStaticMethodDouble_op_va_list, - JRI_CallStaticMethodDouble_op_array, - JRI_GetStaticFieldID_op, - JRI_GetStaticField_op, - JRI_GetStaticFieldBoolean_op, - JRI_GetStaticFieldByte_op, - JRI_GetStaticFieldChar_op, - JRI_GetStaticFieldShort_op, - JRI_GetStaticFieldInt_op, - JRI_GetStaticFieldLong_op, - JRI_GetStaticFieldFloat_op, - JRI_GetStaticFieldDouble_op, - JRI_SetStaticField_op, - JRI_SetStaticFieldBoolean_op, - JRI_SetStaticFieldByte_op, - JRI_SetStaticFieldChar_op, - JRI_SetStaticFieldShort_op, - JRI_SetStaticFieldInt_op, - JRI_SetStaticFieldLong_op, - JRI_SetStaticFieldFloat_op, - JRI_SetStaticFieldDouble_op, - JRI_NewString_op, - JRI_GetStringLength_op, - JRI_GetStringChars_op, - JRI_NewStringUTF_op, - JRI_GetStringUTFLength_op, - JRI_GetStringUTFChars_op, - JRI_NewScalarArray_op, - JRI_GetScalarArrayLength_op, - JRI_GetScalarArrayElements_op, - JRI_NewObjectArray_op, - JRI_GetObjectArrayLength_op, - JRI_GetObjectArrayElement_op, - JRI_SetObjectArrayElement_op, - JRI_RegisterNatives_op, - JRI_UnregisterNatives_op, - JRI_DefineClass_op, - JRI_NewStringPlatform_op, - JRI_GetStringPlatformChars_op -} JRIEnvOperations; - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* JRI_H */ -/******************************************************************************/ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri_md.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri_md.h deleted file mode 100644 index 0003c56d34e..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri_md.h +++ /dev/null @@ -1,516 +0,0 @@ -/* -*- Mode: C; tab-width: 4; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Java Runtime Interface. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1996 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef JRI_MD_H -#define JRI_MD_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * WHAT'S UP WITH THIS FILE? - * - * This is where we define the mystical JRI_PUBLIC_API macro that works on all - * platforms. If you're running with Visual C++, Symantec C, or Borland's - * development environment on the PC, you're all set. Or if you're on the Mac - * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't - * matter. - * - * On UNIX though you probably care about a couple of other symbols though: - * IS_LITTLE_ENDIAN must be defined for little-endian systems - * HAVE_LONG_LONG must be defined on systems that have 'long long' integers - * HAVE_ALIGNED_LONGLONGS must be defined if long-longs must be 8 byte aligned - * HAVE_ALIGNED_DOUBLES must be defined if doubles must be 8 byte aligned - * IS_64 must be defined on 64-bit machines (like Dec Alpha) - ******************************************************************************/ - -/* DLL Entry modifiers... */ - -/* PC */ -#if defined(XP_WIN) || defined(XP_OS2) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) -# include -# if defined(_MSC_VER) -# if defined(WIN32) || defined(_WIN32) -# define JRI_PUBLIC_API(ResultType) _declspec(dllexport) ResultType -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) _declspec(dllexport) ResultType -# define JRI_CALLBACK -# else /* !_WIN32 */ -# if defined(_WINDLL) -# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export __loadds -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __loadds -# define JRI_CALLBACK __loadds -# else /* !WINDLL */ -# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __export -# define JRI_CALLBACK __export -# endif /* !WINDLL */ -# endif /* !_WIN32 */ -# elif defined(__BORLANDC__) -# if defined(WIN32) || defined(_WIN32) -# define JRI_PUBLIC_API(ResultType) __export ResultType -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) __export ResultType -# define JRI_CALLBACK -# else /* !_WIN32 */ -# define JRI_PUBLIC_API(ResultType) ResultType _cdecl _export _loadds -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) ResultType _cdecl _loadds -# define JRI_CALLBACK _loadds -# endif -# else -# error Unsupported PC development environment. -# endif -# ifndef IS_LITTLE_ENDIAN -# define IS_LITTLE_ENDIAN -# endif - -/* Mac */ -#elif macintosh || Macintosh || THINK_C -# if defined(__MWERKS__) /* Metrowerks */ -# if !__option(enumsalwaysint) -# error You need to define 'Enums Always Int' for your project. -# endif -# if defined(GENERATING68K) && !GENERATINGCFM -# if !__option(fourbyteints) -# error You need to define 'Struct Alignment: 68k' for your project. -# endif -# endif /* !GENERATINGCFM */ -# define JRI_PUBLIC_API(ResultType) __declspec(export) ResultType -# define JRI_PUBLIC_VAR(VarType) JRI_PUBLIC_API(VarType) -# define JRI_NATIVE_STUB(ResultType) JRI_PUBLIC_API(ResultType) -# elif defined(__SC__) /* Symantec */ -# error What are the Symantec defines? (warren@netscape.com) -# elif macintosh && applec /* MPW */ -# error Please upgrade to the latest MPW compiler (SC). -# else -# error Unsupported Mac development environment. -# endif -# define JRI_CALLBACK - -/* Unix or else */ -#else -# define JRI_PUBLIC_API(ResultType) ResultType -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_NATIVE_STUB(ResultType) ResultType -# define JRI_CALLBACK -#endif - -/******************************************************************************/ - -/* Java Scalar Types */ - -#if 0 /* now in jni.h */ -typedef short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; -typedef juint jsize; -#endif - -typedef unsigned char jbool; -typedef signed char jbyte; -#ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */ -typedef unsigned int juint; -typedef int jint; -#else -typedef unsigned long juint; -typedef long jint; -#endif - -/******************************************************************************* - * jlong : long long (64-bit signed integer type) support. - ******************************************************************************/ - -/* -** Bit masking macros. (n must be <= 31 to be portable) -*/ -#define JRI_BIT(n) ((juint)1 << (n)) -#define JRI_BITMASK(n) (JRI_BIT(n) - 1) - -#ifdef HAVE_LONG_LONG - -#if !(defined(WIN32) || defined(_WIN32)) -typedef long long jlong; -typedef unsigned long long julong; - -#define jlong_MAXINT 0x7fffffffffffffffLL -#define jlong_MININT 0x8000000000000000LL -#define jlong_ZERO 0x0LL - -#else -typedef LONGLONG jlong; -typedef DWORDLONG julong; - -#define jlong_MAXINT 0x7fffffffffffffffi64 -#define jlong_MININT 0x8000000000000000i64 -#define jlong_ZERO 0x0i64 - -#endif - -#define jlong_IS_ZERO(a) ((a) == 0) -#define jlong_EQ(a, b) ((a) == (b)) -#define jlong_NE(a, b) ((a) != (b)) -#define jlong_GE_ZERO(a) ((a) >= 0) -#define jlong_CMP(a, op, b) ((a) op (b)) - -#define jlong_AND(r, a, b) ((r) = (a) & (b)) -#define jlong_OR(r, a, b) ((r) = (a) | (b)) -#define jlong_XOR(r, a, b) ((r) = (a) ^ (b)) -#define jlong_OR2(r, a) ((r) = (r) | (a)) -#define jlong_NOT(r, a) ((r) = ~(a)) - -#define jlong_NEG(r, a) ((r) = -(a)) -#define jlong_ADD(r, a, b) ((r) = (a) + (b)) -#define jlong_SUB(r, a, b) ((r) = (a) - (b)) - -#define jlong_MUL(r, a, b) ((r) = (a) * (b)) -#define jlong_DIV(r, a, b) ((r) = (a) / (b)) -#define jlong_MOD(r, a, b) ((r) = (a) % (b)) - -#define jlong_SHL(r, a, b) ((r) = (a) << (b)) -#define jlong_SHR(r, a, b) ((r) = (a) >> (b)) -#define jlong_USHR(r, a, b) ((r) = (julong)(a) >> (b)) -#define jlong_ISHL(r, a, b) ((r) = ((jlong)(a)) << (b)) - -#define jlong_L2I(i, l) ((i) = (int)(l)) -#define jlong_L2UI(ui, l) ((ui) =(unsigned int)(l)) -#define jlong_L2F(f, l) ((f) = (l)) -#define jlong_L2D(d, l) ((d) = (l)) - -#define jlong_I2L(l, i) ((l) = (i)) -#define jlong_UI2L(l, ui) ((l) = (ui)) -#define jlong_F2L(l, f) ((l) = (f)) -#define jlong_D2L(l, d) ((l) = (d)) - -#define jlong_UDIVMOD(qp, rp, a, b) \ - (*(qp) = ((julong)(a) / (b)), \ - *(rp) = ((julong)(a) % (b))) - -#else /* !HAVE_LONG_LONG */ - -typedef struct { -#ifdef IS_LITTLE_ENDIAN - juint lo, hi; -#else - juint hi, lo; -#endif -} jlong; -typedef jlong julong; - -extern jlong jlong_MAXINT, jlong_MININT, jlong_ZERO; - -#define jlong_IS_ZERO(a) (((a).hi == 0) && ((a).lo == 0)) -#define jlong_EQ(a, b) (((a).hi == (b).hi) && ((a).lo == (b).lo)) -#define jlong_NE(a, b) (((a).hi != (b).hi) || ((a).lo != (b).lo)) -#define jlong_GE_ZERO(a) (((a).hi >> 31) == 0) - -/* - * NB: jlong_CMP and jlong_UCMP work only for strict relationals (<, >). - */ -#define jlong_CMP(a, op, b) (((int32)(a).hi op (int32)(b).hi) || \ - (((a).hi == (b).hi) && ((a).lo op (b).lo))) -#define jlong_UCMP(a, op, b) (((a).hi op (b).hi) || \ - (((a).hi == (b).hi) && ((a).lo op (b).lo))) - -#define jlong_AND(r, a, b) ((r).lo = (a).lo & (b).lo, \ - (r).hi = (a).hi & (b).hi) -#define jlong_OR(r, a, b) ((r).lo = (a).lo | (b).lo, \ - (r).hi = (a).hi | (b).hi) -#define jlong_XOR(r, a, b) ((r).lo = (a).lo ^ (b).lo, \ - (r).hi = (a).hi ^ (b).hi) -#define jlong_OR2(r, a) ((r).lo = (r).lo | (a).lo, \ - (r).hi = (r).hi | (a).hi) -#define jlong_NOT(r, a) ((r).lo = ~(a).lo, \ - (r).hi = ~(a).hi) - -#define jlong_NEG(r, a) ((r).lo = -(int32)(a).lo, \ - (r).hi = -(int32)(a).hi - ((r).lo != 0)) -#define jlong_ADD(r, a, b) { \ - jlong _a, _b; \ - _a = a; _b = b; \ - (r).lo = _a.lo + _b.lo; \ - (r).hi = _a.hi + _b.hi + ((r).lo < _b.lo); \ -} - -#define jlong_SUB(r, a, b) { \ - jlong _a, _b; \ - _a = a; _b = b; \ - (r).lo = _a.lo - _b.lo; \ - (r).hi = _a.hi - _b.hi - (_a.lo < _b.lo); \ -} \ - -/* - * Multiply 64-bit operands a and b to get 64-bit result r. - * First multiply the low 32 bits of a and b to get a 64-bit result in r. - * Then add the outer and inner products to r.hi. - */ -#define jlong_MUL(r, a, b) { \ - jlong _a, _b; \ - _a = a; _b = b; \ - jlong_MUL32(r, _a.lo, _b.lo); \ - (r).hi += _a.hi * _b.lo + _a.lo * _b.hi; \ -} - -/* XXX _jlong_lo16(a) = ((a) << 16 >> 16) is better on some archs (not on mips) */ -#define _jlong_lo16(a) ((a) & JRI_BITMASK(16)) -#define _jlong_hi16(a) ((a) >> 16) - -/* - * Multiply 32-bit operands a and b to get 64-bit result r. - * Use polynomial expansion based on primitive field element (1 << 16). - */ -#define jlong_MUL32(r, a, b) { \ - juint _a1, _a0, _b1, _b0, _y0, _y1, _y2, _y3; \ - _a1 = _jlong_hi16(a), _a0 = _jlong_lo16(a); \ - _b1 = _jlong_hi16(b), _b0 = _jlong_lo16(b); \ - _y0 = _a0 * _b0; \ - _y1 = _a0 * _b1; \ - _y2 = _a1 * _b0; \ - _y3 = _a1 * _b1; \ - _y1 += _jlong_hi16(_y0); /* can't carry */ \ - _y1 += _y2; /* might carry */ \ - if (_y1 < _y2) _y3 += 1 << 16; /* propagate */ \ - (r).lo = (_jlong_lo16(_y1) << 16) + _jlong_lo16(_y0); \ - (r).hi = _y3 + _jlong_hi16(_y1); \ -} - -/* - * Divide 64-bit unsigned operand a by 64-bit unsigned operand b, setting *qp - * to the 64-bit unsigned quotient, and *rp to the 64-bit unsigned remainder. - * Minimize effort if one of qp and rp is null. - */ -#define jlong_UDIVMOD(qp, rp, a, b) jlong_udivmod(qp, rp, a, b) - -extern JRI_PUBLIC_API(void) -jlong_udivmod(julong *qp, julong *rp, julong a, julong b); - -#define jlong_DIV(r, a, b) { \ - jlong _a, _b; \ - juint _negative = (int32)(a).hi < 0; \ - if (_negative) { \ - jlong_NEG(_a, a); \ - } else { \ - _a = a; \ - } \ - if ((int32)(b).hi < 0) { \ - _negative ^= 1; \ - jlong_NEG(_b, b); \ - } else { \ - _b = b; \ - } \ - jlong_UDIVMOD(&(r), 0, _a, _b); \ - if (_negative) \ - jlong_NEG(r, r); \ -} - -#define jlong_MOD(r, a, b) { \ - jlong _a, _b; \ - juint _negative = (int32)(a).hi < 0; \ - if (_negative) { \ - jlong_NEG(_a, a); \ - } else { \ - _a = a; \ - } \ - if ((int32)(b).hi < 0) { \ - jlong_NEG(_b, b); \ - } else { \ - _b = b; \ - } \ - jlong_UDIVMOD(0, &(r), _a, _b); \ - if (_negative) \ - jlong_NEG(r, r); \ -} - -/* - * NB: b is a juint, not jlong or julong, for the shift ops. - */ -#define jlong_SHL(r, a, b) { \ - if (b) { \ - jlong _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = _a.lo << (b); \ - (r).hi = (_a.hi << (b)) | (_a.lo >> (32 - (b))); \ - } else { \ - (r).lo = 0; \ - (r).hi = _a.lo << ((b) & 31); \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -/* a is an int32, b is int32, r is jlong */ -#define jlong_ISHL(r, a, b) { \ - if (b) { \ - jlong _a; \ - _a.lo = (a); \ - _a.hi = 0; \ - if ((b) < 32) { \ - (r).lo = (a) << (b); \ - (r).hi = ((a) >> (32 - (b))); \ - } else { \ - (r).lo = 0; \ - (r).hi = (a) << ((b) & 31); \ - } \ - } else { \ - (r).lo = (a); \ - (r).hi = 0; \ - } \ -} - -#define jlong_SHR(r, a, b) { \ - if (b) { \ - jlong _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b)); \ - (r).hi = (int32)_a.hi >> (b); \ - } else { \ - (r).lo = (int32)_a.hi >> ((b) & 31); \ - (r).hi = (int32)_a.hi >> 31; \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -#define jlong_USHR(r, a, b) { \ - if (b) { \ - jlong _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b)); \ - (r).hi = _a.hi >> (b); \ - } else { \ - (r).lo = _a.hi >> ((b) & 31); \ - (r).hi = 0; \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -#define jlong_L2I(i, l) ((i) = (l).lo) -#define jlong_L2UI(ui, l) ((ui) = (l).lo) -#define jlong_L2F(f, l) { double _d; jlong_L2D(_d, l); (f) = (float) _d; } - -#define jlong_L2D(d, l) { \ - int32 _negative; \ - jlong _absval; \ - \ - _negative = (l).hi >> 31; \ - if (_negative) { \ - jlong_NEG(_absval, l); \ - } else { \ - _absval = l; \ - } \ - (d) = (double)_absval.hi * 4.294967296e9 + _absval.lo; \ - if (_negative) \ - (d) = -(d); \ -} - -#define jlong_I2L(l, i) ((l).hi = (i) >> 31, (l).lo = (i)) -#define jlong_UI2L(l, ui) ((l).hi = 0, (l).lo = (ui)) -#define jlong_F2L(l, f) { double _d = (double) f; jlong_D2L(l, _d); } - -#define jlong_D2L(l, d) { \ - int _negative; \ - double _absval, _d_hi; \ - jlong _lo_d; \ - \ - _negative = ((d) < 0); \ - _absval = _negative ? -(d) : (d); \ - \ - (l).hi = (juint)(_absval / 4.294967296e9); \ - (l).lo = 0; \ - jlong_L2D(_d_hi, l); \ - _absval -= _d_hi; \ - _lo_d.hi = 0; \ - if (_absval < 0) { \ - _lo_d.lo = (juint) -_absval; \ - jlong_SUB(l, l, _lo_d); \ - } else { \ - _lo_d.lo = (juint) _absval; \ - jlong_ADD(l, l, _lo_d); \ - } \ - \ - if (_negative) \ - jlong_NEG(l, l); \ -} - -#endif /* !HAVE_LONG_LONG */ - -/******************************************************************************/ - -#ifdef HAVE_ALIGNED_LONGLONGS -#define JRI_GET_INT64(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \ - ((_t).x[1] = ((jint*)(_addr))[1]), \ - (_t).l ) -#define JRI_SET_INT64(_t, _addr, _v) ( (_t).l = (_v), \ - ((jint*)(_addr))[0] = (_t).x[0], \ - ((jint*)(_addr))[1] = (_t).x[1] ) -#else -#define JRI_GET_INT64(_t,_addr) (*(jlong*)(_addr)) -#define JRI_SET_INT64(_t, _addr, _v) (*(jlong*)(_addr) = (_v)) -#endif - -/* If double's must be aligned on doubleword boundaries then define this */ -#ifdef HAVE_ALIGNED_DOUBLES -#define JRI_GET_DOUBLE(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \ - ((_t).x[1] = ((jint*)(_addr))[1]), \ - (_t).d ) -#define JRI_SET_DOUBLE(_t, _addr, _v) ( (_t).d = (_v), \ - ((jint*)(_addr))[0] = (_t).x[0], \ - ((jint*)(_addr))[1] = (_t).x[1] ) -#else -#define JRI_GET_DOUBLE(_t,_addr) (*(jdouble*)(_addr)) -#define JRI_SET_DOUBLE(_t, _addr, _v) (*(jdouble*)(_addr) = (_v)) -#endif - -/******************************************************************************/ -#ifdef __cplusplus -} -#endif -#endif /* JRI_MD_H */ -/******************************************************************************/ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jritypes.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jritypes.h deleted file mode 100644 index 4f6d4c0a38b..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jritypes.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- Mode: C; tab-width: 4; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Java Runtime Interface. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 1996 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef JRITYPES_H -#define JRITYPES_H - -#include "jni.h" -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * Types - ******************************************************************************/ - -struct JRIEnvInterface; - -typedef void* JRIRef; -typedef void* JRIGlobalRef; - -typedef jint JRIFieldID; -typedef jint JRIMethodID; - -/* synonyms: */ -typedef JRIGlobalRef jglobal; - -typedef union JRIValue { - jbool z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong l; - jfloat f; - jdouble d; - jref r; -} JRIValue; - -typedef enum JRIBoolean { - JRIFalse = 0, - JRITrue = 1 -} JRIBoolean; - -typedef enum JRIConstant { - JRIUninitialized = -1 -} JRIConstant; - -/* convenience types (these must be distinct struct types for c++ overloading): */ -#if 0 /* now in jni.h */ -typedef struct jbooleanArrayStruct* jbooleanArray; -typedef struct jbyteArrayStruct* jbyteArray; -typedef struct jcharArrayStruct* jcharArray; -typedef struct jshortArrayStruct* jshortArray; -typedef struct jintArrayStruct* jintArray; -typedef struct jlongArrayStruct* jlongArray; -typedef struct jfloatArrayStruct* jfloatArray; -typedef struct jdoubleArrayStruct* jdoubleArray; -typedef struct jobjectArrayStruct* jobjectArray; -#endif -typedef struct jstringArrayStruct* jstringArray; -typedef struct jarrayArrayStruct* jarrayArray; - -#define JRIConstructorMethodName "" - -/******************************************************************************* - * Signature Construction Macros - ******************************************************************************/ - -/* -** These macros can be used to construct signature strings. Hopefully their names -** are a little easier to remember than the single character they correspond to. -** For example, to specify the signature of the method: -** -** public int read(byte b[], int off, int len); -** -** you could write something like this in C: -** -** char* readSig = JRISigMethod(JRISigArray(JRISigByte) -** JRISigInt -** JRISigInt) JRISigInt; -** -** Of course, don't put commas between the types. -*/ -#define JRISigArray(T) "[" T -#define JRISigByte "B" -#define JRISigChar "C" -#define JRISigClass(name) "L" name ";" -#define JRISigFloat "F" -#define JRISigDouble "D" -#define JRISigMethod(args) "(" args ")" -#define JRISigNoArgs "" -#define JRISigInt "I" -#define JRISigLong "J" -#define JRISigShort "S" -#define JRISigVoid "V" -#define JRISigBoolean "Z" - -/******************************************************************************* - * Environments - ******************************************************************************/ - -extern JRI_PUBLIC_API(const struct JRIEnvInterface**) -JRI_GetCurrentEnv(void); - -/******************************************************************************* - * Specific Scalar Array Types - ******************************************************************************/ - -/* -** The JRI Native Method Interface does not support boolean arrays. This -** is to allow Java runtime implementations to optimize boolean array -** storage. Using the ScalarArray operations on boolean arrays is bound -** to fail, so convert any boolean arrays to byte arrays in Java before -** passing them to a native method. -*/ - -#define JRI_NewByteArray(env, length, initialValues) \ - JRI_NewScalarArray(env, length, JRISigByte, (jbyte*)(initialValues)) -#define JRI_GetByteArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetByteArrayElements(env, array) \ - JRI_GetScalarArrayElements(env, array) - -#define JRI_NewCharArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jchar)), JRISigChar, (jbyte*)(initialValues)) -#define JRI_GetCharArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetCharArrayElements(env, array) \ - ((jchar*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewShortArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jshort)), JRISigShort, (jbyte*)(initialValues)) -#define JRI_GetShortArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetShortArrayElements(env, array) \ - ((jshort*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewIntArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jint)), JRISigInt, (jbyte*)(initialValues)) -#define JRI_GetIntArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetIntArrayElements(env, array) \ - ((jint*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewLongArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jlong)), JRISigLong, (jbyte*)(initialValues)) -#define JRI_GetLongArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetLongArrayElements(env, array) \ - ((jlong*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewFloatArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jfloat)), JRISigFloat, (jbyte*)(initialValues)) -#define JRI_GetFloatArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetFloatArrayElements(env, array) \ - ((jfloat*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewDoubleArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jdouble)), JRISigDouble, (jbyte*)(initialValues)) -#define JRI_GetDoubleArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetDoubleArrayElements(env, array) \ - ((jdouble*)JRI_GetScalarArrayElements(env, array)) - -/******************************************************************************/ -/* -** JDK Stuff -- This stuff is still needed while we're using the JDK -** dynamic linking strategy to call native methods. -*/ - -typedef union JRI_JDK_stack_item { - /* Non pointer items */ - jint i; - jfloat f; - jint o; - /* Pointer items */ - void *h; - void *p; - unsigned char *addr; -#ifdef IS_64 - double d; - long l; /* == 64bits! */ -#endif -} JRI_JDK_stack_item; - -typedef union JRI_JDK_Java8Str { - jint x[2]; - jdouble d; - jlong l; - void *p; - float f; -} JRI_JDK_Java8; - -/******************************************************************************/ -#ifdef __cplusplus -} -#endif -#endif /* JRITYPES_H */ -/******************************************************************************/ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npapi.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npapi.h deleted file mode 100644 index 379796b525f..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npapi.h +++ /dev/null @@ -1,462 +0,0 @@ -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npapi.h $Revision: 1.2 $ - * Netscape client plug-in API spec - */ - -#ifndef _NPAPI_H_ -#define _NPAPI_H_ - -#include "jri.h" /* Java Runtime Interface */ - -#ifdef _WINDOWS -# ifndef XP_WIN -# define XP_WIN 1 -# endif /* XP_WIN */ -#endif /* _WINDOWS */ - -#ifdef __MWERKS__ -# define _declspec __declspec -# ifdef macintosh -# ifndef XP_MAC -# define XP_MAC 1 -# endif /* XP_MAC */ -# endif /* macintosh */ -# ifdef __INTEL__ -# undef NULL -# ifndef XP_WIN -# define XP_WIN 1 -# endif /* XP_WIN */ -# endif /* __INTELL__ */ -#endif /* __MWERKS__ */ - -#ifdef XP_MAC - #include - #include -#endif - -#ifdef XP_UNIX - #include - #include -#endif - - -/*----------------------------------------------------------------------*/ -/* Plugin Version Constants */ -/*----------------------------------------------------------------------*/ - -#define NP_VERSION_MAJOR 0 -#define NP_VERSION_MINOR 11 - - - -/*----------------------------------------------------------------------*/ -/* Definition of Basic Types */ -/*----------------------------------------------------------------------*/ - -#ifndef _UINT16 -typedef unsigned short uint16; -#endif -#ifndef _UINT32 -#if defined(__alpha) -typedef unsigned int uint32; -#else /* __alpha */ -typedef unsigned long uint32; -#endif /* __alpha */ -#endif -#ifndef _INT16 -typedef short int16; -#endif -#ifndef _INT32 -#if defined(__alpha) -typedef int int32; -#else /* __alpha */ -typedef long int32; -#endif /* __alpha */ -#endif - -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif -#ifndef NULL -#define NULL (0L) -#endif - -typedef unsigned char NPBool; -typedef int16 NPError; -typedef int16 NPReason; -typedef char* NPMIMEType; - - - -/*----------------------------------------------------------------------*/ -/* Structures and definitions */ -/*----------------------------------------------------------------------*/ - -#ifdef XP_MAC -#pragma options align=mac68k -#endif - -/* - * NPP is a plug-in's opaque instance handle - */ -typedef struct _NPP -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ -} NPP_t; - -typedef NPP_t* NPP; - - -typedef struct _NPStream -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ - const char* url; - uint32 end; - uint32 lastmodified; - void* notifyData; -} NPStream; - - -typedef struct _NPByteRange -{ - int32 offset; /* negative offset means from the end */ - uint32 length; - struct _NPByteRange* next; -} NPByteRange; - - -typedef struct _NPSavedData -{ - int32 len; - void* buf; -} NPSavedData; - - -typedef struct _NPRect -{ - uint16 top; - uint16 left; - uint16 bottom; - uint16 right; -} NPRect; - - -#ifdef XP_UNIX -/* - * Unix specific structures and definitions - */ - -/* - * Callback Structures. - * - * These are used to pass additional platform specific information. - */ -enum { - NP_SETWINDOW = 1, - NP_PRINT -}; - -typedef struct -{ - int32 type; -} NPAnyCallbackStruct; - -typedef struct -{ - int32 type; - Display* display; - Visual* visual; - Colormap colormap; - unsigned int depth; -} NPSetWindowCallbackStruct; - -typedef struct -{ - int32 type; - FILE* fp; -} NPPrintCallbackStruct; - -#endif /* XP_UNIX */ - -/* - * List of variable names for which NPP_GetValue shall be implemented - */ -typedef enum { - NPPVpluginNameString = 1, - NPPVpluginDescriptionString, - NPPVpluginWindowBool, - NPPVpluginTransparentBool -} NPPVariable; - -/* - * List of variable names for which NPN_GetValue is implemented by Mozilla - */ -typedef enum { - NPNVxDisplay = 1, - NPNVxtAppContext, - NPNVnetscapeWindow, - NPNVjavascriptEnabledBool, - NPNVasdEnabledBool, - NPNVisOfflineBool -} NPNVariable; - -/* - * The type of a NPWindow - it specifies the type of the data structure - * returned in the window field. - */ -typedef enum { - NPWindowTypeWindow = 1, - NPWindowTypeDrawable -} NPWindowType; - -typedef struct _NPWindow -{ - void* window; /* Platform specific window handle */ - int32 x; /* Position of top left corner relative */ - int32 y; /* to a netscape page. */ - uint32 width; /* Maximum window size */ - uint32 height; - NPRect clipRect; /* Clipping rectangle in port coordinates */ - /* Used by MAC only. */ -#ifdef XP_UNIX - void * ws_info; /* Platform-dependent additonal data */ -#endif /* XP_UNIX */ - NPWindowType type; /* Is this a window or a drawable? */ -} NPWindow; - - -typedef struct _NPFullPrint -{ - NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */ - /* printing */ - NPBool printOne; /* TRUE if plugin should print one copy */ - /* to default printer */ - void* platformPrint; /* Platform-specific printing info */ -} NPFullPrint; - -typedef struct _NPEmbedPrint -{ - NPWindow window; - void* platformPrint; /* Platform-specific printing info */ -} NPEmbedPrint; - -typedef struct _NPPrint -{ - uint16 mode; /* NP_FULL or NP_EMBED */ - union - { - NPFullPrint fullPrint; /* if mode is NP_FULL */ - NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ - } print; -} NPPrint; - -#ifdef XP_MAC -typedef EventRecord NPEvent; -#elif defined(XP_WIN) -typedef struct _NPEvent -{ - uint16 event; - uint32 wParam; - uint32 lParam; -} NPEvent; -#elif defined (XP_UNIX) -typedef XEvent NPEvent; -#else -typedef void* NPEvent; -#endif /* XP_MAC */ - -#ifdef XP_MAC -typedef RgnHandle NPRegion; -#elif defined(XP_WIN) -typedef HRGN NPRegion; -#elif defined(XP_UNIX) -typedef Region NPRegion; -#else -typedef void *NPRegion; -#endif /* XP_MAC */ - -#ifdef XP_MAC -/* - * Mac-specific structures and definitions. - */ - -typedef struct NP_Port -{ - CGrafPtr port; /* Grafport */ - int32 portx; /* position inside the topmost window */ - int32 porty; -} NP_Port; - -/* - * Non-standard event types that can be passed to HandleEvent - */ -#define getFocusEvent (osEvt + 16) -#define loseFocusEvent (osEvt + 17) -#define adjustCursorEvent (osEvt + 18) - -#endif /* XP_MAC */ - - -/* - * Values for mode passed to NPP_New: - */ -#define NP_EMBED 1 -#define NP_FULL 2 - -/* - * Values for stream type passed to NPP_NewStream: - */ -#define NP_NORMAL 1 -#define NP_SEEK 2 -#define NP_ASFILE 3 -#define NP_ASFILEONLY 4 - -#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) - -#ifdef XP_MAC -#pragma options align=reset -#endif - - -/*----------------------------------------------------------------------*/ -/* Error and Reason Code definitions */ -/*----------------------------------------------------------------------*/ - -/* - * Values of type NPError: - */ -#define NPERR_BASE 0 -#define NPERR_NO_ERROR (NPERR_BASE + 0) -#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) -#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) -#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) -#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) -#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) -#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) -#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) -#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) -#define NPERR_INVALID_PARAM (NPERR_BASE + 9) -#define NPERR_INVALID_URL (NPERR_BASE + 10) -#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) -#define NPERR_NO_DATA (NPERR_BASE + 12) -#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) - -/* - * Values of type NPReason: - */ -#define NPRES_BASE 0 -#define NPRES_DONE (NPRES_BASE + 0) -#define NPRES_NETWORK_ERR (NPRES_BASE + 1) -#define NPRES_USER_BREAK (NPRES_BASE + 2) - -/* - * Don't use these obsolete error codes any more. - */ -#define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR -#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR -#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK - -/* - * Version feature information - */ -#define NPVERS_HAS_STREAMOUTPUT 8 -#define NPVERS_HAS_NOTIFICATION 9 -#define NPVERS_HAS_LIVECONNECT 9 -#define NPVERS_68K_HAS_LIVECONNECT 11 -#define NPVERS_HAS_WINDOWLESS 11 - - -/*----------------------------------------------------------------------*/ -/* Function Prototypes */ -/*----------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * NPP_* functions are provided by the plugin and called by the navigator. - */ - -#ifdef XP_UNIX -char* NPP_GetMIMEDescription(void); -#endif /* XP_UNIX */ - -NPError NPP_Initialize(void); -void NPP_Shutdown(void); -NPError NPP_New(NPMIMEType pluginType, NPP instance, - uint16 mode, int16 argc, char* argn[], - char* argv[], NPSavedData* saved); -NPError NPP_Destroy(NPP instance, NPSavedData** save); -NPError NPP_SetWindow(NPP instance, NPWindow* window); -NPError NPP_NewStream(NPP instance, NPMIMEType type, - NPStream* stream, NPBool seekable, - uint16* stype); -NPError NPP_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -int32 NPP_WriteReady(NPP instance, NPStream* stream); -int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, - int32 len, void* buffer); -void NPP_StreamAsFile(NPP instance, NPStream* stream, - const char* fname); -void NPP_Print(NPP instance, NPPrint* platformPrint); -int16 NPP_HandleEvent(NPP instance, void* event); -void NPP_URLNotify(NPP instance, const char* url, - NPReason reason, void* notifyData); -jref NPP_GetJavaClass(void); -NPError NPP_GetValue(void *instance, NPPVariable variable, - void *value); -NPError NPP_SetValue(void *instance, NPNVariable variable, - void *value); - -/* - * NPN_* functions are provided by the navigator and called by the plugin. - */ - -void NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor); -NPError NPN_GetURLNotify(NPP instance, const char* url, - const char* target, void* notifyData); -NPError NPN_GetURL(NPP instance, const char* url, - const char* target); -NPError NPN_PostURLNotify(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file, - void* notifyData); -NPError NPN_PostURL(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file); -NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); -NPError NPN_NewStream(NPP instance, NPMIMEType type, - const char* target, NPStream** stream); -int32 NPN_Write(NPP instance, NPStream* stream, int32 len, - void* buffer); -NPError NPN_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -void NPN_Status(NPP instance, const char* message); -const char* NPN_UserAgent(NPP instance); -void* NPN_MemAlloc(uint32 size); -void NPN_MemFree(void* ptr); -uint32 NPN_MemFlush(uint32 size); -void NPN_ReloadPlugins(NPBool reloadPages); -JRIEnv* NPN_GetJavaEnv(void); -jref NPN_GetJavaPeer(NPP instance); -NPError NPN_GetValue(NPP instance, NPNVariable variable, - void *value); -NPError NPN_SetValue(NPP instance, NPPVariable variable, - void *value); -void NPN_InvalidateRect(NPP instance, NPRect *invalidRect); -void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion); -void NPN_ForceRedraw(NPP instance); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* _NPAPI_H_ */ diff --git a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npupp.h b/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npupp.h deleted file mode 100644 index 724aec4f7a9..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npupp.h +++ /dev/null @@ -1,1160 +0,0 @@ -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npupp.h $Revision: 1.1 $ - * function call mecahnics needed by platform specific glue code. - */ - - -#ifndef _NPUPP_H_ -#define _NPUPP_H_ - -#ifndef GENERATINGCFM -#define GENERATINGCFM 0 -#endif - -#ifndef _NPAPI_H_ -#include "npapi.h" -#endif - -#include "jri.h" - -/****************************************************************************************** - plug-in function table macros - for each function in and out of the plugin API we define - typedef NPP_FooUPP - #define NewNPP_FooProc - #define CallNPP_FooProc - for mac, define the UPP magic for PPC/68K calling - *******************************************************************************************/ - - -/* NPP_Initialize */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_InitializeUPP; - -enum { - uppNPP_InitializeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_InitializeProc(FUNC) \ - (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture()) -#define CallNPP_InitializeProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo) - -#else - -typedef void (*NPP_InitializeUPP)(void); -#define NewNPP_InitializeProc(FUNC) \ - ((NPP_InitializeUPP) (FUNC)) -#define CallNPP_InitializeProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_Shutdown */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_ShutdownUPP; - -enum { - uppNPP_ShutdownProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_ShutdownProc(FUNC) \ - (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture()) -#define CallNPP_ShutdownProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo) - -#else - -typedef void (*NPP_ShutdownUPP)(void); -#define NewNPP_ShutdownProc(FUNC) \ - ((NPP_ShutdownUPP) (FUNC)) -#define CallNPP_ShutdownProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_New */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_NewUPP; - -enum { - uppNPP_NewProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; - -#define NewNPP_NewProc(FUNC) \ - (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \ - (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); -#define NewNPP_NewProc(FUNC) \ - ((NPP_NewUPP) (FUNC)) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) - -#endif - - -/* NPP_Destroy */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyUPP; -enum { - uppNPP_DestroyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyProc(FUNC) \ - (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2)) -#else - -typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save); -#define NewNPP_DestroyProc(FUNC) \ - ((NPP_DestroyUPP) (FUNC)) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_SetWindow */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_SetWindowUPP; -enum { - uppNPP_SetWindowProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_SetWindowProc(FUNC) \ - (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture()) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2)) - -#else - -typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window); -#define NewNPP_SetWindowProc(FUNC) \ - ((NPP_SetWindowUPP) (FUNC)) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_NewStreamUPP; -enum { - uppNPP_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_NewStreamProc(FUNC) \ - (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#else - -typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); -#define NewNPP_NewStreamProc(FUNC) \ - ((NPP_NewStreamUPP) (FUNC)) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#endif - - -/* NPP_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyStreamUPP; -enum { - uppNPP_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyStreamProc(FUNC) \ - (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) - -#else - -typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPP_DestroyStreamProc(FUNC) \ - ((NPP_DestroyStreamUPP) (FUNC)) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) - -#endif - - -/* NPP_WriteReady */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteReadyUPP; -enum { - uppNPP_WriteReadyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteReadyProc(FUNC) \ - (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr)) - -#else - -typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream); -#define NewNPP_WriteReadyProc(FUNC) \ - ((NPP_WriteReadyUPP) (FUNC)) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr)) - -#endif - - -/* NPP_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteUPP; -enum { - uppNPP_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteProc(FUNC) \ - (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#else - -typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); -#define NewNPP_WriteProc(FUNC) \ - ((NPP_WriteUPP) (FUNC)) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#endif - - -/* NPP_StreamAsFile */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_StreamAsFileUPP; -enum { - uppNPP_StreamAsFileProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_StreamAsFileProc(FUNC) \ - (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture()) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3)) - -#else - -typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname); -#define NewNPP_StreamAsFileProc(FUNC) \ - ((NPP_StreamAsFileUPP) (FUNC)) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPP_Print */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_PrintUPP; -enum { - uppNPP_PrintProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_PrintProc(FUNC) \ - (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture()) -#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr)) - -#else - -typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); -#define NewNPP_PrintProc(FUNC) \ - ((NPP_PrintUPP) (FUNC)) -#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ - (*(FUNC))((NPParg), (NPPrintArg)) - -#endif - - -/* NPP_HandleEvent */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_HandleEventUPP; -enum { - uppNPP_HandleEventProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int16))) -}; -#define NewNPP_HandleEventProc(FUNC) \ - (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture()) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr)) - -#else - -typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event); -#define NewNPP_HandleEventProc(FUNC) \ - ((NPP_HandleEventUPP) (FUNC)) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (*(FUNC))((NPParg), (voidPtr)) - -#endif - - -/* NPP_URLNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_URLNotifyUPP; -enum { - uppNPP_URLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) -}; -#define NewNPP_URLNotifyProc(FUNC) \ - (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) - -#else - -typedef void (*NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData); -#define NewNPP_URLNotifyProc(FUNC) \ - ((NPP_URLNotifyUPP) (FUNC)) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) - -#endif - - -/* NPP_GetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_GetValueUPP; -enum { - uppNPP_GetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_GetValueProc(FUNC) \ - (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture()) -#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue); -#define NewNPP_GetValueProc(FUNC) \ - ((NPP_GetValueUPP) (FUNC)) -#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPP_SetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_SetValueUPP; -enum { - uppNPP_SetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_SetValueProc(FUNC) \ - (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture()) -#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); -#define NewNPP_SetValueProc(FUNC) \ - ((NPP_SetValueUPP) (FUNC)) -#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - - - -/* - * Netscape entry points - */ - - -/* NPN_GetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetValueUPP; -enum { - uppNPN_GetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetValueProc(FUNC) \ - (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); -#define NewNPN_GetValueProc(FUNC) \ - ((NPN_GetValueUPP) (FUNC)) -#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPN_SetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_SetValueUPP; -enum { - uppNPN_SetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_SetValueProc(FUNC) \ - (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture()) -#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue); -#define NewNPN_SetValueProc(FUNC) \ - ((NPN_SetValueUPP) (FUNC)) -#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPN_GetUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLNotifyUPP; -enum { - uppNPN_GetURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLNotifyProc(FUNC) \ - (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) -#else - -typedef NPError (*NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData); -#define NewNPN_GetURLNotifyProc(FUNC) \ - ((NPN_GetURLNotifyUPP) (FUNC)) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) -#endif - - -/* NPN_PostUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLNotifyUPP; -enum { - uppNPN_PostURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLNotifyProc(FUNC) \ - (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); -#define NewNPN_PostURLNotifyProc(FUNC) \ - ((NPN_PostURLNotifyUPP) (FUNC)) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#endif - - -/* NPN_GetUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLUPP; -enum { - uppNPN_GetURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLProc(FUNC) \ - (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window); -#define NewNPN_GetURLProc(FUNC) \ - ((NPN_GetURLUPP) (FUNC)) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPN_PostUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLUPP; -enum { - uppNPN_PostURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLProc(FUNC) \ - (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#else - -typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file); -#define NewNPN_PostURLProc(FUNC) \ - ((NPN_PostURLUPP) (FUNC)) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#endif - - -/* NPN_RequestRead */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_RequestReadUPP; -enum { - uppNPN_RequestReadProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_RequestReadProc(FUNC) \ - (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture()) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range)) - -#else - -typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList); -#define NewNPN_RequestReadProc(FUNC) \ - ((NPN_RequestReadUPP) (FUNC)) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (*(FUNC))((stream), (range)) - -#endif - - -/* NPN_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_NewStreamUPP; -enum { - uppNPN_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_NewStreamProc(FUNC) \ - (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) - -#else - -typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); -#define NewNPN_NewStreamProc(FUNC) \ - ((NPN_NewStreamUPP) (FUNC)) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (*(FUNC))((npp), (type), (window), (stream)) - -#endif - - -/* NPN_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_WriteUPP; -enum { - uppNPN_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPN_WriteProc(FUNC) \ - (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer)) - -#else - -typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer); -#define NewNPN_WriteProc(FUNC) \ - ((NPN_WriteUPP) (FUNC)) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (*(FUNC))((npp), (stream), (len), (buffer)) - -#endif - - -/* NPN_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_DestroyStreamUPP; -enum { - uppNPN_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_DestroyStreamProc(FUNC) \ - (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) - -#else - -typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPN_DestroyStreamProc(FUNC) \ - ((NPN_DestroyStreamUPP) (FUNC)) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (*(FUNC))((npp), (stream), (reason)) - -#endif - - -/* NPN_Status */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_StatusUPP; -enum { - uppNPN_StatusProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) -}; - -#define NewNPN_StatusProc(FUNC) \ - (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture()) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg)) - -#else - -typedef void (*NPN_StatusUPP)(NPP instance, const char* message); -#define NewNPN_StatusProc(FUNC) \ - ((NPN_StatusUPP) (FUNC)) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (*(FUNC))((npp), (msg)) - -#endif - - -/* NPN_UserAgent */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_UserAgentUPP; -enum { - uppNPN_UserAgentProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) -}; - -#define NewNPN_UserAgentProc(FUNC) \ - (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture()) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1)) - -#else - -typedef const char* (*NPN_UserAgentUPP)(NPP instance); -#define NewNPN_UserAgentProc(FUNC) \ - ((NPN_UserAgentUPP) (FUNC)) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemAlloc */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemAllocUPP; -enum { - uppNPN_MemAllocProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemAllocProc(FUNC) \ - (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) - -#else - -typedef void* (*NPN_MemAllocUPP)(uint32 size); -#define NewNPN_MemAllocProc(FUNC) \ - ((NPN_MemAllocUPP) (FUNC)) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN__MemFree */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFreeUPP; -enum { - uppNPN_MemFreeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemFreeProc(FUNC) \ - (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1)) - -#else - -typedef void (*NPN_MemFreeUPP)(void* ptr); -#define NewNPN_MemFreeProc(FUNC) \ - ((NPN_MemFreeUPP) (FUNC)) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemFlush */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFlushUPP; -enum { - uppNPN_MemFlushProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) -}; - -#define NewNPN_MemFlushProc(FUNC) \ - (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1)) - -#else - -typedef uint32 (*NPN_MemFlushUPP)(uint32 size); -#define NewNPN_MemFlushProc(FUNC) \ - ((NPN_MemFlushUPP) (FUNC)) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - - -/* NPN_ReloadPlugins */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_ReloadPluginsUPP; -enum { - uppNPN_ReloadPluginsProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPN_ReloadPluginsProc(FUNC) \ - (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) - -#else - -typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages); -#define NewNPN_ReloadPluginsProc(FUNC) \ - ((NPN_ReloadPluginsUPP) (FUNC)) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_GetJavaEnv */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaEnvUPP; -enum { - uppNPN_GetJavaEnvProcInfo = kThinkCStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*))) -}; - -#define NewNPN_GetJavaEnvProc(FUNC) \ - (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) - -#else - -typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void); -#define NewNPN_GetJavaEnvProc(FUNC) \ - ((NPN_GetJavaEnvUPP) (FUNC)) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPN_GetJavaPeer */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaPeerUPP; -enum { - uppNPN_GetJavaPeerProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(jref))) -}; - -#define NewNPN_GetJavaPeerProc(FUNC) \ - (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) - -#else - -typedef jref (*NPN_GetJavaPeerUPP)(NPP instance); -#define NewNPN_GetJavaPeerProc(FUNC) \ - ((NPN_GetJavaPeerUPP) (FUNC)) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_InvalidateRect */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_InvalidateRectUPP; -enum { - uppNPN_InvalidateRectProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPN_InvalidateRectProc(FUNC) \ - (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture()) -#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2)) - -#else - -typedef void (*NPN_InvalidateRectUPP)(NPP instance, NPRect *rect); -#define NewNPN_InvalidateRectProc(FUNC) \ - ((NPN_InvalidateRectUPP) (FUNC)) -#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPN_InvalidateRegion */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_InvalidateRegionUPP; -enum { - uppNPN_InvalidateRegionProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion))) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPN_InvalidateRegionProc(FUNC) \ - (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture()) -#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2)) - -#else - -typedef void (*NPN_InvalidateRegionUPP)(NPP instance, NPRegion region); -#define NewNPN_InvalidateRegionProc(FUNC) \ - ((NPN_InvalidateRegionUPP) (FUNC)) -#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - -/* NPN_ForceRedraw */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_ForceRedrawUPP; -enum { - uppNPN_ForceRedrawProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(0))) -}; - -#define NewNPN_ForceRedrawProc(FUNC) \ - (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture()) -#define CallNPN_ForceRedrawProc(FUNC, ARG1) \ - (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1)) - -#else - -typedef void (*NPN_ForceRedrawUPP)(NPP instance); -#define NewNPN_ForceRedrawProc(FUNC) \ - ((NPN_ForceRedrawUPP) (FUNC)) -#define CallNPN_ForceRedrawProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/****************************************************************************************** - * The actual plugin function table definitions - *******************************************************************************************/ - -#ifdef XP_MAC -#pragma align=mac68k -#endif - -typedef struct _NPPluginFuncs { - uint16 size; - uint16 version; - NPP_NewUPP newp; - NPP_DestroyUPP destroy; - NPP_SetWindowUPP setwindow; - NPP_NewStreamUPP newstream; - NPP_DestroyStreamUPP destroystream; - NPP_StreamAsFileUPP asfile; - NPP_WriteReadyUPP writeready; - NPP_WriteUPP write; - NPP_PrintUPP print; - NPP_HandleEventUPP event; - NPP_URLNotifyUPP urlnotify; - JRIGlobalRef javaClass; - NPP_GetValueUPP getvalue; - NPP_SetValueUPP setvalue; -} NPPluginFuncs; - -typedef struct _NPNetscapeFuncs { - uint16 size; - uint16 version; - NPN_GetURLUPP geturl; - NPN_PostURLUPP posturl; - NPN_RequestReadUPP requestread; - NPN_NewStreamUPP newstream; - NPN_WriteUPP write; - NPN_DestroyStreamUPP destroystream; - NPN_StatusUPP status; - NPN_UserAgentUPP uagent; - NPN_MemAllocUPP memalloc; - NPN_MemFreeUPP memfree; - NPN_MemFlushUPP memflush; - NPN_ReloadPluginsUPP reloadplugins; - NPN_GetJavaEnvUPP getJavaEnv; - NPN_GetJavaPeerUPP getJavaPeer; - NPN_GetURLNotifyUPP geturlnotify; - NPN_PostURLNotifyUPP posturlnotify; - NPN_GetValueUPP getvalue; - NPN_SetValueUPP setvalue; - NPN_InvalidateRectUPP invalidaterect; - NPN_InvalidateRegionUPP invalidateregion; - NPN_ForceRedrawUPP forceredraw; -} NPNetscapeFuncs; - -#ifdef XP_MAC -#pragma align=reset -#endif - - -#ifdef XP_MAC -/****************************************************************************************** - * Mac platform-specific plugin glue stuff - *******************************************************************************************/ - -/* - * Main entry point of the plugin. - * This routine will be called when the plugin is loaded. The function - * tables are passed in and the plugin fills in the NPPluginFuncs table - * and NPPShutdownUPP for Netscape's use. - */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_MainEntryUPP; -enum { - uppNPP_MainEntryProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_MainEntryProc(FUNC) \ - (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture()) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) - -#else - -typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*); -#define NewNPP_MainEntryProc(FUNC) \ - ((NPP_MainEntryUPP) (FUNC)) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) - -#endif -#endif /* MAC */ - - -#ifdef _WINDOWS - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs); - -NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs); - -NPError WINAPI NP_Shutdown(); - -#ifdef __cplusplus -} -#endif - -#endif /* _WINDOWS */ - -#ifdef XP_UNIX - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -char* NP_GetMIMEDescription(void); -NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); -NPError NP_Shutdown(void); - -#ifdef __cplusplus -} -#endif - -#endif /* XP_UNIX */ - -#endif /* _NPUPP_H_ */ diff --git a/embedding/browser/activex/src/pluginhostctrl/resource.h b/embedding/browser/activex/src/pluginhostctrl/resource.h deleted file mode 100644 index fe3203538ca..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/resource.h +++ /dev/null @@ -1,18 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by pluginhostctrl.rc -// -#define IDS_PROJNAME 100 -#define IDB_PLUGINHOSTCTRL 101 -#define IDR_PLUGINHOSTCTRL 103 - -// 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 105 -#endif -#endif diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/ns4x_reference_test3.htm b/embedding/browser/activex/src/pluginhostctrl/tests/ns4x_reference_test3.htm deleted file mode 100644 index 23e6a5471c1..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/ns4x_reference_test3.htm +++ /dev/null @@ -1,14 +0,0 @@ - - -Reference test 3 for the plugin - - -

Run this in NS 4.x to compare behaviours!

- - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test1.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test1.htm deleted file mode 100644 index b6c884d1e3c..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test1.htm +++ /dev/null @@ -1,11 +0,0 @@ - - -Test 1 for the plugin - - -

Test for default plugin.

- - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test10.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test10.htm deleted file mode 100644 index b86bf1cd315..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test10.htm +++ /dev/null @@ -1,26 +0,0 @@ - - -Test 10 for the plugin - - -

This page passes multiple custom parameters "sw1" and "sw2" through to the Shockwave plugin.

-

Also note that if you don't have a plugin to handle the "application/x-director" content type - you can use the page to test that the null plugin is being correctly loaded instead - with the proper MIME type and pluginspage values.

-
- - - - - - - -
-

-To play:
-1.Click on PLAY to turn machine on.
-2.Press 1 or 2 for one or two player game.
-3.Hold space bar to pull plunger, release to shoot ball.
-4.Use [CONTROL] key for left flipper; [SHIFT] key for right flipper.
- - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test11.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test11.htm deleted file mode 100644 index 4dfd9790f77..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test11.htm +++ /dev/null @@ -1,10 +0,0 @@ - - -Test 11 for the plugin - - -

Test specifies no parameters at all.

- - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test2.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test2.htm deleted file mode 100644 index 41975219e61..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test2.htm +++ /dev/null @@ -1,12 +0,0 @@ - - -Test 2 for the plugin - - -

Test for Shockwave plugin.

- - - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test3.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test3.htm deleted file mode 100644 index db3460b3e2f..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test3.htm +++ /dev/null @@ -1,12 +0,0 @@ - - -Test 3 for the plugin - - -

Test for QuickTime plugin.

- - - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test4.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test4.htm deleted file mode 100644 index ac580b1d882..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test4.htm +++ /dev/null @@ -1,12 +0,0 @@ - - -Test 4 for the plugin - - -

Test for the Adobe Acrobat plugin

- - - - - - diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test5.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test5.htm deleted file mode 100644 index 1e6098b2c0d..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test5.htm +++ /dev/null @@ -1,15 +0,0 @@ - - -Test 5 for the plugin - - -

This page tests what happens when the plugin is fed a duff "foo/bar" MIME type. -It should show the default plugin. Clicking on the plugin should take you -to http://www.mozilla.org which is where the "pluginspage" parameter points.

- - - - - - - diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test6.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test6.htm deleted file mode 100644 index a541085224c..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test6.htm +++ /dev/null @@ -1,12 +0,0 @@ - - -Test 6 for the plugin - - -

This test (for Shockwave plugin) does not specify the content type as a parameter. -The control must create the right plugin using the content type of the source data.

- - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test7.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test7.htm deleted file mode 100644 index 3187ffdda84..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test7.htm +++ /dev/null @@ -1,14 +0,0 @@ - - -Test 7 for the plugin - - -

This page contains several plugins of the same type.

- - - - - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test8.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test8.htm deleted file mode 100644 index 0a295b5274a..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test8.htm +++ /dev/null @@ -1,16 +0,0 @@ - - -Test 8 for the plugin - - -

This page contains several plugins of a different kind.

- - - - - - - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/pluginhostctrl/tests/test9.htm b/embedding/browser/activex/src/pluginhostctrl/tests/test9.htm deleted file mode 100644 index 24cdf95d19c..00000000000 --- a/embedding/browser/activex/src/pluginhostctrl/tests/test9.htm +++ /dev/null @@ -1,15 +0,0 @@ - - -Test 9 for the plugin - - -

This page passes a custom parameter "LOOP" through to the quicktime plugin so -it plays the clip in a continuous loop.

- - - - - - - - \ No newline at end of file diff --git a/embedding/browser/activex/src/xml/ParseExpat.cpp b/embedding/browser/activex/src/xml/ParseExpat.cpp deleted file mode 100644 index 6cefa2a11b6..00000000000 --- a/embedding/browser/activex/src/xml/ParseExpat.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "stdafx.h" - -#define XML_UNICODE -#include "xmlparse.h" - -#ifdef XML_UNICODE -#define X2OLE W2COLE -#define X2T W2T -#else -#define X2OLE A2COLE -#define X2T A2T -#endif - - -struct ParserState -{ - CComQIPtr spXMLDocument; - CComQIPtr spXMLRoot; - CComQIPtr spXMLParent; -}; - -static ParserState cParserState; - - -// XML data handlers -static void OnStartElement(void *userData, const XML_Char *name, const XML_Char **atts); -static void OnEndElement(void *userData, const XML_Char *name); -static void OnCharacterData(void *userData, const XML_Char *s, int len); -static void OnDefault(void *userData, const XML_Char *s, int len); - - -struct ParseData -{ - CComQIPtr spDocument; - CComQIPtr spRoot; -}; - -HRESULT ParseExpat(const char *pBuffer, unsigned long cbBufSize, IXMLDocument *pDocument, IXMLElement **ppElement) -{ - if (pDocument == NULL) - { - return E_INVALIDARG; - } - - XML_Parser parser = XML_ParserCreate(NULL); - HRESULT hr = S_OK; - - cParserState.spXMLDocument = pDocument; - pDocument->get_root(&cParserState.spXMLParent); - - // Initialise the XML parser - XML_SetUserData(parser, &cParserState); - - // Initialise the data handlers - XML_SetElementHandler(parser, OnStartElement, OnEndElement); - XML_SetCharacterDataHandler(parser, OnCharacterData); - XML_SetDefaultHandler(parser, OnDefault); - - // Parse the data - if (!XML_Parse(parser, pBuffer, cbBufSize, 1)) - { - /* TODO Create error code - fprintf(stderr, - "%s at line %d\n", - XML_ErrorString(XML_GetErrorCode(parser)), - XML_GetCurrentLineNumber(parser)); - */ - hr = E_FAIL; - } - - // Cleanup - XML_ParserFree(parser); - - cParserState.spXMLRoot->QueryInterface(IID_IXMLElement, (void **) ppElement); - cParserState.spXMLDocument.Release(); - cParserState.spXMLParent.Release(); - - return S_OK; -} - - -/////////////////////////////////////////////////////////////////////////////// - - -void OnStartElement(void *userData, const XML_Char *name, const XML_Char **atts) -{ - ParserState *pState = (ParserState *) userData; - if (pState) - { - USES_CONVERSION; - - CComQIPtr spXMLElement; - - // Create a new element - pState->spXMLDocument->createElement( - CComVariant(XMLELEMTYPE_ELEMENT), - CComVariant(X2OLE(name)), - &spXMLElement); - - if (spXMLElement) - { - // Create each attribute - for (int i = 0; atts[i] != NULL; i += 2) - { - const XML_Char *pszName = atts[i]; - const XML_Char *pszValue = atts[i+1]; - spXMLElement->setAttribute((BSTR) X2OLE(pszName), CComVariant(X2OLE(pszValue))); - } - - if (pState->spXMLRoot == NULL) - { - pState->spXMLRoot = spXMLElement; - } - if (pState->spXMLParent) - { - // Add the element to the end of the list - pState->spXMLParent->addChild(spXMLElement, -1, -1); - } - pState->spXMLParent = spXMLElement; - } - } -} - - -void OnEndElement(void *userData, const XML_Char *name) -{ - ParserState *pState = (ParserState *) userData; - if (pState) - { - CComQIPtr spNewParent; - if (pState->spXMLParent) - { - pState->spXMLParent->get_parent(&spNewParent); - pState->spXMLParent = spNewParent; - } - } -} - - -void OnDefault(void *userData, const XML_Char *s, int len) -{ - XML_Char *pString = new XML_Char[len + 1]; - memset(pString, 0, sizeof(XML_Char) * (len + 1)); - memcpy(pString, s, sizeof(XML_Char) * len); - - USES_CONVERSION; - ATLTRACE(_T("OnDefault: \"%s\"\n"), X2T(pString)); - - // TODO test if the buffer contains - // and store version in XML document - - // TODO test if the buffer contains DTD and store it - // in the XML document - - // TODO test if the buffer contains a comment, i.e. - // and create a comment XML element - - delete []pString; -} - - -void OnCharacterData(void *userData, const XML_Char *s, int len) -{ - ParserState *pState = (ParserState *) userData; - if (pState) - { - // TODO create TEXT element - } -} - - diff --git a/embedding/browser/activex/src/xml/StdAfx.cpp b/embedding/browser/activex/src/xml/StdAfx.cpp deleted file mode 100644 index a5eea178f78..00000000000 --- a/embedding/browser/activex/src/xml/StdAfx.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// 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 -#include -#endif - -#include diff --git a/embedding/browser/activex/src/xml/StdAfx.h b/embedding/browser/activex/src/xml/StdAfx.h deleted file mode 100644 index 88df7b7f1ec..00000000000 --- a/embedding/browser/activex/src/xml/StdAfx.h +++ /dev/null @@ -1,40 +0,0 @@ -// 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__45E5B413_2805_11D3_9425_000000000000__INCLUDED_) -#define AFX_STDAFX_H__45E5B413_2805_11D3_9425_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define STRICT -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0403 -#endif -#define _ATL_APARTMENT_THREADED - -#include -//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 - -//#include "activexml.h" - -extern const CLSID CLSID_MozXMLElement; -extern const CLSID CLSID_MozXMLDocument; -extern const CLSID CLSID_MozXMLElementCollection; -extern const IID LIBID_MozActiveXMLLib; - -#include "XMLElement.h" -#include "XMLElementCollection.h" -#include "XMLDocument.h" - -extern HRESULT ParseExpat(const char *pBuffer, unsigned long cbBufSize, IXMLDocument *pDocument, IXMLElement **ppElement); - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__45E5B413_2805_11D3_9425_000000000000__INCLUDED) diff --git a/embedding/browser/activex/src/xml/XMLDocument.cpp b/embedding/browser/activex/src/xml/XMLDocument.cpp deleted file mode 100644 index 3f71405dc62..00000000000 --- a/embedding/browser/activex/src/xml/XMLDocument.cpp +++ /dev/null @@ -1,328 +0,0 @@ -// XMLDocument.cpp : Implementation of CXMLDocument -#include "stdafx.h" -//#include "Activexml.h" -#include "XMLDocument.h" - - -CXMLDocument::CXMLDocument() -{ - ATLTRACE(_T("CXMLDocument::CXMLDocument()\n")); - m_nReadyState = READYSTATE_COMPLETE; -} - - -CXMLDocument::~CXMLDocument() -{ -} - - -///////////////////////////////////////////////////////////////////////////// -// CXMLDocument - - -STDMETHODIMP CXMLDocument::InterfaceSupportsErrorInfo(REFIID riid) -{ - static const IID* arr[] = - { - &IID_IXMLDocument - }; - for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++) - { - if (InlineIsEqualGUID(*arr[i],riid)) - return S_OK; - } - return S_FALSE; -} - - -///////////////////////////////////////////////////////////////////////////// -// IPersistStreamInit implementation - - -HRESULT STDMETHODCALLTYPE CXMLDocument::Load(/* [in] */ LPSTREAM pStm) -{ - if (pStm == NULL) - { - return E_INVALIDARG; - } - - // Load the XML from the stream - STATSTG statstg; - pStm->Stat(&statstg, STATFLAG_NONAME); - - ULONG cbBufSize = statstg.cbSize.LowPart; - - char *pBuffer = new char[cbBufSize]; - if (pBuffer == NULL) - { - return E_OUTOFMEMORY; - } - - memset(pBuffer, 0, cbBufSize); - pStm->Read(pBuffer, cbBufSize, NULL); - - m_spRoot.Release(); - ParseExpat(pBuffer, cbBufSize, (IXMLDocument *) this, &m_spRoot); - - delete []pBuffer; - - m_nReadyState = READYSTATE_LOADED; - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::Save(/* [in] */ LPSTREAM pStm, /* [in] */ BOOL fClearDirty) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::GetSizeMax(/* [out] */ ULARGE_INTEGER __RPC_FAR *pCbSize) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::InitNew(void) -{ - return S_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// IPersistMoniker implementation - - -HRESULT STDMETHODCALLTYPE CXMLDocument::GetClassID(/* [out] */ CLSID __RPC_FAR *pClassID) -{ - if (pClassID == NULL) - { - return E_INVALIDARG; - } - *pClassID = CLSID_MozXMLDocument; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::IsDirty(void) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::Load(/* [in] */ BOOL fFullyAvailable, /* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pibc, /* [in] */ DWORD grfMode) -{ - if (pimkName == NULL) - { - return E_INVALIDARG; - } - - m_nReadyState = READYSTATE_LOADING; - - // Bind to the stream specified by the moniker - CComQIPtr spIStream; - if (FAILED(pimkName->BindToStorage(pibc, NULL, IID_IStream, (void **) &spIStream))) - { - return E_FAIL; - } - - return Load(spIStream); -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::Save(/* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pbc, /* [in] */ BOOL fRemember) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::SaveCompleted(/* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pibc) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::GetCurMoniker(/* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppimkName) -{ - return E_NOTIMPL; -} - - -///////////////////////////////////////////////////////////////////////////// -// IXMLError implementation - -HRESULT STDMETHODCALLTYPE CXMLDocument::GetErrorInfo(XML_ERROR __RPC_FAR *pErrorReturn) -{ - return E_NOTIMPL; -} - -///////////////////////////////////////////////////////////////////////////// -// IXMLDocument implementation - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_root(/* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - *p = NULL; - if (m_spRoot) - { - m_spRoot->QueryInterface(IID_IXMLElement, (void **) p); - } - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_fileSize(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_fileModifiedDate(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_fileUpdatedDate(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_URL(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - USES_CONVERSION; - *p = SysAllocString(A2OLE(m_szURL.c_str())); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::put_URL(/* [in] */ BSTR p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - - USES_CONVERSION; - m_szURL = OLE2A(p); - - // Destroy old document - CComQIPtr spIMoniker; - if (FAILED(CreateURLMoniker(NULL, A2W(m_szURL.c_str()), &spIMoniker))) - { - return E_FAIL; - } - - CComQIPtr spIBindCtx; - if (FAILED(CreateBindCtx(0, &spIBindCtx))) - { - return E_FAIL; - } - - if (FAILED(Load(TRUE, spIMoniker, spIBindCtx, 0))) - { - return E_FAIL; - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_mimeType(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_readyState(/* [out][retval] */ long __RPC_FAR *pl) -{ - if (pl == NULL) - { - return E_INVALIDARG; - } - *pl = m_nReadyState; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_charset(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::put_charset(/* [in] */ BSTR p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_version(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_doctype(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::get_dtdURL(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLDocument::createElement(/* [in] */ VARIANT vType, /* [in][optional] */ VARIANT var1, /* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *ppElem) -{ - if (vType.vt != VT_I4) - { - return E_INVALIDARG; - } - if (ppElem == NULL) - { - return E_INVALIDARG; - } - - CXMLElementInstance *pInstance = NULL; - CXMLElementInstance::CreateInstance(&pInstance); - if (pInstance == NULL) - { - return E_OUTOFMEMORY; - } - - IXMLElement *pElement = NULL; - if (FAILED(pInstance->QueryInterface(IID_IXMLElement, (void **) &pElement))) - { - pInstance->Release(); - return E_NOINTERFACE; - } - - // Set the element type - long nType = vType.intVal; - pInstance->PutType(nType); - - // Set the tag name - if (var1.vt == VT_BSTR) - { - pInstance->put_tagName(var1.bstrVal); - } - - *ppElem = pElement; - return S_OK; -} - - diff --git a/embedding/browser/activex/src/xml/XMLDocument.h b/embedding/browser/activex/src/xml/XMLDocument.h deleted file mode 100644 index 27b38095910..00000000000 --- a/embedding/browser/activex/src/xml/XMLDocument.h +++ /dev/null @@ -1,80 +0,0 @@ -// XMLDocument.h : Declaration of the CXMLDocument - -#ifndef __XMLDOCUMENT_H_ -#define __XMLDOCUMENT_H_ - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CXMLDocument -class ATL_NO_VTABLE CXMLDocument : - public CComObjectRootEx, - public CComCoClass, - public ISupportErrorInfo, - public IDispatchImpl, - public IPersistMoniker, - public IPersistStreamInit -{ -public: - CXMLDocument(); - virtual ~CXMLDocument(); - - -DECLARE_REGISTRY_RESOURCEID(IDR_XMLDOCUMENT) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CXMLDocument) - COM_INTERFACE_ENTRY(IXMLDocument) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IPersistMoniker) - COM_INTERFACE_ENTRY(IPersistStreamInit) -// COM_INTERFACE_ENTRY(ISupportErrorInfo) -END_COM_MAP() - - LONG m_nReadyState; - std::string m_szURL; - CComQIPtr m_spRoot; - -// ISupportsErrorInfo - STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); - -// IPersistStreamInit - //virtual HRESULT STDMETHODCALLTYPE IsDirty(void); - HRESULT STDMETHODCALLTYPE Load(/* [in] */ LPSTREAM pStm); - HRESULT STDMETHODCALLTYPE Save(/* [in] */ LPSTREAM pStm, /* [in] */ BOOL fClearDirty); - HRESULT STDMETHODCALLTYPE GetSizeMax(/* [out] */ ULARGE_INTEGER __RPC_FAR *pCbSize); - HRESULT STDMETHODCALLTYPE InitNew(void); - -// IPersistMoniker - HRESULT STDMETHODCALLTYPE GetClassID(/* [out] */ CLSID __RPC_FAR *pClassID); - HRESULT STDMETHODCALLTYPE IsDirty(void); - HRESULT STDMETHODCALLTYPE Load(/* [in] */ BOOL fFullyAvailable, /* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pibc, /* [in] */ DWORD grfMode); - HRESULT STDMETHODCALLTYPE Save(/* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pbc, /* [in] */ BOOL fRemember); - HRESULT STDMETHODCALLTYPE SaveCompleted(/* [in] */ IMoniker __RPC_FAR *pimkName, /* [in] */ LPBC pibc); - HRESULT STDMETHODCALLTYPE GetCurMoniker(/* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppimkName); - -// IXMLError - HRESULT STDMETHODCALLTYPE GetErrorInfo(XML_ERROR __RPC_FAR *pErrorReturn); - -// IXMLDocument - HRESULT STDMETHODCALLTYPE get_root(/* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_fileSize(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_fileModifiedDate(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_fileUpdatedDate(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_URL(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE put_URL(/* [in] */ BSTR p); - HRESULT STDMETHODCALLTYPE get_mimeType(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_readyState(/* [out][retval] */ long __RPC_FAR *pl); - HRESULT STDMETHODCALLTYPE get_charset(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE put_charset(/* [in] */ BSTR p); - HRESULT STDMETHODCALLTYPE get_version(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_doctype(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE get_dtdURL(/* [out][retval] */ BSTR __RPC_FAR *p); - HRESULT STDMETHODCALLTYPE createElement(/* [in] */ VARIANT vType, /* [in][optional] */ VARIANT var1, /* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *ppElem); -public: -}; - -typedef CComObject CXMLDocumentInstance; - -#endif //__XMLDOCUMENT_H_ diff --git a/embedding/browser/activex/src/xml/XMLDocument.rgs b/embedding/browser/activex/src/xml/XMLDocument.rgs deleted file mode 100644 index e7ffeca58cf..00000000000 --- a/embedding/browser/activex/src/xml/XMLDocument.rgs +++ /dev/null @@ -1,26 +0,0 @@ -HKCR -{ - Mozilla.XMLDocument.1 = s 'Mozilla XMLDocument Class' - { - CLSID = s '{45E5B41D-2805-11D3-9425-000000000000}' - } - Mozilla.XMLDocument = s 'Mozilla XMLDocument Class' - { - CLSID = s '{45E5B41D-2805-11D3-9425-000000000000}' - CurVer = s 'Mozilla.XMLDocument.1' - } - NoRemove CLSID - { - ForceRemove {45E5B41D-2805-11D3-9425-000000000000} = s 'Mozilla XMLDocument Class' - { - ProgID = s 'Mozilla.XMLDocument.1' - VersionIndependentProgID = s 'Mozilla.XMLDocument' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - 'TypeLib' = s '{45E5B410-2805-11D3-9425-000000000000}' - } - } -} diff --git a/embedding/browser/activex/src/xml/XMLElement.cpp b/embedding/browser/activex/src/xml/XMLElement.cpp deleted file mode 100644 index 11145fb7bfe..00000000000 --- a/embedding/browser/activex/src/xml/XMLElement.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// XMLElement.cpp : Implementation of CXMLElement -#include "stdafx.h" -//#include "Activexml.h" -#include "XMLElement.h" - - -CXMLElement::CXMLElement() -{ - m_nType = 0; - m_pParent = NULL; -} - - -CXMLElement::~CXMLElement() -{ -} - - -HRESULT CXMLElement::SetParent(IXMLElement *pParent) -{ - // Note: parent is not refcounted - m_pParent = pParent; - return S_OK; -} - - -HRESULT CXMLElement::PutType(long nType) -{ - m_nType = nType; - return S_OK; -} - - -HRESULT CXMLElement::ReleaseAll() -{ - // Release all children - m_cChildren.clear(); - return S_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// CXMLElement - - -// Return the element's tag name -HRESULT STDMETHODCALLTYPE CXMLElement::get_tagName(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - USES_CONVERSION; - *p = SysAllocString(A2OLE(m_szTagName.c_str())); - return S_OK; -} - - -// Store the tag name -HRESULT STDMETHODCALLTYPE CXMLElement::put_tagName(/* [in] */ BSTR p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - USES_CONVERSION; - m_szTagName = OLE2A(p); - return S_OK; -} - - -// Returns the parent element -HRESULT STDMETHODCALLTYPE CXMLElement::get_parent(/* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *ppParent) -{ - if (ppParent == NULL) - { - return E_INVALIDARG; - } - - *ppParent = NULL; - if (m_pParent) - { - return m_pParent->QueryInterface(IID_IXMLElement, (void **) ppParent); - } - - return S_OK; -} - - -// Set the specified attribute value -HRESULT STDMETHODCALLTYPE CXMLElement::setAttribute(/* [in] */ BSTR strPropertyName, /* [in] */ VARIANT PropertyValue) -{ - if (strPropertyName == NULL || PropertyValue.vt != VT_BSTR) - { - return E_INVALIDARG; - } - - USES_CONVERSION; - std::string szPropertyName = OLE2A(strPropertyName); - std::string szPropertyValue = OLE2A(PropertyValue.bstrVal); - m_cAttributes[szPropertyName] = szPropertyValue; - - return S_OK; -} - - -// Return the requested attribute -HRESULT STDMETHODCALLTYPE CXMLElement::getAttribute(/* [in] */ BSTR strPropertyName, /* [out][retval] */ VARIANT __RPC_FAR *PropertyValue) -{ - if (strPropertyName == NULL || PropertyValue == NULL) - { - return E_INVALIDARG; - } - - USES_CONVERSION; - std::string szPropertyName = OLE2A(strPropertyName); - StringMap::iterator i = m_cAttributes.find(szPropertyName); - if (i == m_cAttributes.end()) - { - return S_FALSE; - } - - PropertyValue->vt = VT_BSTR; - PropertyValue->bstrVal = SysAllocString(A2OLE((*i).second.c_str())); - return S_OK; -} - - -// Find and remove the specified attribute -HRESULT STDMETHODCALLTYPE CXMLElement::removeAttribute(/* [in] */ BSTR strPropertyName) -{ - if (strPropertyName == NULL) - { - return E_INVALIDARG; - } - - USES_CONVERSION; - std::string szPropertyName = OLE2A(strPropertyName); - StringMap::iterator i = m_cAttributes.find(szPropertyName); - if (i == m_cAttributes.end()) - { - return E_INVALIDARG; - } - - m_cAttributes.erase(i); - - return S_OK; -} - - -// Return the child collection for this element -HRESULT STDMETHODCALLTYPE CXMLElement::get_children(/* [out][retval] */ IXMLElementCollection __RPC_FAR *__RPC_FAR *pp) -{ - CXMLElementCollectionInstance *pCollection = NULL; - CXMLElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - return E_OUTOFMEMORY; - } - - // Add children to the collection - for (ElementList::iterator i = m_cChildren.begin(); i != m_cChildren.end(); i++) - { - pCollection->Add(*i); - } - - pCollection->QueryInterface(IID_IXMLElementCollection, (void **) pp); - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLElement::get_type(/* [out][retval] */ long __RPC_FAR *plType) -{ - if (plType == NULL) - { - return E_INVALIDARG; - } - *plType = m_nType; - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLElement::get_text(/* [out][retval] */ BSTR __RPC_FAR *p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLElement::put_text(/* [in] */ BSTR p) -{ - return E_NOTIMPL; -} - - -HRESULT STDMETHODCALLTYPE CXMLElement::addChild(/* [in] */ IXMLElement __RPC_FAR *pChildElem, long lIndex, long lReserved) -{ - if (pChildElem == NULL) - { - return E_INVALIDARG; - } - - // Set the child's parent to be this element - ((CXMLElement *) pChildElem)->SetParent(this); - - if (lIndex < 0 || lIndex >= m_cChildren.size()) - { - // Append to end - m_cChildren.push_back(pChildElem); - } - else - { -// TODO m_cChildren.insert(&m_cChildren[lIndex]); - m_cChildren.push_back(pChildElem); - } - - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLElement::removeChild(/* [in] */ IXMLElement __RPC_FAR *pChildElem) -{ - // TODO - return E_NOTIMPL; -} - diff --git a/embedding/browser/activex/src/xml/XMLElement.h b/embedding/browser/activex/src/xml/XMLElement.h deleted file mode 100644 index ed5a2fd2802..00000000000 --- a/embedding/browser/activex/src/xml/XMLElement.h +++ /dev/null @@ -1,71 +0,0 @@ -// XMLElement.h : Declaration of the CXMLElement - -#ifndef __XMLELEMENT_H_ -#define __XMLELEMENT_H_ - -#include "resource.h" // main symbols - -#include -#include -#include - -typedef std::map StringMap; -typedef std::vector< CComQIPtr > ElementList; - -///////////////////////////////////////////////////////////////////////////// -// CXMLElement -class ATL_NO_VTABLE CXMLElement : - public CComObjectRootEx, - public CComCoClass, - public IDispatchImpl -{ - // Pointer to parent - IXMLElement *m_pParent; - // List of children - ElementList m_cChildren; - // Tag name - std::string m_szTagName; - // Text - std::string m_szText; - // Type - long m_nType; - // Attribute list - StringMap m_cAttributes; - -public: - CXMLElement(); - virtual ~CXMLElement(); - - virtual HRESULT SetParent(IXMLElement *pParent); - virtual HRESULT PutType(long nType); - virtual HRESULT ReleaseAll(); - -DECLARE_REGISTRY_RESOURCEID(IDR_XMLELEMENT) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CXMLElement) - COM_INTERFACE_ENTRY(IXMLElement) - COM_INTERFACE_ENTRY(IDispatch) -END_COM_MAP() - -// IXMLElement - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_tagName(/* [out][retval] */ BSTR __RPC_FAR *p); - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_tagName(/* [in] */ BSTR p); - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_parent(/* [out][retval] */ IXMLElement __RPC_FAR *__RPC_FAR *ppParent); - virtual /* [id] */ HRESULT STDMETHODCALLTYPE setAttribute(/* [in] */ BSTR strPropertyName, /* [in] */ VARIANT PropertyValue); - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getAttribute(/* [in] */ BSTR strPropertyName, /* [out][retval] */ VARIANT __RPC_FAR *PropertyValue); - virtual /* [id] */ HRESULT STDMETHODCALLTYPE removeAttribute(/* [in] */ BSTR strPropertyName); - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_children(/* [out][retval] */ IXMLElementCollection __RPC_FAR *__RPC_FAR *pp); - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_type(/* [out][retval] */ long __RPC_FAR *plType); - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_text(/* [out][retval] */ BSTR __RPC_FAR *p); - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_text(/* [in] */ BSTR p); - virtual /* [id] */ HRESULT STDMETHODCALLTYPE addChild(/* [in] */ IXMLElement __RPC_FAR *pChildElem, long lIndex, long lReserved); - virtual /* [id] */ HRESULT STDMETHODCALLTYPE removeChild(/* [in] */ IXMLElement __RPC_FAR *pChildElem); - -public: -}; - -typedef CComObject CXMLElementInstance; - -#endif //__XMLELEMENT_H_ diff --git a/embedding/browser/activex/src/xml/XMLElement.rgs b/embedding/browser/activex/src/xml/XMLElement.rgs deleted file mode 100644 index 11b01748ef6..00000000000 --- a/embedding/browser/activex/src/xml/XMLElement.rgs +++ /dev/null @@ -1,26 +0,0 @@ -HKCR -{ - Mozilla.XMLElement.1 = s 'MozillaXMLElement Class' - { - CLSID = s '{45E5B420-2805-11D3-9425-000000000000}' - } - Mozilla..MLElement = s 'MozillaXMLElement Class' - { - CLSID = s '{45E5B420-2805-11D3-9425-000000000000}' - CurVer = s 'Mozilla.XMLElement.1' - } - NoRemove CLSID - { - ForceRemove {45E5B420-2805-11D3-9425-000000000000} = s 'Mozilla XMLElement Class' - { - ProgID = s 'Mozilla.XMLElement.1' - VersionIndependentProgID = s 'Mozilla.XMLElement' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - 'TypeLib' = s '{45E5B410-2805-11D3-9425-000000000000}' - } - } -} diff --git a/embedding/browser/activex/src/xml/XMLElementCollection.cpp b/embedding/browser/activex/src/xml/XMLElementCollection.cpp deleted file mode 100644 index 4e4752e9a53..00000000000 --- a/embedding/browser/activex/src/xml/XMLElementCollection.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// XMLElementCollection.cpp : Implementation of CXMLElementCollection -#include "stdafx.h" -//#include "Activexml.h" -#include "XMLElementCollection.h" - -CXMLElementCollection::CXMLElementCollection() -{ -} - - -CXMLElementCollection::~CXMLElementCollection() -{ -} - - -HRESULT CXMLElementCollection::Add(IXMLElement *pElement) -{ - if (pElement == NULL) - { - return E_INVALIDARG; - } - - m_cElements.push_back( CComQIPtr(pElement)); - return S_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// CXMLElementCollection - -HRESULT STDMETHODCALLTYPE CXMLElementCollection::put_length(/* [in] */ long v) -{ - // Why does MS define a method that has no purpose? - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLElementCollection::get_length(/* [out][retval] */ long __RPC_FAR *p) -{ - if (p == NULL) - { - return E_INVALIDARG; - } - *p = m_cElements.size(); - return S_OK; -} - - -HRESULT STDMETHODCALLTYPE CXMLElementCollection::get__newEnum(/* [out][retval] */ IUnknown __RPC_FAR *__RPC_FAR *ppUnk) -{ - return E_NOTIMPL; -} - - -// Perhaps the most overly complicated method ever... -HRESULT STDMETHODCALLTYPE CXMLElementCollection::item(/* [in][optional] */ VARIANT var1, /* [in][optional] */ VARIANT var2, /* [out][retval] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp) -{ - if (ppDisp == NULL) - { - return E_INVALIDARG; - } - - *ppDisp; - - CComVariant vIndex; - - // If var1 is a number, the caller wants the element at the specified index - - if (vIndex.ChangeType(VT_I4, &var1) == S_OK) - { - long nIndex = vIndex.intVal; - if (nIndex < 0 || nIndex >= m_cElements.size()) - { - return E_INVALIDARG; - } - // Get the element at the specified index - m_cElements[nIndex]->QueryInterface(IID_IDispatch, (void **) ppDisp); - return S_OK; - } - - // If var1 is a string, the caller wants a collection of all elements with - // the matching tagname, unless var2 contains an index or if there is only - // one in which case just the element is returned. - - CComVariant vName; - if (FAILED(vName.ChangeType(VT_BSTR, &var1))) - { - return E_INVALIDARG; - } - - // Compile a list of elements matching the name - ElementList cElements; - ElementList::iterator i; - - for (i = m_cElements.begin(); i != m_cElements.end(); i++) - { - CComQIPtr spElement; - BSTR bstrTagName = NULL; - (*i)->get_tagName(&bstrTagName); - if (bstrTagName) - { - if (wcscmp(bstrTagName, vName.bstrVal) == 0) - { - cElements.push_back(*i); - } - SysFreeString(bstrTagName); - } - } - - // Are there any matching elements? - if (cElements.empty()) - { - return S_OK; - } - - // Does var2 contain an index? - if (var2.vt == VT_I4) - { - long nIndex = var2.vt; - if (nIndex < 0 || nIndex >= cElements.size()) - { - return E_INVALIDARG; - } - - // Get the element at the specified index - cElements[nIndex]->QueryInterface(IID_IDispatch, (void **) ppDisp); - return S_OK; - } - - // Is there more than one element? - if (cElements.size() > 1) - { - // Create another collection - CXMLElementCollectionInstance *pCollection = NULL; - CXMLElementCollectionInstance::CreateInstance(&pCollection); - if (pCollection == NULL) - { - return E_OUTOFMEMORY; - } - - if (FAILED(pCollection->QueryInterface(IID_IDispatch, (void **) ppDisp))) - { - pCollection->Release(); - return E_FAIL; - } - - // Add elements to the collection - for (i = cElements.begin(); i != cElements.end(); i++) - { - pCollection->Add(*i); - } - - return S_OK; - } - - // Return the pointer to the element - if (FAILED(cElements[0]->QueryInterface(IID_IDispatch, (void **) ppDisp))) - { - return E_FAIL; - } - - return S_OK; -} - diff --git a/embedding/browser/activex/src/xml/XMLElementCollection.h b/embedding/browser/activex/src/xml/XMLElementCollection.h deleted file mode 100644 index 0f1f815c94f..00000000000 --- a/embedding/browser/activex/src/xml/XMLElementCollection.h +++ /dev/null @@ -1,43 +0,0 @@ -// XMLElementCollection.h : Declaration of the CXMLElementCollection - -#ifndef __XMLELEMENTCOLLECTION_H_ -#define __XMLELEMENTCOLLECTION_H_ - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CXMLElementCollection -class ATL_NO_VTABLE CXMLElementCollection : - public CComObjectRootEx, - public CComCoClass, - public IDispatchImpl -{ - // List of elements - ElementList m_cElements; - -public: - CXMLElementCollection(); - virtual ~CXMLElementCollection(); - -DECLARE_REGISTRY_RESOURCEID(IDR_XMLELEMENTCOLLECTION) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CXMLElementCollection) - COM_INTERFACE_ENTRY(IXMLElementCollection) - COM_INTERFACE_ENTRY(IDispatch) -END_COM_MAP() - -// IXMLElementCollection - virtual HRESULT STDMETHODCALLTYPE put_length(/* [in] */ long v); - virtual HRESULT STDMETHODCALLTYPE get_length(/* [out][retval] */ long __RPC_FAR *p); - virtual HRESULT STDMETHODCALLTYPE get__newEnum(/* [out][retval] */ IUnknown __RPC_FAR *__RPC_FAR *ppUnk); - virtual HRESULT STDMETHODCALLTYPE item(/* [in][optional] */ VARIANT var1, /* [in][optional] */ VARIANT var2, /* [out][retval] */ IDispatch __RPC_FAR *__RPC_FAR *ppDisp); - -public: - HRESULT Add(IXMLElement *pElement); -}; - -typedef CComObject CXMLElementCollectionInstance; - -#endif //__XMLELEMENTCOLLECTION_H_ diff --git a/embedding/browser/activex/src/xml/XMLElementCollection.rgs b/embedding/browser/activex/src/xml/XMLElementCollection.rgs deleted file mode 100644 index 83957c617c9..00000000000 --- a/embedding/browser/activex/src/xml/XMLElementCollection.rgs +++ /dev/null @@ -1,26 +0,0 @@ -HKCR -{ - Mozilla.XMLElementCollection.1 = s 'Mozilla XMLElementCollection Class' - { - CLSID = s '{45E5B422-2805-11D3-9425-000000000000}' - } - Mozilla.XMLElementCollection = s 'Mozilla XMLElementCollection Class' - { - CLSID = s '{45E5B422-2805-11D3-9425-000000000000}' - CurVer = s 'Mozilla.XMLElementCollection.1' - } - NoRemove CLSID - { - ForceRemove {45E5B422-2805-11D3-9425-000000000000} = s 'Mozilla XMLElementCollection Class' - { - ProgID = s 'Mozilla.XMLElementCollection.1' - VersionIndependentProgID = s 'Mozilla.XMLElementCollection' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - 'TypeLib' = s '{45E5B410-2805-11D3-9425-000000000000}' - } - } -} diff --git a/embedding/browser/activex/src/xml/activexml.cpp b/embedding/browser/activex/src/xml/activexml.cpp deleted file mode 100644 index 3422bc8cfe2..00000000000 --- a/embedding/browser/activex/src/xml/activexml.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// activexml.cpp : Implementation of DLL Exports. - - -// Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, -// run nmake -f activexmlps.mk in the project directory. - -#include "stdafx.h" -#include "resource.h" -//#include -//#include "activexml.h" - -#include "activexml_i.c" -#include "XMLDocument.h" -#include "XMLElement.h" -#include "XMLElementCollection.h" - - -CComModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) -OBJECT_ENTRY(CLSID_MozXMLDocument, CXMLDocument) -//OBJECT_ENTRY(CLSID_MozXMLElement, CXMLElement) -//OBJECT_ENTRY(CLSID_MozXMLElementCollection, CXMLElementCollection) -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, &LIBID_MozActiveXMLLib); - 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) -{ - return _Module.UnregisterServer(TRUE); -} - - diff --git a/embedding/browser/activex/src/xml/activexml.def b/embedding/browser/activex/src/xml/activexml.def deleted file mode 100644 index 13f5afdb56d..00000000000 --- a/embedding/browser/activex/src/xml/activexml.def +++ /dev/null @@ -1,9 +0,0 @@ -; activexml.def : Declares the module parameters. - -LIBRARY "activexml.DLL" - -EXPORTS - DllCanUnloadNow @1 PRIVATE - DllGetClassObject @2 PRIVATE - DllRegisterServer @3 PRIVATE - DllUnregisterServer @4 PRIVATE diff --git a/embedding/browser/activex/src/xml/activexml.dsp b/embedding/browser/activex/src/xml/activexml.dsp deleted file mode 100644 index a62c105446b..00000000000 --- a/embedding/browser/activex/src/xml/activexml.dsp +++ /dev/null @@ -1,360 +0,0 @@ -# Microsoft Developer Studio Project File - Name="activexml" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=activexml - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "activexml.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "activexml.mak" CFG="activexml - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "activexml - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "activexml - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "activexml - Win32 Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "activexml - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "activexml - Win32 Unicode Release MinSize" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "activexml - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "activexml - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "M:\moz\mozilla\dist\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /Yu"stdafx.h" /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib Urlmon.lib M:\moz\mozilla\dist\WIN32_D.OBJ\lib\expat.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# Begin Custom Build - Performing registration -OutDir=.\Debug -TargetPath=.\Debug\activexml.dll -InputPath=.\Debug\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "activexml - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DebugU" -# PROP BASE Intermediate_Dir "DebugU" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DebugU" -# PROP Intermediate_Dir "DebugU" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# Begin Custom Build - Performing registration -OutDir=.\DebugU -TargetPath=.\DebugU\activexml.dll -InputPath=.\DebugU\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if "%OS%"=="" goto NOTNT - if not "%OS%"=="Windows_NT" goto NOTNT - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - goto end - :NOTNT - echo Warning : Cannot register Unicode DLL on Windows 95 - :end - -# End Custom Build - -!ELSEIF "$(CFG)" == "activexml - Win32 Release MinSize" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseMinSize" -# PROP BASE Intermediate_Dir "ReleaseMinSize" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinSize" -# PROP Intermediate_Dir "ReleaseMinSize" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseMinSize -TargetPath=.\ReleaseMinSize\activexml.dll -InputPath=.\ReleaseMinSize\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "activexml - Win32 Release MinDependency" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseMinDependency" -# PROP BASE Intermediate_Dir "ReleaseMinDependency" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseMinDependency" -# PROP Intermediate_Dir "ReleaseMinDependency" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseMinDependency -TargetPath=.\ReleaseMinDependency\activexml.dll -InputPath=.\ReleaseMinDependency\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - -# End Custom Build - -!ELSEIF "$(CFG)" == "activexml - Win32 Unicode Release MinSize" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseUMinSize" -# PROP BASE Intermediate_Dir "ReleaseUMinSize" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseUMinSize" -# PROP Intermediate_Dir "ReleaseUMinSize" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseUMinSize -TargetPath=.\ReleaseUMinSize\activexml.dll -InputPath=.\ReleaseUMinSize\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if "%OS%"=="" goto NOTNT - if not "%OS%"=="Windows_NT" goto NOTNT - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - goto end - :NOTNT - echo Warning : Cannot register Unicode DLL on Windows 95 - :end - -# End Custom Build - -!ELSEIF "$(CFG)" == "activexml - Win32 Unicode Release MinDependency" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseUMinDependency" -# PROP BASE Intermediate_Dir "ReleaseUMinDependency" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseUMinDependency" -# PROP Intermediate_Dir "ReleaseUMinDependency" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# Begin Custom Build - Performing registration -OutDir=.\ReleaseUMinDependency -TargetPath=.\ReleaseUMinDependency\activexml.dll -InputPath=.\ReleaseUMinDependency\activexml.dll -SOURCE="$(InputPath)" - -"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - if "%OS%"=="" goto NOTNT - if not "%OS%"=="Windows_NT" goto NOTNT - regsvr32 /s /c "$(TargetPath)" - echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" - goto end - :NOTNT - echo Warning : Cannot register Unicode DLL on Windows 95 - :end - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "activexml - Win32 Debug" -# Name "activexml - Win32 Unicode Debug" -# Name "activexml - Win32 Release MinSize" -# Name "activexml - Win32 Release MinDependency" -# Name "activexml - Win32 Unicode Release MinSize" -# Name "activexml - Win32 Unicode Release MinDependency" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\activexml.cpp -# End Source File -# Begin Source File - -SOURCE=.\activexml.def -# End Source File -# Begin Source File - -SOURCE=.\activexml.idl -# ADD MTL /tlb ".\activexml.tlb" /h "activexml.h" /iid "activexml_i.c" /Oicf -# End Source File -# Begin Source File - -SOURCE=.\activexml.rc -# End Source File -# Begin Source File - -SOURCE=.\ParseExpat.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# Begin Source File - -SOURCE=.\XMLDocument.cpp -# End Source File -# Begin Source File - -SOURCE=.\XMLElement.cpp -# End Source File -# Begin Source File - -SOURCE=.\XMLElementCollection.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# Begin Source File - -SOURCE=.\XMLDocument.h -# End Source File -# Begin Source File - -SOURCE=.\XMLElement.h -# End Source File -# Begin Source File - -SOURCE=.\XMLElementCollection.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\XMLDocument.rgs -# End Source File -# Begin Source File - -SOURCE=.\XMLElement.rgs -# End Source File -# Begin Source File - -SOURCE=.\XMLElementCollection.rgs -# End Source File -# End Group -# Begin Group "Expat" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\..\expat\xmlparse\xmlparse.h -# End Source File -# End Group -# End Target -# End Project diff --git a/embedding/browser/activex/src/xml/activexml.idl b/embedding/browser/activex/src/xml/activexml.idl deleted file mode 100644 index 04e1fe9bf38..00000000000 --- a/embedding/browser/activex/src/xml/activexml.idl +++ /dev/null @@ -1,143 +0,0 @@ -// activexml.idl : IDL source for activexml.dll -// - -// This file will be processed by the MIDL tool to -// produce the type library (activexml.tlb) and marshalling code. - -#include "msxmldid.h" - -//import "oaidl.idl"; -//import "ocidl.idl"; - -[ - uuid(45E5B410-2805-11D3-9425-000000000000), - version(1.0), - helpstring("Mozilla XML 1.0 Type Library") -] -library MozActiveXMLLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - typedef enum mozxmlelemTYPE { - XMLELEMTYPE_ELEMENT, - XMLELEMTYPE_TEXT, - XMLELEMTYPE_COMMENT, - XMLELEMTYPE_DOCUMENT, - XMLELEMTYPE_DTD, - XMLELEMTYPE_PI, - XMLELEMTYPE_OTHER - } XMLELEM_TYPE; - - interface IXMLElement; - - [ - object, - local, - uuid(65725580-9B5D-11d0-9BFE-00C04FC99C8E) // IID_IXMLElementCollection - ] - interface IXMLElementCollection : IDispatch - { - [propput, id(DISPID_XMLELEMENTCOLLECTION_LENGTH)] HRESULT length([in] long v); - [propget, id(DISPID_XMLELEMENTCOLLECTION_LENGTH)] HRESULT length([retval, out] long * p); - [propget, restricted, hidden, id(DISPID_XMLELEMENTCOLLECTION_NEWENUM)] HRESULT _newEnum([retval, out] IUnknown ** ppUnk); - [id(DISPID_XMLELEMENTCOLLECTION_ITEM)] HRESULT item([optional, in] VARIANT var1,[optional, in] VARIANT var2,[retval, out] IDispatch ** ppDisp); - }; - - [ - object, - local, - uuid(F52E2B61-18A1-11d1-B105-00805F49916B) // IID_IXMLDocument - ] - interface IXMLDocument : IDispatch - { - [propget, id(DISPID_XMLDOCUMENT_ROOT)] HRESULT root ([retval, out] IXMLElement * * p); - [propget, id(DISPID_XMLDOCUMENT_FILESIZE)] HRESULT fileSize([retval, out] BSTR * p); - [propget, id(DISPID_XMLDOCUMENT_FILEMODIFIEDDATE)] HRESULT fileModifiedDate([retval, out] BSTR * p); - [propget, id(DISPID_XMLDOCUMENT_FILEUPDATEDDATE)] HRESULT fileUpdatedDate([retval, out] BSTR * p); - [propget, id(DISPID_XMLDOCUMENT_URL)] HRESULT URL([retval, out] BSTR * p); - [propput, id(DISPID_XMLDOCUMENT_URL)] HRESULT URL([in] BSTR p); - [propget, id(DISPID_XMLDOCUMENT_MIMETYPE)] HRESULT mimeType([retval, out] BSTR * p); - [propget, id(DISPID_XMLDOCUMENT_READYSTATE)] HRESULT readyState([retval, out]long *pl); - [propget, id(DISPID_XMLDOCUMENT_CHARSET)] HRESULT charset([retval, out]BSTR *p); - [propput, id(DISPID_XMLDOCUMENT_CHARSET)] HRESULT charset([in]BSTR p); - [propget, id(DISPID_XMLDOCUMENT_VERSION)] HRESULT version([retval, out]BSTR *p); - [propget, id(DISPID_XMLDOCUMENT_DOCTYPE)] HRESULT doctype([retval, out]BSTR *p); - [propget, id(DISPID_XMLDOCUMENT_DTDURL)] HRESULT dtdURL([retval, out]BSTR *p); - [id(DISPID_XMLDOCUMENT_CREATEELEMENT)] HRESULT createElement([in] VARIANT vType, [optional, in] VARIANT var1, [retval, out] IXMLElement * * ppElem); - }; - - - [ - object, - local, - uuid(3F7F31AC-E15F-11d0-9C25-00C04FC99C8E) // IID_IXMLElement - ] - interface IXMLElement : IDispatch - { - [propget, id(DISPID_XMLELEMENT_TAGNAME)] HRESULT tagName([retval, out] BSTR * p); - [propput, id(DISPID_XMLELEMENT_TAGNAME)] HRESULT tagName([in] BSTR p); - [propget, id(DISPID_XMLELEMENT_PARENT)] HRESULT parent([retval, out]IXMLElement **ppParent); - [id(DISPID_XMLELEMENT_SETATTRIBUTE)] HRESULT setAttribute([in] BSTR strPropertyName,[in] VARIANT PropertyValue); - [id(DISPID_XMLELEMENT_GETATTRIBUTE)] HRESULT getAttribute([in] BSTR strPropertyName,[retval, out] VARIANT* PropertyValue); - [id(DISPID_XMLELEMENT_REMOVEATTRIBUTE)] HRESULT removeAttribute([in] BSTR strPropertyName); - [propget, id(DISPID_XMLELEMENT_CHILDREN)] HRESULT children([retval, out] IXMLElementCollection * * pp); - [propget, id(DISPID_XMLELEMENT_TYPE)] HRESULT type([retval, out] long *plType); - [propget, id(DISPID_XMLELEMENT_TEXT)] HRESULT text([retval, out] BSTR *p); - [propput, id(DISPID_XMLELEMENT_TEXT)] HRESULT text([in] BSTR p); - [id(DISPID_XMLELEMENT_ADDCHILD)] HRESULT addChild([in] IXMLElement *pChildElem, long lIndex, long lReserved); // lReserved must be -1 - [id(DISPID_XMLELEMENT_REMOVECHILD)] HRESULT removeChild([in]IXMLElement *pChildElem); - } - - typedef struct __xml_error { - unsigned _nLine; // line number - BSTR _pchBuf; // current input buffer - unsigned _cchBuf; // number of chars in buffer - unsigned _ich; // index of the char when error occurred - BSTR _pszFound; // token found - BSTR _pszExpected; // token expected - DWORD _reserved1; // reserved - DWORD _reserved2; // reserved - } XML_ERROR; - - [ - object, - local, - uuid(948C5AD3-C58D-11d0-9C0B-00C04FC99C8E) // IID_IXMLError - ] - - interface IXMLError : IUnknown - { - HRESULT GetErrorInfo(XML_ERROR *pErrorReturn); - } - - - - [ - uuid(45E5B41D-2805-11D3-9425-000000000000), - helpstring("MozXMLDocument Class") - ] - coclass MozXMLDocument - { - interface IDispatch; - [default] interface IXMLDocument; - }; - [ - uuid(45E5B420-2805-11D3-9425-000000000000), - helpstring("MozXMLElement Class") - ] - coclass MozXMLElement - { - interface IDispatch; - [default] interface IXMLElement; - }; - [ - uuid(45E5B422-2805-11D3-9425-000000000000), - helpstring("MozXMLElementCollection Class") - ] - coclass MozXMLElementCollection - { - interface IDispatch; - [default] interface IXMLElementCollection; - }; -}; diff --git a/embedding/browser/activex/src/xml/activexml.rc b/embedding/browser/activex/src/xml/activexml.rc deleted file mode 100644 index cb2dd1cf6dc..00000000000 --- a/embedding/browser/activex/src/xml/activexml.rc +++ /dev/null @@ -1,142 +0,0 @@ -//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 ""activexml.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 "Comments", "\0" - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Mozilla XML Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "activexml\0" - VALUE "LegalCopyright", "Copyright 1999\0" - VALUE "LegalTrademarks", "\0" - VALUE "OLESelfRegister", "\0" - VALUE "OriginalFilename", "activexml.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "activexml Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PROJNAME "activexml" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_XMLDOCUMENT REGISTRY DISCARDABLE "XMLDocument.rgs" -IDR_XMLELEMENT REGISTRY DISCARDABLE "XMLElement.rgs" -IDR_XMLELEMENTCOLLECTION REGISTRY DISCARDABLE "XMLElementCollection.rgs" -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -1 TYPELIB "activexml.tlb" - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/src/xml/activexmlps.def b/embedding/browser/activex/src/xml/activexmlps.def deleted file mode 100644 index dd90ac20c65..00000000000 --- a/embedding/browser/activex/src/xml/activexmlps.def +++ /dev/null @@ -1,11 +0,0 @@ - -LIBRARY "activexmlPS" - -DESCRIPTION 'Proxy/Stub DLL' - -EXPORTS - DllGetClassObject @1 PRIVATE - DllCanUnloadNow @2 PRIVATE - GetProxyDllInfo @3 PRIVATE - DllRegisterServer @4 PRIVATE - DllUnregisterServer @5 PRIVATE diff --git a/embedding/browser/activex/src/xml/resource.h b/embedding/browser/activex/src/xml/resource.h deleted file mode 100644 index 0a0d95a8af5..00000000000 --- a/embedding/browser/activex/src/xml/resource.h +++ /dev/null @@ -1,19 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by activexml.rc -// -#define IDS_PROJNAME 100 -#define IDR_XMLDOCUMENT 101 -#define IDR_XMLELEMENT 102 -#define IDR_XMLELEMENTCOLLECTION 103 - -// 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 104 -#endif -#endif diff --git a/embedding/browser/activex/tests/IEPatcher/DlgProxy.cpp b/embedding/browser/activex/tests/IEPatcher/DlgProxy.cpp deleted file mode 100644 index d53b68447aa..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/DlgProxy.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// DlgProxy.cpp : implementation file -// - -#include "stdafx.h" -#include "IEPatcher.h" -#include "DlgProxy.h" -#include "IEPatcherDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlgAutoProxy - -IMPLEMENT_DYNCREATE(CIEPatcherDlgAutoProxy, CCmdTarget) - -CIEPatcherDlgAutoProxy::CIEPatcherDlgAutoProxy() -{ - EnableAutomation(); - - // To keep the application running as long as an OLE automation - // object is active, the constructor calls AfxOleLockApp. - AfxOleLockApp(); - - // Get access to the dialog through the application's - // main window pointer. Set the proxy's internal pointer - // to point to the dialog, and set the dialog's back pointer to - // this proxy. - ASSERT (AfxGetApp()->m_pMainWnd != NULL); - ASSERT_VALID (AfxGetApp()->m_pMainWnd); - ASSERT_KINDOF(CIEPatcherDlg, AfxGetApp()->m_pMainWnd); - m_pDialog = (CIEPatcherDlg*) AfxGetApp()->m_pMainWnd; - m_pDialog->m_pAutoProxy = this; -} - -CIEPatcherDlgAutoProxy::~CIEPatcherDlgAutoProxy() -{ - // To terminate the application when all objects created with - // with OLE automation, the destructor calls AfxOleUnlockApp. - // Among other things, this will destroy the main dialog - AfxOleUnlockApp(); -} - -void CIEPatcherDlgAutoProxy::OnFinalRelease() -{ - // When the last reference for an automation object is released - // OnFinalRelease is called. The base class will automatically - // deletes the object. Add additional cleanup required for your - // object before calling the base class. - - CCmdTarget::OnFinalRelease(); -} - -BEGIN_MESSAGE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget) - //{{AFX_MSG_MAP(CIEPatcherDlgAutoProxy) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -BEGIN_DISPATCH_MAP(CIEPatcherDlgAutoProxy, CCmdTarget) - //{{AFX_DISPATCH_MAP(CIEPatcherDlgAutoProxy) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_DISPATCH_MAP -END_DISPATCH_MAP() - -// Note: we add support for IID_IIEPatcher to support typesafe binding -// from VBA. This IID must match the GUID that is attached to the -// dispinterface in the .ODL file. - -// {A6031677-3B36-11D2-B44D-00600819607E} -static const IID IID_IIEPatcher = -{ 0xa6031677, 0x3b36, 0x11d2, { 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e } }; - -BEGIN_INTERFACE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget) - INTERFACE_PART(CIEPatcherDlgAutoProxy, IID_IIEPatcher, Dispatch) -END_INTERFACE_MAP() - -// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project -// {A6031675-3B36-11D2-B44D-00600819607E} -IMPLEMENT_OLECREATE2(CIEPatcherDlgAutoProxy, "IEPatcher.Application", 0xa6031675, 0x3b36, 0x11d2, 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e) - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlgAutoProxy message handlers diff --git a/embedding/browser/activex/tests/IEPatcher/DlgProxy.h b/embedding/browser/activex/tests/IEPatcher/DlgProxy.h deleted file mode 100644 index f90ba1d322a..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/DlgProxy.h +++ /dev/null @@ -1,61 +0,0 @@ -// DlgProxy.h : header file -// - -#if !defined(AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_) -#define AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CIEPatcherDlg; - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlgAutoProxy command target - -class CIEPatcherDlgAutoProxy : public CCmdTarget -{ - DECLARE_DYNCREATE(CIEPatcherDlgAutoProxy) - - CIEPatcherDlgAutoProxy(); // protected constructor used by dynamic creation - -// Attributes -public: - CIEPatcherDlg* m_pDialog; - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CIEPatcherDlgAutoProxy) - public: - virtual void OnFinalRelease(); - //}}AFX_VIRTUAL - -// Implementation -protected: - virtual ~CIEPatcherDlgAutoProxy(); - - // Generated message map functions - //{{AFX_MSG(CIEPatcherDlgAutoProxy) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() - DECLARE_OLECREATE(CIEPatcherDlgAutoProxy) - - // Generated OLE dispatch map functions - //{{AFX_DISPATCH(CIEPatcherDlgAutoProxy) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_DISPATCH - DECLARE_DISPATCH_MAP() - DECLARE_INTERFACE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.cpp b/embedding/browser/activex/tests/IEPatcher/IEPatcher.cpp deleted file mode 100644 index 349dea4eca6..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// IEPatcher.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "IEPatcher.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherApp - -BEGIN_MESSAGE_MAP(CIEPatcherApp, CWinApp) - //{{AFX_MSG_MAP(CIEPatcherApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherApp construction - -CIEPatcherApp::CIEPatcherApp() -{ - m_pIEPatcherDlg = NULL; -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CIEPatcherApp object - -CIEPatcherApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherApp initialization - -BOOL CIEPatcherApp::InitInstance() -{ - // Initialize OLE libraries - if (!AfxOleInit()) - { - AfxMessageBox(IDP_OLE_INIT_FAILED); - return FALSE; - } - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - // Parse the command line to see if launched as OLE server - if (RunEmbedded() || RunAutomated()) - { - // Register all OLE server (factories) as running. This enables the - // OLE libraries to create objects from other applications. - COleTemplateServer::RegisterAll(); - } - else - { - // When a server application is launched stand-alone, it is a good idea - // to update the system registry in case it has been damaged. - COleObjectFactory::UpdateRegistryAll(); - } - - // Now the scanner window - m_pIEPatcherDlg = new CIEPatcherDlg; - m_pMainWnd = m_pIEPatcherDlg; - int nResponse = m_pIEPatcherDlg->DoModal(); - if (nResponse == IDOK) - { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } - else if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - delete m_pIEPatcherDlg; - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.dsp b/embedding/browser/activex/tests/IEPatcher/IEPatcher.dsp deleted file mode 100644 index 53b943b34f4..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.dsp +++ /dev/null @@ -1,203 +0,0 @@ -# Microsoft Developer Studio Project File - Name="IEPatcher" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=IEPatcher - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "IEPatcher.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "IEPatcher.mak" CFG="IEPatcher - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "IEPatcher - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "IEPatcher - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "IEPatcher - Win32 Release" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x1809 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x1809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "IEPatcher - Win32 Debug" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x1809 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x1809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "IEPatcher - Win32 Release" -# Name "IEPatcher - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\DlgProxy.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEPatcher.cpp -# End Source File -# Begin Source File - -SOURCE=.\IEPatcher.odl -# End Source File -# Begin Source File - -SOURCE=.\IEPatcher.rc -# End Source File -# Begin Source File - -SOURCE=.\IEPatcherDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScanForFilesDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScannerThread.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScannerWnd.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\DlgProxy.h -# End Source File -# Begin Source File - -SOURCE=.\IEPatcher.h -# End Source File -# Begin Source File - -SOURCE=.\IEPatcherDlg.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\ScanForFilesDlg.h -# End Source File -# Begin Source File - -SOURCE=.\ScannerThread.h -# End Source File -# Begin Source File - -SOURCE=.\ScannerWnd.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\res\containsie.ico -# End Source File -# Begin Source File - -SOURCE=.\res\containsmozilla.ico -# End Source File -# Begin Source File - -SOURCE=.\res\doesntcontainie.ico -# End Source File -# Begin Source File - -SOURCE=.\res\IEPatcher.ico -# End Source File -# Begin Source File - -SOURCE=.\res\IEPatcher.rc2 -# End Source File -# Begin Source File - -SOURCE=.\res\unknownstatus.ico -# End Source File -# End Group -# Begin Source File - -SOURCE=.\IEPatcher.reg -# End Source File -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.h b/embedding/browser/activex/tests/IEPatcher/IEPatcher.h deleted file mode 100644 index 802c4a30264..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.h +++ /dev/null @@ -1,53 +0,0 @@ -// IEPatcher.h : main header file for the IEPATCHER application -// - -#if !defined(AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_) -#define AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols - -#include "IEPatcherDlg.h" - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherApp: -// See IEPatcher.cpp for the implementation of this class -// - -class CIEPatcherApp : public CWinApp -{ -public: - CIEPatcherApp(); - - CIEPatcherDlg *m_pIEPatcherDlg; - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CIEPatcherApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CIEPatcherApp) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.odl b/embedding/browser/activex/tests/IEPatcher/IEPatcher.odl deleted file mode 100644 index f50dabc6e76..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.odl +++ /dev/null @@ -1,41 +0,0 @@ -// IEPatcher.odl : type library source for IEPatcher.exe - -// This file will be processed by the MIDL compiler to produce the -// type library (IEPatcher.tlb). - -[ uuid(A6031676-3B36-11D2-B44D-00600819607E), version(1.0) ] -library IEPatcher -{ - importlib("stdole32.tlb"); - - - // Primary dispatch interface for CIEPatcherDoc - - [ uuid(A6031677-3B36-11D2-B44D-00600819607E) ] - dispinterface IIEPatcher - { - properties: - // NOTE - ClassWizard will maintain property information here. - // Use extreme caution when editing this section. - //{{AFX_ODL_PROP(CIEPatcherDlgAutoProxy) - //}}AFX_ODL_PROP - - methods: - // NOTE - ClassWizard will maintain method information here. - // Use extreme caution when editing this section. - //{{AFX_ODL_METHOD(CIEPatcherDlgAutoProxy) - //}}AFX_ODL_METHOD - - }; - - // Class information for CIEPatcherDoc - - [ uuid(A6031675-3B36-11D2-B44D-00600819607E) ] - coclass IEPatcher - { - [default] dispinterface IIEPatcher; - }; - - //{{AFX_APPEND_ODL}} - //}}AFX_APPEND_ODL}} -}; diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.rc b/embedding/browser/activex/tests/IEPatcher/IEPatcher.rc deleted file mode 100644 index 8c793670a7e..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.rc +++ /dev/null @@ -1,236 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.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 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_IEPATCHER_DIALOG DIALOGEX 0, 0, 323, 202 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "IE to Mozilla Patcher" -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "&Scan...",IDC_SCAN,266,6,50,14 - CONTROL "List1",IDC_FILELIST,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | - WS_TABSTOP,7,59,309,136 - PUSHBUTTON "&Patch",IDC_PATCH,266,26,50,14 - LTEXT "Add files to the source list by selecting ""Scan"". Files containing references to Internet Explorer or Mozilla will be highlighted.", - IDC_STATIC,7,6,257,18 - LTEXT "Choose ""Patch"" to apply the Mozilla patch to any selected files. The patching process does not overwrite the original file but creates a new file prepended with ""moz_"" which you may test at your leisure.", - IDC_STATIC,7,30,257,26 -END - -IDD_SCANFORFILES DIALOG DISCARDABLE 0, 0, 227, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Scan for files" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Type a filename or wildcard pattern or use ""Pick File..."" or ""Pick Folder...""", - IDC_STATIC,7,7,155,18 - EDITTEXT IDC_FILEPATTERN,5,25,158,13,ES_AUTOHSCROLL - PUSHBUTTON "Pick File...",IDC_SELECTFILE,29,43,55,13 - DEFPUSHBUTTON "OK",IDOK,170,5,50,14 - PUSHBUTTON "Cancel",IDCANCEL,170,25,50,14 - PUSHBUTTON "Pick Folder...",IDC_SELECTFOLDER,89,43,55,13 -END - - -#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 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "IEPatcher MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "IEPatcher\0" - VALUE "LegalCopyright", "Copyright (C) 1998\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "IEPatcher.EXE\0" - VALUE "ProductName", "IEPatcher Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_IEPATCHER_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 316 - TOPMARGIN, 6 - BOTTOMMARGIN, 195 - END - - IDD_SCANFORFILES, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 220 - TOPMARGIN, 7 - BOTTOMMARGIN, 56 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_CONTAINSIE ICON DISCARDABLE "res\\containsie.ico" -IDI_DOESNTCONTAINIE ICON DISCARDABLE "res\\doesntcontainie.ico" -IDI_CONTAINSMOZILLA ICON DISCARDABLE "res\\containsmozilla.ico" -IDI_UNKNOWNSTATUS ICON DISCARDABLE "res\\unknownstatus.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDP_OLE_INIT_FAILED "OLE initialization failed. Make sure that the OLE libraries are the correct version." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (Ireland) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENI) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_EIRE -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""res\\IEPatcher.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\IEPatcher.ico" -#endif // English (Ireland) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "res\IEPatcher.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcher.reg b/embedding/browser/activex/tests/IEPatcher/IEPatcher.reg deleted file mode 100644 index 026ae7bef0b..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcher.reg +++ /dev/null @@ -1,13 +0,0 @@ -REGEDIT -; This .REG file may be used by your SETUP program. -; If a SETUP program is not available, the entries below will be -; registered in your InitInstance automatically with a call to -; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll. - - -HKEY_CLASSES_ROOT\IEPatcher.Application = IEPatcher Application -HKEY_CLASSES_ROOT\IEPatcher.Application\CLSID = {A6031675-3B36-11D2-B44D-00600819607E} - -HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E} = IEPatcher Application -HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E}\ProgId = IEPatcher.Application -HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E}\LocalServer32 = IEPATCHER.EXE diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.cpp b/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.cpp deleted file mode 100644 index b4cece53424..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.cpp +++ /dev/null @@ -1,622 +0,0 @@ -// IEPatcherDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "IEPatcher.h" -#include "IEPatcherDlg.h" -#include "ScanForFilesDlg.h" -#include "ScannerThread.h" -#include "DlgProxy.h" - -#include -#include - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -const CLSID CLSID_WebBrowser_V1 = { 0xEAB22AC3, 0x30C1, 0x11CF, { 0xA7, 0xEB, 0x00, 0x00, 0xC0, 0x5B, 0xAE, 0x0B } }; -const CLSID CLSID_WebBrowser = { 0x8856F961, 0x340A, 0x11D0, { 0xA9, 0x6B, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2 } }; -const CLSID CLSID_InternetExplorer = { 0x0002DF01, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; -const CLSID CLSID_MozillaBrowser = {0x1339B54C,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 IID_IWebBrowser2 = { 0xD30C1661, 0xCDAF, 0x11d0, { 0x8A, 0x3E, 0x00, 0xC0, 0x4F, 0xC9, 0xE2, 0x6E } }; -const IID IID_IWebBrowserApp = { 0x0002DF05, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; - - -#define ITEM_PATCHSTATUS 1 - -#define IMG_DOESNTCONTAINIE 0 -#define IMG_CONTAINSIE 1 -#define IMG_CONTAINSMOZILLA 2 -#define IMG_UNKNOWNSTATUS 3 - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlg dialog - -IMPLEMENT_DYNAMIC(CIEPatcherDlg, CDialog); - -CIEPatcherDlg::CIEPatcherDlg(CWnd* pParent /*=NULL*/) - : CDialog(CIEPatcherDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CIEPatcherDlg) - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_pAutoProxy = NULL; -} - - -CIEPatcherDlg::~CIEPatcherDlg() -{ - // If there is an automation proxy for this dialog, set - // its back pointer to this dialog to NULL, so it knows - // the dialog has been deleted. - if (m_pAutoProxy != NULL) - m_pAutoProxy->m_pDialog = NULL; -} - - -void CIEPatcherDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CIEPatcherDlg) - DDX_Control(pDX, IDC_PATCH, m_btnPatch); - DDX_Control(pDX, IDC_FILELIST, m_cFileList); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CIEPatcherDlg, CDialog) - //{{AFX_MSG_MAP(CIEPatcherDlg) - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_WM_CLOSE() - ON_BN_CLICKED(IDC_SCAN, OnScan) - ON_NOTIFY(NM_CLICK, IDC_FILELIST, OnClickFilelist) - ON_BN_CLICKED(IDC_PATCH, OnPatch) - //}}AFX_MSG_MAP - ON_MESSAGE(WM_UPDATEFILESTATUS, OnUpdateFileStatus) -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlg message handlers - -BOOL CIEPatcherDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Start the scanner thread - AfxBeginThread(RUNTIME_CLASS(CScannerThread), 0); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // Add icons to image list - m_cImageList.Create(16, 16, ILC_MASK, 0, 5); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_DOESNTCONTAINIE)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSIE)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSMOZILLA)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_UNKNOWNSTATUS)); - - // Associate image list with file list - m_cFileList.SetImageList(&m_cImageList, LVSIL_SMALL); - - struct ColumnData - { - TCHAR *sColumnTitle; - int nPercentageWidth; - int nFormat; - }; - - ColumnData aColData[] = - { - { _T("File"), 70, LVCFMT_LEFT }, - { _T("Patch Status"), 30, LVCFMT_LEFT } - }; - - // Get the size of the file list control and neatly - // divide it into columns - - CRect rcFileList; - m_cFileList.GetClientRect(&rcFileList); - - int nColTotal = sizeof(aColData) / sizeof(aColData[0]); - int nWidthRemaining = rcFileList.Width(); - - for (int nCol = 0; nCol < nColTotal; nCol++) - { - ColumnData *pData = &aColData[nCol]; - - int nColWidth = (rcFileList.Width() * pData->nPercentageWidth) / 100; - if (nCol == nColTotal - 1) - { - nColWidth = nWidthRemaining; - } - else if (nColWidth > nWidthRemaining) - { - nColWidth = nWidthRemaining; - } - - m_cFileList.InsertColumn(nCol, pData->sColumnTitle, pData->nFormat, nColWidth); - - nWidthRemaining -= nColWidth; - if (nColWidth <= 0) - { - break; - } - } - - return TRUE; // return TRUE unless you set the focus to a control -} - - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CIEPatcherDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CDialog::OnPaint(); - } -} - - -// The system calls this to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CIEPatcherDlg::OnQueryDragIcon() -{ - return (HCURSOR) m_hIcon; -} - - -// Automation servers should not exit when a user closes the UI -// if a controller still holds on to one of its objects. These -// message handlers make sure that if the proxy is still in use, -// then the UI is hidden but the dialog remains around if it -// is dismissed. - -void CIEPatcherDlg::OnClose() -{ - if (CanExit()) - CDialog::OnClose(); -} - - -LONG CIEPatcherDlg::OnUpdateFileStatus(WPARAM wParam, LPARAM lParam) -{ - PatchStatus ps = (PatchStatus) wParam; - TCHAR *pszFile = (TCHAR *) lParam; - UpdateFileStatus(pszFile, ps); - return 0; -} - - -void CIEPatcherDlg::OnScan() -{ - CScanForFilesDlg dlg; - - if (dlg.DoModal() == IDOK) - { - CWaitCursor wc; - - CFileFind op; - if (op.FindFile(dlg.m_sFilePattern)) - { - op.FindNextFile(); - do { - if (!op.IsDirectory()) - { - AddFileToList(op.GetFilePath()); - } - } while (op.FindNextFile()); - op.Close(); - } - } -} - - -void CIEPatcherDlg::OnPatch() -{ - int nItem = -1; - do { - nItem = m_cFileList.GetNextItem(nItem, LVNI_ALL | LVNI_SELECTED); - if (nItem != -1) - { - m_cQueuedFileDataList[nItem]->ps = psPatchPending; - UpdateFileStatus(nItem, m_cQueuedFileDataList[nItem]->sFileName, m_cQueuedFileDataList[nItem]->ps); - } - } while (nItem != -1); -} - - -void CIEPatcherDlg::OnClickFilelist(NMHDR* pNMHDR, LRESULT* pResult) -{ - // Check if files are selected - - *pResult = 0; -} - - -/////////////////////////////////////////////////////////////////////////////// - - -BOOL CIEPatcherDlg::CanExit() -{ - // If the proxy object is still around, then the automation - // controller is still holding on to this application. Leave - // the dialog around, but hide its UI. - if (m_pAutoProxy != NULL) - { - ShowWindow(SW_HIDE); - return FALSE; - } - - return TRUE; -} - - -PatchStatus CIEPatcherDlg::ScanFile(const CString &sFileName) -{ - char *pszBuffer = NULL; - long nBufferSize = 0; - if (!ReadFileToBuffer(sFileName, &pszBuffer, &nBufferSize)) - { - return psFileError; - } - - PatchStatus ps = ScanBuffer(pszBuffer, nBufferSize, FALSE); - delete []pszBuffer; - return ps; -} - - -BOOL CIEPatcherDlg::WriteBufferToFile(const CString &sFileName, char *pszBuffer, long nBufferSize) -{ - CString sMessage; - sMessage.Format("Saving patched file \"%s\"", sFileName); - TraceProgress(sMessage); - - FILE *fDest = fopen(sFileName, "wb"); - if (fDest == NULL) - { - TraceProgress("Error: Could not open destination file"); - return FALSE; - } - - fwrite(pszBuffer, 1, nBufferSize, fDest); - fclose(fDest); - TraceProgress("File saved"); - - return TRUE; -} - - -BOOL CIEPatcherDlg::ReadFileToBuffer(const CString &sFileName, char **ppszBuffer, long *pnBufferSize) -{ - CString sProcessing; - sProcessing.Format("Processing file \"%s\"", sFileName); - TraceProgress(sProcessing); - - // Allocate a memory buffer to slurp up the whole file - struct _stat srcStat; - _stat(sFileName, &srcStat); - - char *pszBuffer = new char[srcStat.st_size / sizeof(char)]; - if (pszBuffer == NULL) - { - TraceProgress("Error: Could not allocate buffer for file"); - return FALSE; - } - FILE *fSrc = fopen(sFileName, "rb"); - if (fSrc == NULL) - { - TraceProgress("Error: Could not open file"); - delete []pszBuffer; - return FALSE; - } - size_t sizeSrc = srcStat.st_size; - size_t sizeRead = 0; - - // Dumb but effective - sizeRead = fread(pszBuffer, 1, sizeSrc, fSrc); - fclose(fSrc); - - if (sizeRead != sizeSrc) - { - TraceProgress("Error: Could not read all of file"); - delete []pszBuffer; - return FALSE; - } - - *ppszBuffer = pszBuffer; - *pnBufferSize = sizeRead; - - return TRUE; -} - - -PatchStatus CIEPatcherDlg::ScanBuffer(char *pszBuffer, long nBufferSize, BOOL bApplyPatch) -{ - if (nBufferSize < sizeof(CLSID)) - { - return psNotPatchable; - } - - TraceProgress("Scanning for IE..."); - - BOOL bPatchApplied = FALSE; - PatchStatus ps = psUnknownStatus; - - // Scan through buffer, one byte at a time doing a memcmp - for (size_t i = 0; i < nBufferSize - sizeof(CLSID); i++) - { - if (memcmp(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID)) == 0) - { - TraceProgress("Found CLSID_MozillaBrowser"); - if (ps == psUnknownStatus) - { - ps = psAlreadyPatched; - } - } - else if (memcmp(&pszBuffer[i], &CLSID_WebBrowser_V1, sizeof(CLSID)) == 0) - { - TraceProgress("Found CLSID_WebBrowser_V1"); - if (ps == psUnknownStatus) - { - ps = psPatchable; - } - if (bApplyPatch) - { - TraceProgress("Patching with CLSID_MozillaBrowser"); - memcpy(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID)); - bPatchApplied = TRUE; - } - } - else if (memcmp(&pszBuffer[i], &CLSID_WebBrowser, sizeof(CLSID)) == 0) - { - TraceProgress("Found CLSID_WebBrowser"); - if (ps == psUnknownStatus) - { - ps = psPatchable; - } - if (bApplyPatch) - { - TraceProgress("Patching with CLSID_MozillaBrowser"); - memcpy(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID)); - TraceProgress("Patching with CLSID_MozillaBrowser"); - bPatchApplied = TRUE; - } - } - else if (memcmp(&pszBuffer[i], &IID_IWebBrowser, sizeof(CLSID)) == 0) - { - TraceProgress("Found IID_IWebBrowser"); - if (ps == psUnknownStatus) - { - ps = psPatchable; - } - } - else if (memcmp(&pszBuffer[i], &CLSID_InternetExplorer, sizeof(CLSID)) == 0) - { - TraceProgress("Warning: Found CLSID_InternetExplorer, patching might not work"); - if (ps == psUnknownStatus) - { - ps = psMayBePatchable; - } - } - else if (memcmp(&pszBuffer[i], &IID_IWebBrowser2, sizeof(CLSID)) == 0) - { - TraceProgress("Found IID_IWebBrowser2"); - if (ps == psUnknownStatus) - { - ps = psPatchable; - } - } - else if (memcmp(&pszBuffer[i], &IID_IWebBrowserApp, sizeof(CLSID)) == 0) - { - TraceProgress("Found IID_IWebBrowserApp"); - if (ps == psUnknownStatus) - { - ps = psPatchable; - } - } - } - - if (ps == psUnknownStatus) - { - ps = psNotPatchable; - } - if (bApplyPatch) - { - ps = (bPatchApplied) ? psAlreadyPatched : psNotPatchable; - } - - TraceProgress("Scan completed"); - - return ps; -} - - -BOOL CIEPatcherDlg::PatchFile(const CString & sFileFrom, const CString & sFileTo, PatchStatus *pPatchStatus) -{ - if (sFileTo.IsEmpty()) - { - return FALSE; - } - if (sFileTo == sFileFrom) - { - TraceProgress("Warning: Patching disabled for safety reasons, source and destination names must differ"); - return FALSE; - } - - char *pszBuffer = NULL; - long nBufferSize = 0; - - if (!ReadFileToBuffer(sFileFrom, &pszBuffer, &nBufferSize)) - { - return FALSE; - } - - // Scan and patch the buffer - *pPatchStatus = ScanBuffer(pszBuffer, nBufferSize, TRUE); - if (*pPatchStatus == psNotPatchable) - { - TraceProgress("Error: Nothing was found to patch"); - } - else - { - // Write out the patch file - WriteBufferToFile(sFileTo, pszBuffer, nBufferSize); - } - - delete []pszBuffer; - return FALSE; -} - - -void CIEPatcherDlg::TraceProgress(const CString &sProgress) -{ - // TODO -} - - -void CIEPatcherDlg::AddFileToList(const CString & sFile) -{ - CSingleLock sl(&m_csQueuedFileDataList, TRUE); - - int nIndex = m_cFileList.GetItemCount(); - m_cFileList.InsertItem(nIndex, sFile, IMG_UNKNOWNSTATUS); - - QueuedFileData *pData = new QueuedFileData; - pData->ps = psUnknownStatus; - pData->sFileName = sFile; - pData->sPatchedFileName = sFile; - m_cQueuedFileDataList.Add(pData); - - UpdateFileStatus(nIndex, pData->ps); -} - - -void CIEPatcherDlg::UpdateFileStatus(int nFileIndex, const CString &sFile, PatchStatus ps) -{ - CString sStatus; - int nIconStatus = -1; - - switch (ps) - { - case psFileError: - sStatus = _T("File error"); - break; - - case psNotPatchable: - sStatus = _T("Nothing to patch"); - nIconStatus = IMG_DOESNTCONTAINIE; - break; - - case psPatchable: - sStatus = _T("Patchable"); - nIconStatus = IMG_CONTAINSIE; - break; - - case psMayBePatchable: - sStatus = _T("Maybe patchable"); - nIconStatus = IMG_CONTAINSIE; - break; - - case psAlreadyPatched: - sStatus = _T("Already patched"); - nIconStatus = IMG_CONTAINSMOZILLA; - break; - - case psUnknownStatus: - sStatus = _T("Status pending"); - nIconStatus = IMG_UNKNOWNSTATUS; - break; - - case psPatchPending: - sStatus = _T("Patch pending"); - break; - - default: - sStatus = _T("*** ERROR ***"); - break; - } - - if (nIconStatus != -1) - { - m_cFileList.SetItem(nFileIndex, -1, LVIF_IMAGE, NULL, nIconStatus, 0, 0, 0); - } - m_cFileList.SetItemText(nFileIndex, ITEM_PATCHSTATUS, sStatus); -} - - -void CIEPatcherDlg::UpdateFileStatus(const CString &sFile, PatchStatus ps) -{ - CSingleLock sl(&m_csQueuedFileDataList, TRUE); - - for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++) - { - if (m_cQueuedFileDataList[n]->sFileName == sFile) - { - UpdateFileStatus(n, sFile, ps); - m_cQueuedFileDataList[n]->ps = ps; - return; - } - } -} - - -BOOL CIEPatcherDlg::GetPendingFileToScan(CString & sFileToScan) -{ - CSingleLock sl(&m_csQueuedFileDataList, TRUE); - - for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++) - { - if (m_cQueuedFileDataList[n]->ps == psUnknownStatus) - { - sFileToScan = m_cQueuedFileDataList[n]->sFileName; - return TRUE; - } - } - return FALSE; -} - - -BOOL CIEPatcherDlg::GetPendingFileToPatch(CString & sFileToPatch) -{ - CSingleLock sl(&m_csQueuedFileDataList, TRUE); - - for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++) - { - if (m_cQueuedFileDataList[n]->ps == psPatchPending) - { - sFileToPatch = m_cQueuedFileDataList[n]->sFileName; - return TRUE; - } - } - return FALSE; -} diff --git a/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.h b/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.h deleted file mode 100644 index 56bcd63b181..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.h +++ /dev/null @@ -1,105 +0,0 @@ -// IEPatcherDlg.h : header file -// - -#if !defined(AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_) -#define AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CIEPatcherDlgAutoProxy; - -enum PatchStatus -{ - psFileError, - psUnknownStatus, - psPatchPending, - psNotPatchable, - psPatchable, - psMayBePatchable, - psAlreadyPatched -}; - -struct QueuedFileData -{ - CString sFileName; - CString sPatchedFileName; - PatchStatus ps; -}; - -#define WM_UPDATEFILESTATUS WM_USER+1 - -///////////////////////////////////////////////////////////////////////////// -// CIEPatcherDlg dialog - -class CIEPatcherDlg : public CDialog -{ - DECLARE_DYNAMIC(CIEPatcherDlg); - friend class CIEPatcherDlgAutoProxy; - -// Construction -public: - void AddFileToList(const CString &sFile); - BOOL GetPendingFileToScan(CString &sFileToScan); - BOOL GetPendingFileToPatch(CString &sFileToPatch); - - static PatchStatus ScanFile(const CString &sFileName); - static PatchStatus ScanBuffer(char *pszBuffer, long nBufferSize, BOOL bApplyPatches); - static BOOL PatchFile(const CString & sFileFrom, const CString & sFileTo, PatchStatus *pPatchStatus); - - static BOOL WriteBufferToFile(const CString &sFileName, char *pszBuffer, long nBufferSize); - static BOOL ReadFileToBuffer(const CString &sFileName, char **ppszBuffer, long *pnBufferSize); - static void TraceProgress(const CString &sProgress); - - void UpdateFileStatus(const CString &sFile, PatchStatus ps); - void UpdateFileStatus(int nFileIndex, const CString &sFile, PatchStatus ps); - - - CIEPatcherDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CIEPatcherDlg(); - - CImageList m_cImageList; - - CArray m_cQueuedFileDataList; - CCriticalSection m_csQueuedFileDataList; - -// Dialog Data - //{{AFX_DATA(CIEPatcherDlg) - enum { IDD = IDD_IEPATCHER_DIALOG }; - CButton m_btnPatch; - CListCtrl m_cFileList; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CIEPatcherDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - CIEPatcherDlgAutoProxy* m_pAutoProxy; - HICON m_hIcon; - - BOOL CanExit(); - - // Generated message map functions - //{{AFX_MSG(CIEPatcherDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnClose(); - afx_msg void OnScan(); - afx_msg void OnClickFilelist(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnPatch(); - //}}AFX_MSG - afx_msg LONG OnUpdateFileStatus(WPARAM, LPARAM); - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_) - diff --git a/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.cpp b/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.cpp deleted file mode 100644 index 87cde37c11e..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// ScanForFilesDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "IEPatcher.h" -#include "ScanForFilesDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CScanForFilesDlg dialog - - -CScanForFilesDlg::CScanForFilesDlg(CWnd* pParent /*=NULL*/) - : CDialog(CScanForFilesDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CScanForFilesDlg) - m_sFilePattern = _T(""); - //}}AFX_DATA_INIT -} - - -void CScanForFilesDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CScanForFilesDlg) - DDX_Text(pDX, IDC_FILEPATTERN, m_sFilePattern); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CScanForFilesDlg, CDialog) - //{{AFX_MSG_MAP(CScanForFilesDlg) - ON_BN_CLICKED(IDC_SELECTFILE, OnSelectFile) - ON_BN_CLICKED(IDC_SELECTFOLDER, OnSelectFolder) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CScanForFilesDlg message handlers - -void CScanForFilesDlg::OnOK() -{ - UpdateData(); - CDialog::OnOK(); -} - -void CScanForFilesDlg::OnSelectFile() -{ - CFileDialog dlg(TRUE, NULL, _T("*.*")); - - if (dlg.DoModal() == IDOK) - { - m_sFilePattern = dlg.GetPathName(); - UpdateData(FALSE); - } -} - -void CScanForFilesDlg::OnSelectFolder() -{ - BROWSEINFO bi; - TCHAR szFolder[MAX_PATH + 1]; - - memset(szFolder, 0, sizeof(szFolder)); - - memset(&bi, 0, sizeof(bi)); - bi.hwndOwner = GetSafeHwnd(); - bi.pidlRoot = NULL; - bi.pszDisplayName = szFolder; - bi.lpszTitle = _T("Pick a folder to scan"); - - // Open the folder browser dialog - LPITEMIDLIST pItemList = SHBrowseForFolder(&bi); - if (pItemList) - { - IMalloc *pShellAllocator = NULL; - - SHGetMalloc(&pShellAllocator); - if (pShellAllocator) - { - char szPath[MAX_PATH + 1]; - - if (SHGetPathFromIDList(pItemList, szPath)) - { - // Chop off the end path separator - int nPathSize = strlen(szPath); - if (nPathSize > 0) - { - if (szPath[nPathSize - 1] == '\\') - { - szPath[nPathSize - 1] = '\0'; - } - } - - // Form the file pattern - USES_CONVERSION; - m_sFilePattern.Format(_T("%s\\*.*"), A2T(szPath)); - UpdateData(FALSE); - } - - pShellAllocator->Free(pItemList); - pShellAllocator->Release(); - } - - } -} diff --git a/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.h b/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.h deleted file mode 100644 index eefcf3384f3..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.h +++ /dev/null @@ -1,48 +0,0 @@ -#if !defined(AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_) -#define AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ScanForFilesDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CScanForFilesDlg dialog - -class CScanForFilesDlg : public CDialog -{ -// Construction -public: - CScanForFilesDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CScanForFilesDlg) - enum { IDD = IDD_SCANFORFILES }; - CString m_sFilePattern; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CScanForFilesDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CScanForFilesDlg) - virtual void OnOK(); - afx_msg void OnSelectFile(); - afx_msg void OnSelectFolder(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/ScannerThread.cpp b/embedding/browser/activex/tests/IEPatcher/ScannerThread.cpp deleted file mode 100644 index b837d908b87..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScannerThread.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// ScannerThread.cpp : implementation file -// - -#include "stdafx.h" -#include "iepatcher.h" -#include "ScannerThread.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CScannerThread - -IMPLEMENT_DYNCREATE(CScannerThread, CWinThread) - -CScannerThread::CScannerThread() -{ -} - -CScannerThread::~CScannerThread() -{ -} - -BOOL CScannerThread::InitInstance() -{ - m_cScannerWnd.Create(AfxRegisterWndClass(0), _T("Scanner"), 0L, CRect(0, 0, 0, 0), AfxGetMainWnd(), 1); - return TRUE; -} - -int CScannerThread::ExitInstance() -{ - // TODO: perform any per-thread cleanup here - return CWinThread::ExitInstance(); -} - -BEGIN_MESSAGE_MAP(CScannerThread, CWinThread) - //{{AFX_MSG_MAP(CScannerThread) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CScannerThread message handlers diff --git a/embedding/browser/activex/tests/IEPatcher/ScannerThread.h b/embedding/browser/activex/tests/IEPatcher/ScannerThread.h deleted file mode 100644 index 430240664f3..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScannerThread.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_) -#define AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ScannerThread.h : header file -// - -#include "ScannerWnd.h" - - -///////////////////////////////////////////////////////////////////////////// -// CScannerThread thread - -class CScannerThread : public CWinThread -{ - DECLARE_DYNCREATE(CScannerThread) -protected: - CScannerThread(); // protected constructor used by dynamic creation - -// Attributes -public: - CScannerWnd m_cScannerWnd; - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CScannerThread) - public: - virtual BOOL InitInstance(); - virtual int ExitInstance(); - //}}AFX_VIRTUAL - -// Implementation -protected: - virtual ~CScannerThread(); - - // Generated message map functions - //{{AFX_MSG(CScannerThread) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/ScannerWnd.cpp b/embedding/browser/activex/tests/IEPatcher/ScannerWnd.cpp deleted file mode 100644 index db95aa64a05..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScannerWnd.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// ScannerWnd.cpp : implementation file -// - -#include "stdafx.h" -#include "iepatcher.h" -#include "ScannerWnd.h" -#include "IEPatcherDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CScannerWnd - -CScannerWnd::CScannerWnd() -{ -} - -CScannerWnd::~CScannerWnd() -{ -} - - -BEGIN_MESSAGE_MAP(CScannerWnd, CWnd) - //{{AFX_MSG_MAP(CScannerWnd) - ON_WM_TIMER() - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CScannerWnd message handlers - - -int CScannerWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - SetTimer(1, 500, NULL); - - return 0; -} - - -void CScannerWnd::OnTimer(UINT nIDEvent) -{ - CIEPatcherDlg * pDlg = ((CIEPatcherApp *) AfxGetApp())->m_pIEPatcherDlg; - if (pDlg) - { - CString sFileToProcess; - if (pDlg->GetPendingFileToScan(sFileToProcess)) - { - PatchStatus ps = CIEPatcherDlg::ScanFile(sFileToProcess); - AfxGetMainWnd()->SendMessage(WM_UPDATEFILESTATUS, (WPARAM) ps, (LPARAM) (const TCHAR *) sFileToProcess); - } - else if (pDlg->GetPendingFileToPatch(sFileToProcess)) - { - TCHAR szDrive[_MAX_DRIVE]; - TCHAR szDir[_MAX_DIR]; - TCHAR szFile[_MAX_FNAME]; - TCHAR szExt[_MAX_EXT]; - - _tsplitpath(sFileToProcess, szDrive, szDir, szFile, szExt); - - CString sFileOut; - TCHAR szPath[_MAX_PATH]; - sFileOut.Format(_T("moz_%s"), szFile); - _tmakepath(szPath, szDrive, szDir, sFileOut, szExt); - - PatchStatus ps; - CIEPatcherDlg::PatchFile(sFileToProcess, szPath, &ps); - AfxGetMainWnd()->SendMessage(WM_UPDATEFILESTATUS, (WPARAM) ps, (LPARAM) (const TCHAR *) sFileToProcess); - } - } - - CWnd::OnTimer(nIDEvent); -} diff --git a/embedding/browser/activex/tests/IEPatcher/ScannerWnd.h b/embedding/browser/activex/tests/IEPatcher/ScannerWnd.h deleted file mode 100644 index 7c4c02d63ef..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/ScannerWnd.h +++ /dev/null @@ -1,48 +0,0 @@ -#if !defined(AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_) -#define AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ScannerWnd.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CScannerWnd window - -class CScannerWnd : public CWnd -{ -// Construction -public: - CScannerWnd(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CScannerWnd) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CScannerWnd(); - - // Generated message map functions -protected: - //{{AFX_MSG(CScannerWnd) - afx_msg void OnTimer(UINT nIDEvent); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/StdAfx.cpp b/embedding/browser/activex/tests/IEPatcher/StdAfx.cpp deleted file mode 100644 index ee987d4d8c7..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/StdAfx.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// IEPatcher.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - diff --git a/embedding/browser/activex/tests/IEPatcher/StdAfx.h b/embedding/browser/activex/tests/IEPatcher/StdAfx.h deleted file mode 100644 index 59b4a1767e6..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/StdAfx.h +++ /dev/null @@ -1,42 +0,0 @@ -// 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__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_) -#define AFX_STDAFX_H__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT -#include -#include -#include - -#include - -// This macro is the same as IMPLEMENT_OLECREATE, except it passes TRUE -// for the bMultiInstance parameter to the COleObjectFactory constructor. -// We want a separate instance of this application to be launched for -// each OLE automation proxy object requested by automation controllers. -#ifndef IMPLEMENT_OLECREATE2 -#define IMPLEMENT_OLECREATE2(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - AFX_DATADEF COleObjectFactory class_name::factory(class_name::guid, \ - RUNTIME_CLASS(class_name), TRUE, _T(external_name)); \ - const AFX_DATADEF GUID class_name::guid = \ - { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; -#endif // IMPLEMENT_OLECREATE2 - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_) diff --git a/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.ico b/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.ico deleted file mode 100644 index 7eef0bcbe65..00000000000 Binary files a/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.rc2 b/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.rc2 deleted file mode 100644 index 227cb5a3f68..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/res/IEPatcher.rc2 +++ /dev/null @@ -1,13 +0,0 @@ -// -// IEPATCHER.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/embedding/browser/activex/tests/IEPatcher/res/containsie.ico b/embedding/browser/activex/tests/IEPatcher/res/containsie.ico deleted file mode 100644 index 68cdc082517..00000000000 Binary files a/embedding/browser/activex/tests/IEPatcher/res/containsie.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/IEPatcher/res/containsmozilla.ico b/embedding/browser/activex/tests/IEPatcher/res/containsmozilla.ico deleted file mode 100644 index 34e29d003f9..00000000000 Binary files a/embedding/browser/activex/tests/IEPatcher/res/containsmozilla.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/IEPatcher/res/doesntcontainie.ico b/embedding/browser/activex/tests/IEPatcher/res/doesntcontainie.ico deleted file mode 100644 index 811358fb803..00000000000 Binary files a/embedding/browser/activex/tests/IEPatcher/res/doesntcontainie.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/IEPatcher/res/unknownstatus.ico b/embedding/browser/activex/tests/IEPatcher/res/unknownstatus.ico deleted file mode 100644 index 893350f1028..00000000000 Binary files a/embedding/browser/activex/tests/IEPatcher/res/unknownstatus.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/IEPatcher/resource.h b/embedding/browser/activex/tests/IEPatcher/resource.h deleted file mode 100644 index 3c1baaaa51e..00000000000 --- a/embedding/browser/activex/tests/IEPatcher/resource.h +++ /dev/null @@ -1,35 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by IEPatcher.rc -// -#define IDP_OLE_INIT_FAILED 100 -#define IDD_IEPATCHER_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDI_CONTAINSIE 129 -#define IDI_DOESNTCONTAINIE 130 -#define IDI_CONTAINSMOZILLA 131 -#define IDD_SCANFORFILES 132 -#define IDI_UNKNOWNSTATUS 133 -#define IDC_FILENAME 1000 -#define IDC_SCAN 1001 -#define IDC_PROGRESS 1002 -#define IDC_PATCHFILE 1003 -#define IDC_DESTINATION_FILENAME 1004 -#define IDC_PICKSOURCE 1005 -#define IDC_PICKDESTINATION 1006 -#define IDC_FILELIST 1007 -#define IDC_PATCH 1008 -#define IDC_FILEPATTERN 1009 -#define IDC_SELECTFILE 1011 -#define IDC_SELECTFOLDER 1012 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 134 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1012 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/embedding/browser/activex/tests/RegMozCtl/MozillaBrowser.ico b/embedding/browser/activex/tests/RegMozCtl/MozillaBrowser.ico deleted file mode 100644 index 01c6f785d3e..00000000000 Binary files a/embedding/browser/activex/tests/RegMozCtl/MozillaBrowser.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/RegMozCtl/ReadMe.txt b/embedding/browser/activex/tests/RegMozCtl/ReadMe.txt deleted file mode 100644 index 76a553ecfc2..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/ReadMe.txt +++ /dev/null @@ -1,88 +0,0 @@ -======================================================================== - MICROSOFT FOUNDATION CLASS LIBRARY : RegMozCtl -======================================================================== - - -AppWizard has created this RegMozCtl application for you. This application -not only demonstrates the basics of using the Microsoft Foundation classes -but is also a starting point for writing your application. - -This file contains a summary of what you will find in each of the files that -make up your RegMozCtl application. - -RegMozCtl.dsp - This file (the project file) contains information at the project level and - is used to build a single project or subproject. Other users can share the - project (.dsp) file, but they should export the makefiles locally. - -RegMozCtl.h - This is the main header file for the application. It includes other - project specific headers (including Resource.h) and declares the - CRegMozCtlApp application class. - -RegMozCtl.cpp - This is the main application source file that contains the application - class CRegMozCtlApp. - -RegMozCtl.rc - This is a listing of all of the Microsoft Windows resources that the - program uses. It includes the icons, bitmaps, and cursors that are stored - in the RES subdirectory. This file can be directly edited in Microsoft - Visual C++. - -RegMozCtl.clw - This file contains information used by ClassWizard to edit existing - classes or add new classes. ClassWizard also uses this file to store - information needed to create and edit message maps and dialog data - maps and to create prototype member functions. - -res\RegMozCtl.ico - This is an icon file, which is used as the application's icon. This - icon is included by the main resource file RegMozCtl.rc. - -res\RegMozCtl.rc2 - This file contains resources that are not edited by Microsoft - Visual C++. You should place all resources not editable by - the resource editor in this file. - - - - -///////////////////////////////////////////////////////////////////////////// - -AppWizard creates one dialog class: - -RegMozCtlDlg.h, RegMozCtlDlg.cpp - the dialog - These files contain your CRegMozCtlDlg class. This class defines - the behavior of your application's main dialog. The dialog's - template is in RegMozCtl.rc, which can be edited in Microsoft - Visual C++. - - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named RegMozCtl.pch and a precompiled types file named StdAfx.obj. - -Resource.h - This is the standard header file, which defines new resource IDs. - Microsoft Visual C++ reads and updates this file. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - -If your application uses MFC in a shared DLL, and your application is -in a language other than the operating system's current language, you -will need to copy the corresponding localized resources MFC42XXX.DLL -from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, -and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. -For example, MFC42DEU.DLL contains resources translated to German.) If you -don't do this, some of the UI elements of your application will remain in the -language of the operating system. - -///////////////////////////////////////////////////////////////////////////// diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.cpp b/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.cpp deleted file mode 100644 index ab0e4da9b4a..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// RegMozCtl.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "RegMozCtl.h" -#include "RegMozCtlDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlApp - -BEGIN_MESSAGE_MAP(CRegMozCtlApp, CWinApp) - //{{AFX_MSG_MAP(CRegMozCtlApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlApp construction - -CRegMozCtlApp::CRegMozCtlApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CRegMozCtlApp object - -CRegMozCtlApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlApp initialization - -BOOL CRegMozCtlApp::InitInstance() -{ - AfxEnableControlContainer(); - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - CRegMozCtlDlg dlg; - m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); - if (nResponse == IDOK) - { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } - else if (nResponse == IDCANCEL) - { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.dsp b/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.dsp deleted file mode 100644 index 4687c62dacf..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.dsp +++ /dev/null @@ -1,166 +0,0 @@ -# Microsoft Developer Studio Project File - Name="RegMozCtl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=RegMozCtl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "RegMozCtl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "RegMozCtl.mak" CFG="RegMozCtl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "RegMozCtl - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "RegMozCtl - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "RegMozCtl - Win32 Release" - -# PROP BASE Use_MFC 5 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "RegMozCtl - Win32 Debug" - -# PROP BASE Use_MFC 5 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 5 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "RegMozCtl - Win32 Release" -# Name "RegMozCtl - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\RegMozCtl.cpp -# End Source File -# Begin Source File - -SOURCE=.\RegMozCtl.rc -# End Source File -# Begin Source File - -SOURCE=.\RegMozCtlDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\RegTask.cpp -# End Source File -# Begin Source File - -SOURCE=.\RegTaskManager.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\RegMozCtl.h -# End Source File -# Begin Source File - -SOURCE=.\RegMozCtlDlg.h -# End Source File -# Begin Source File - -SOURCE=.\RegTask.h -# End Source File -# Begin Source File - -SOURCE=.\RegTaskManager.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\MozillaBrowser.ico -# End Source File -# Begin Source File - -SOURCE=.\res\RegMozCtl.ico -# End Source File -# Begin Source File - -SOURCE=.\res\RegMozCtl.rc2 -# End Source File -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.h b/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.h deleted file mode 100644 index 02b0c5831ec..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.h +++ /dev/null @@ -1,50 +0,0 @@ -// RegMozCtl.h : main header file for the REGMOZCTL application -// - -#if !defined(AFX_REGMOZCTL_H__C7C0A786_F424_11D2_A27B_000000000000__INCLUDED_) -#define AFX_REGMOZCTL_H__C7C0A786_F424_11D2_A27B_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlApp: -// See RegMozCtl.cpp for the implementation of this class -// - -class CRegMozCtlApp : public CWinApp -{ -public: - CRegMozCtlApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CRegMozCtlApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CRegMozCtlApp) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -static const TCHAR *c_szValueBinDirPath = _T("BinDirPath"); - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_REGMOZCTL_H__C7C0A786_F424_11D2_A27B_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.rc b/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.rc deleted file mode 100644 index 7c10366fe87..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtl.rc +++ /dev/null @@ -1,197 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.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 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_REGMOZCTL_DIALOG DIALOGEX 0, 0, 270, 241 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "RegMozCtl" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDI_MOZILLA,IDC_STATIC,7,7,21,20 - LTEXT "This application registers/deregisters the Mozilla Control and ensures that Mozilla path and registry values are set so the control can be used by other applications.", - IDC_STATIC,35,7,228,30 - LTEXT "You must choose the directory containing the Mozilla control and click on the Register or Deregister as appropriate.", - IDC_STATIC,7,36,256,17 - EDITTEXT IDC_MOZILLADIR,7,55,242,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PICKDIR,250,55,13,14 - DEFPUSHBUTTON "&Register",IDC_REGISTER,7,220,50,14 - PUSHBUTTON "&Unregister",IDC_UNREGISTER,80,220,50,14 - PUSHBUTTON "&Close",IDCANCEL,213,220,50,14 - CONTROL "List1",IDC_TASKLIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,7,75,256,134 -END - - -#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 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "RegMozCtl MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "RegMozCtl\0" - VALUE "LegalCopyright", "Copyright (C) 1999\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "RegMozCtl.EXE\0" - VALUE "ProductName", "RegMozCtl Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_REGMOZCTL_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 263 - TOPMARGIN, 7 - BOTTOMMARGIN, 234 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif //_WIN32\r\n" - "#include ""res\\RegMozCtl.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\RegMozCtl.ico" -IDI_MOZILLA ICON DISCARDABLE "MozillaBrowser.ico" -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif //_WIN32 -#include "res\RegMozCtl.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.cpp b/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.cpp deleted file mode 100644 index 31a2df45695..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// RegMozCtlDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "RegMozCtl.h" -#include "RegMozCtlDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlDlg dialog - -CRegMozCtlDlg::CRegMozCtlDlg(CWnd* pParent /*=NULL*/) - : CDialog(CRegMozCtlDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CRegMozCtlDlg) - m_szMozillaDir = _T(""); - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDI_MOZILLA); - - GetCurrentDirectory(1024, m_szMozillaDir.GetBuffer(1024)); - m_szMozillaDir.ReleaseBuffer(); -} - -void CRegMozCtlDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CRegMozCtlDlg) - DDX_Control(pDX, IDC_TASKLIST, m_cTaskList); - DDX_Text(pDX, IDC_MOZILLADIR, m_szMozillaDir); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CRegMozCtlDlg, CDialog) - //{{AFX_MSG_MAP(CRegMozCtlDlg) - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_BN_CLICKED(IDC_REGISTER, OnRegister) - ON_BN_CLICKED(IDC_UNREGISTER, OnUnregister) - ON_BN_CLICKED(IDC_PICKDIR, OnPickDir) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlDlg message handlers - -BOOL CRegMozCtlDlg::OnInitDialog() -{ - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // Get values from the registry - TCHAR szValue[1024]; - DWORD dwSize = sizeof(szValue) / sizeof(szValue[0]); - CRegKey cKey; - cKey.Create(HKEY_LOCAL_MACHINE, MOZ_CONTROL_REG_KEY); - - memset(szValue, 0, sizeof(szValue)); - if (cKey.QueryValue(szValue, MOZ_CONTROL_REG_VALUE_BIN_DIR_PATH, &dwSize) == ERROR_SUCCESS) - { - m_szMozillaDir = CString(szValue); - } - - CDialog::OnInitDialog(); - - CRegTask::PopulateTasks(m_cTaskMgr); - - // Add icons to image list -// m_cImageList.Create(16, 16, ILC_MASK, 0, 5); -// m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_DOESNTCONTAINIE)); -// m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSIE)); -// m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSMOZILLA)); -// m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_UNKNOWNSTATUS)); - - // Associate image list with file list -// m_cFileList.SetImageList(&m_cImageList, LVSIL_SMALL); - - struct ColumnData - { - TCHAR *sColumnTitle; - int nPercentageWidth; - int nFormat; - }; - - ColumnData aColData[] = - { - { _T("Task"), 70, LVCFMT_LEFT }, - { _T("Status"), 30, LVCFMT_LEFT } - }; - - // Get the size of the file list control and neatly - // divide it into columns - - CRect rcList; - m_cTaskList.GetClientRect(&rcList); - - int nColTotal = sizeof(aColData) / sizeof(aColData[0]); - int nWidthRemaining = rcList.Width(); - - for (int nCol = 0; nCol < nColTotal; nCol++) - { - ColumnData *pData = &aColData[nCol]; - - int nColWidth = (rcList.Width() * pData->nPercentageWidth) / 100; - if (nCol == nColTotal - 1) - { - nColWidth = nWidthRemaining; - } - else if (nColWidth > nWidthRemaining) - { - nColWidth = nWidthRemaining; - } - - m_cTaskList.InsertColumn(nCol, pData->sColumnTitle, pData->nFormat, nColWidth); - - nWidthRemaining -= nColWidth; - if (nColWidth <= 0) - { - break; - } - } - - for (int i = 0; i < m_cTaskMgr.GetTaskCount(); i++) - { - CRegTask *pTask = m_cTaskMgr.GetTask(i); - m_cTaskList.InsertItem(i, pTask->GetDescription()); - } - - return TRUE; // return TRUE unless you set the focus to a control -} - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CRegMozCtlDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CDialog::OnPaint(); - } -} - -// The system calls this to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CRegMozCtlDlg::OnQueryDragIcon() -{ - return (HCURSOR) m_hIcon; -} - -void CRegMozCtlDlg::OnRegister() -{ - RegisterMozillaControl(TRUE); -} - -void CRegMozCtlDlg::OnUnregister() -{ - RegisterMozillaControl(FALSE); -} - -void CRegMozCtlDlg::RegisterMozillaControl(BOOL bRegister) -{ - UpdateData(); - - m_cTaskMgr.SetValue(c_szValueBinDirPath, m_szMozillaDir); - - for (int i = 0; i < m_cTaskMgr.GetTaskCount(); i++) - { - CRegTask *pTask = m_cTaskMgr.GetTask(i); - pTask->DoTask(); - } - - AfxMessageBox(bRegister ? _T("Register completed") : _T("Unregister completed")); -} - -void CRegMozCtlDlg::OnPickDir() -{ - BROWSEINFO bi; - TCHAR szFolder[MAX_PATH + 1]; - - memset(szFolder, 0, sizeof(szFolder)); - - memset(&bi, 0, sizeof(bi)); - bi.hwndOwner = GetSafeHwnd(); - bi.pidlRoot = NULL; - bi.pszDisplayName = szFolder; - bi.lpszTitle = _T("Pick a folder to scan"); - - // Open the folder browser dialog - LPITEMIDLIST pItemList = SHBrowseForFolder(&bi); - if (pItemList) - { - IMalloc *pShellAllocator = NULL; - - SHGetMalloc(&pShellAllocator); - if (pShellAllocator) - { - char szPath[MAX_PATH + 1]; - - if (SHGetPathFromIDList(pItemList, szPath)) - { - // Chop off the end path separator - int nPathSize = strlen(szPath); - if (nPathSize > 0) - { - if (szPath[nPathSize - 1] == '\\') - { - szPath[nPathSize - 1] = '\0'; - } - } - - m_szMozillaDir = CString(szPath); - - UpdateData(FALSE); - } - - pShellAllocator->Free(pItemList); - pShellAllocator->Release(); - } - } -} - - -CString CRegMozCtlDlg::GetSystemPath() -{ - // TODO - return _T(""); -} - -BOOL CRegMozCtlDlg::SetSystemPath(const CString &szNewPath) -{ - // TODO - return TRUE; -} diff --git a/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.h b/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.h deleted file mode 100644 index cb35aac0308..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.h +++ /dev/null @@ -1,60 +0,0 @@ -// RegMozCtlDlg.h : header file -// - -#if !defined(AFX_REGMOZCTLDLG_H__C7C0A788_F424_11D2_A27B_000000000000__INCLUDED_) -#define AFX_REGMOZCTLDLG_H__C7C0A788_F424_11D2_A27B_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#include "RegTaskManager.h" - -///////////////////////////////////////////////////////////////////////////// -// CRegMozCtlDlg dialog - -class CRegMozCtlDlg : public CDialog -{ -// Construction -public: - CRegMozCtlDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CRegMozCtlDlg) - enum { IDD = IDD_REGMOZCTL_DIALOG }; - CListCtrl m_cTaskList; - CString m_szMozillaDir; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CRegMozCtlDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - HICON m_hIcon; - CRegTaskManager m_cTaskMgr; - - - // Generated message map functions - //{{AFX_MSG(CRegMozCtlDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnRegister(); - afx_msg void OnUnregister(); - afx_msg void OnPickDir(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - void RegisterMozillaControl(BOOL bRegister); - BOOL SetSystemPath(const CString &szNewPath); - CString GetSystemPath(); -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_REGMOZCTLDLG_H__C7C0A788_F424_11D2_A27B_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/RegMozCtl/RegTask.cpp b/embedding/browser/activex/tests/RegMozCtl/RegTask.cpp deleted file mode 100644 index a36bca274c6..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegTask.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// RegTask.cpp: implementation of the CRegTask class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "regmozctl.h" -#include "RegTask.h" -#include "RegTaskManager.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CRegTask::CRegTask() -{ - -} - -CRegTask::CRegTask(CRegTaskManager *pMgr) -{ - m_pTaskMgr = pMgr; -} - -CRegTask::~CRegTask() -{ - -} - -////////////////////////////////////////////////////////////////////// - -class CRegTaskRegistry : public CRegTask -{ -public: - CRegTaskRegistry(CRegTaskManager *pMgr) : CRegTask(pMgr) - { - m_szDesc = _T("Set BinDirectoryPath registry entry"); - } - HRESULT DoTask(); -}; - - -HRESULT CRegTaskRegistry::DoTask() -{ - CString szBinDirPath; - m_pTaskMgr->GetValue(c_szValueBinDirPath, szBinDirPath); - // Create registry key - CRegKey cKey; - cKey.Create(HKEY_LOCAL_MACHINE, MOZ_CONTROL_REG_KEY); - cKey.SetValue(szBinDirPath, MOZ_CONTROL_REG_VALUE_BIN_DIR_PATH); - cKey.Close(); - return S_OK; -} - -////////////////////////////////////////////////////////////////////// - -class CRegTaskRegSvr : public CRegTask -{ -public: - CRegTaskRegSvr(CRegTaskManager *pMgr) : CRegTask(pMgr) - { - m_szDesc = _T("Register Mozilla Control"); - } - HRESULT DoTask(); -}; - - -HRESULT CRegTaskRegSvr::DoTask() -{ - BOOL bRegister = TRUE; - CString szBinDirPath; - m_pTaskMgr->GetValue(c_szValueBinDirPath, szBinDirPath); - SetCurrentDirectory(szBinDirPath); - - // Now register the mozilla control - CString szMozCtl = szBinDirPath + CString(_T("\\mozctl.dll")); - HINSTANCE hMod = LoadLibrary(szMozCtl); - if (hMod == NULL) - { - AfxMessageBox(_T("Can't find mozctl.dll in current directory")); - return E_FAIL; - } - - HRESULT hr = E_FAIL; - FARPROC pfn = GetProcAddress(hMod, bRegister ? _T("DllRegisterServer") : _T("DllUnregisterServer")); - if (pfn) - { - hr = pfn(); - } - FreeLibrary(hMod); - return hr; -} - -////////////////////////////////////////////////////////////////////// - -class CRegTaskPATH : public CRegTask -{ -public: - CRegTaskPATH(CRegTaskManager *pMgr) : CRegTask(pMgr) - { - m_szDesc = _T("Set PATH environment variable"); - } - HRESULT DoTask(); -}; - - -HRESULT CRegTaskPATH::DoTask() -{ - CString szBinDirPath; - m_pTaskMgr->GetValue(c_szValueBinDirPath, szBinDirPath); - - return S_OK; -} - -////////////////////////////////////////////////////////////////////// - -HRESULT CRegTask::PopulateTasks(CRegTaskManager &cMgr) -{ - cMgr.AddTask(new CRegTaskRegistry(&cMgr)); - cMgr.AddTask(new CRegTaskPATH(&cMgr)); - cMgr.AddTask(new CRegTaskRegSvr(&cMgr)); - return S_OK; -} - diff --git a/embedding/browser/activex/tests/RegMozCtl/RegTask.h b/embedding/browser/activex/tests/RegMozCtl/RegTask.h deleted file mode 100644 index 19e88a77d12..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegTask.h +++ /dev/null @@ -1,36 +0,0 @@ -// RegTask.h: interface for the CRegTask class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_REGTASK_H__28D3BD27_F767_4412_B00B_236E3562B214__INCLUDED_) -#define AFX_REGTASK_H__28D3BD27_F767_4412_B00B_236E3562B214__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class CRegTaskManager; - -class CRegTask -{ -protected: - CRegTaskManager *m_pTaskMgr; - CString m_szDesc; - -public: - static HRESULT PopulateTasks(CRegTaskManager &cMgr); - -public: - CRegTask(); - CRegTask(CRegTaskManager *pMgr); - virtual ~CRegTask(); - - CString GetDescription() - { - return m_szDesc; - } - - virtual HRESULT DoTask() = 0; -}; - -#endif // !defined(AFX_REGTASK_H__28D3BD27_F767_4412_B00B_236E3562B214__INCLUDED_) diff --git a/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.cpp b/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.cpp deleted file mode 100644 index c010841a1da..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// RegTaskManager.cpp: implementation of the CRegTaskManager class. -// -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "regmozctl.h" -#include "RegTaskManager.h" - -#include -#include - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CRegTaskManager::CRegTaskManager() -{ - m_bNeedReboot = FALSE; -} - -CRegTaskManager::~CRegTaskManager() -{ - -} - -void CRegTaskManager::SetNeedReboot() -{ - m_bNeedReboot = TRUE; -} - -void CRegTaskManager::AddTask(CRegTask *pTask) -{ - m_cTasks.push_back(pTask); -} - - -void CRegTaskManager::SetValue(const TCHAR *szName, const TCHAR *szValue) -{ - if (_tcscmp(szName, c_szValueBinDirPath) == 0) - { - m_szBinDirPath = szValue; - } -} - -void CRegTaskManager::GetValue(const TCHAR *szName, CString &szValue) -{ - if (_tcscmp(szName, c_szValueBinDirPath) == 0) - { - szValue = m_szBinDirPath; - } -} diff --git a/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.h b/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.h deleted file mode 100644 index 3e30f1d5fd3..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/RegTaskManager.h +++ /dev/null @@ -1,37 +0,0 @@ -// RegTaskManager.h: interface for the CRegTaskManager class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_REGTASKMANAGER_H__516D62F5_00EC_4450_B965_003425CF33E1__INCLUDED_) -#define AFX_REGTASKMANAGER_H__516D62F5_00EC_4450_B965_003425CF33E1__INCLUDED_ - -#include - -#include "RegTask.h" - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class CRegTaskManager -{ - std::vector m_cTasks; - BOOL m_bNeedReboot; - - CString m_szBinDirPath; - -public: - CRegTaskManager(); - virtual ~CRegTaskManager(); - - void SetValue(const TCHAR *szName, const TCHAR *szValue); - void GetValue(const TCHAR *szName, CString &szValue); - void SetNeedReboot(); - - void AddTask(CRegTask *pTask); - int GetTaskCount() const { return m_cTasks.size(); } - CRegTask *GetTask(int nIndex) { return m_cTasks[nIndex]; } -}; - - -#endif // !defined(AFX_REGTASKMANAGER_H__516D62F5_00EC_4450_B965_003425CF33E1__INCLUDED_) diff --git a/embedding/browser/activex/tests/RegMozCtl/StdAfx.cpp b/embedding/browser/activex/tests/RegMozCtl/StdAfx.cpp deleted file mode 100644 index aeedd8dd8eb..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/StdAfx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// RegMozCtl.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - - - diff --git a/embedding/browser/activex/tests/RegMozCtl/StdAfx.h b/embedding/browser/activex/tests/RegMozCtl/StdAfx.h deleted file mode 100644 index d568d24e0f5..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/StdAfx.h +++ /dev/null @@ -1,30 +0,0 @@ -// 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__C7C0A78A_F424_11D2_A27B_000000000000__INCLUDED_) -#define AFX_STDAFX_H__C7C0A78A_F424_11D2_A27B_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC Automation classes -#include // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT -#include - -#define MOZ_CONTROL_REG_KEY _T("Software\\Mozilla\\") -#define MOZ_CONTROL_REG_VALUE_BIN_DIR_PATH _T("BinDirectoryPath") - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__C7C0A78A_F424_11D2_A27B_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.ico b/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.ico deleted file mode 100644 index 7eef0bcbe65..00000000000 Binary files a/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.rc2 b/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.rc2 deleted file mode 100644 index 57afbe6e741..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.rc2 +++ /dev/null @@ -1,13 +0,0 @@ -// -// REGMOZCTL.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/embedding/browser/activex/tests/RegMozCtl/resource.h b/embedding/browser/activex/tests/RegMozCtl/resource.h deleted file mode 100644 index 15a4ac1334c..00000000000 --- a/embedding/browser/activex/tests/RegMozCtl/resource.h +++ /dev/null @@ -1,28 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by RegMozCtl.rc -// -#define IDD_REGMOZCTL_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDI_MOZILLA 130 -#define IDC_REGISTER 1001 -#define IDC_UNREGISTER 1002 -#define IDC_MOZILLADIR 1003 -#define IDC_PICKDIR 1004 -#define IDC_COMPONENTFILE 1005 -#define IDC_PICKCOMPONENTFILE 1006 -#define IDC_COMPONENTPATH 1007 -#define IDC_PICKCOMPONENTPATH 1008 -#define IDC_AUTOMATIC 1009 -#define IDC_TASKLIST 1010 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1011 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/embedding/browser/activex/tests/cbrowse/CBrowseDlg.cpp b/embedding/browser/activex/tests/cbrowse/CBrowseDlg.cpp deleted file mode 100644 index 780fdd54c93..00000000000 --- a/embedding/browser/activex/tests/cbrowse/CBrowseDlg.cpp +++ /dev/null @@ -1,983 +0,0 @@ -// CBrowseDlg.cpp : implementation file -// - -#include "stdafx.h" - -#include "cbrowse.h" -#include "CBrowseDlg.h" -#include "ControlEventSink.h" -#include "..\..\src\control\DHTMLCmdIds.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#include -#include -#include - -#include - -#include - -void __cdecl fperr(int sig) -{ - CString sError; - sError.Format("FP Error %08x", sig); - AfxMessageBox(sError); -} - -TCHAR *aURLs[] = -{ - _T("http://whippy/calendar.html"), - _T("http://www.mozilla.org"), - _T("http://www.yahoo.com"), - _T("http://www.netscape.com"), - _T("http://www.microsoft.com") -}; - -CBrowseDlg *CBrowseDlg::m_pBrowseDlg = NULL; - -///////////////////////////////////////////////////////////////////////////// -// CBrowseDlg dialog - -CBrowseDlg::CBrowseDlg(CWnd* pParent /*=NULL*/) - : CDialog(CBrowseDlg::IDD, pParent) -{ - signal(SIGFPE, fperr); - double x = 0.0; - double y = 1.0/x; - - //{{AFX_DATA_INIT(CBrowseDlg) - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_pBrowseDlg = this; - m_pControlSite = NULL; - m_clsid = CLSID_NULL; - m_bUseCustomPopupMenu = FALSE; - m_bUseCustomDropTarget = FALSE; - m_bEditMode = FALSE; - m_bNewWindow = FALSE; - m_bCanGoBack = FALSE; - m_bCanGoForward = FALSE; -} - -void CBrowseDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CBrowseDlg) - DDX_Control(pDX, IDC_STOP, m_btnStop); - DDX_Control(pDX, IDC_FORWARD, m_btnForward); - DDX_Control(pDX, IDC_BACKWARD, m_btnBack); - DDX_Control(pDX, IDC_URL, m_cmbURLs); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CBrowseDlg, CDialog) - //{{AFX_MSG_MAP(CBrowseDlg) - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_BN_CLICKED(IDC_GO, OnGo) - ON_BN_CLICKED(IDC_BACKWARD, OnBackward) - ON_BN_CLICKED(IDC_FORWARD, OnForward) - ON_WM_CLOSE() - ON_WM_DESTROY() - ON_WM_SIZE() - ON_COMMAND(ID_FILE_EXIT, OnFileExit) - ON_COMMAND(ID_VIEW_GOTO_BACK, OnViewGotoBack) - ON_COMMAND(ID_VIEW_GOTO_FORWARD, OnViewGotoForward) - ON_COMMAND(ID_VIEW_GOTO_HOME, OnViewGotoHome) - ON_COMMAND(ID_EDIT_COPY, OnEditCopy) - ON_COMMAND(ID_EDIT_CUT, OnEditCut) - ON_COMMAND(ID_EDIT_PASTE, OnEditPaste) - ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout) - ON_UPDATE_COMMAND_UI(ID_VIEW_GOTO_BACK, OnUpdateViewGotoBack) - ON_UPDATE_COMMAND_UI(ID_VIEW_GOTO_FORWARD, OnUpdateViewGotoForward) - ON_COMMAND(ID_EDIT_SELECTALL, OnEditSelectAll) - ON_COMMAND(ID_VIEW_REFRESH, OnViewRefresh) - ON_COMMAND(ID_VIEW_VIEWSOURCE, OnViewViewSource) - ON_BN_CLICKED(IDC_STOP, OnStop) - ON_COMMAND(ID_FILE_SAVEAS, OnFileSaveAs) - ON_COMMAND(ID_FILE_PRINT, OnFilePrint) - ON_COMMAND(ID_DEBUG_VISIBLE, OnDebugVisible) - ON_UPDATE_COMMAND_UI(ID_DEBUG_VISIBLE, OnUpdateDebugVisible) - ON_COMMAND(ID_DEBUG_POSTDATATEST, OnDebugPostDataTest) - ON_BN_CLICKED(IDC_RELOAD, OnReload) - ON_COMMAND(ID_VIEW_EDITMODE, OnViewEditmode) - ON_COMMAND(ID_VIEW_OPENLINKSINNEWWINDOWS, OnViewOpenInNewWindow) - ON_UPDATE_COMMAND_UI(ID_VIEW_EDITMODE, OnUpdateViewEditmode) - ON_UPDATE_COMMAND_UI(ID_VIEW_OPENLINKSINNEWWINDOWS, OnUpdateViewOpenInNewWindow) - ON_COMMAND(ID_FILE_PAGESETUP, OnFilePagesetup) - //}}AFX_MSG_MAP - ON_COMMAND(IDB_BOLD, OnEditBold) - ON_COMMAND(IDB_ITALIC, OnEditItalic) - ON_COMMAND(IDB_UNDERLINE, OnEditUnderline) -END_MESSAGE_MAP() - -#define IL_CLOSEDFOLDER 0 -#define IL_OPENFOLDER 1 -#define IL_TEST 2 -#define IL_TESTFAILED 3 -#define IL_TESTPASSED 4 -#define IL_TESTPARTIAL 5 -#define IL_NODE IL_TEST - -///////////////////////////////////////////////////////////////////////////// -// CBrowseDlg message handlers - -BOOL CBrowseDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - CWinApp *pApp = AfxGetApp(); - m_szTestURL = pApp->GetProfileString(SECTION_TEST, KEY_TESTURL, KEY_TESTURL_DEFAULTVALUE); - m_szTestCGI = pApp->GetProfileString(SECTION_TEST, KEY_TESTCGI, KEY_TESTCGI_DEFAULTVALUE); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - CRect rcTabMarker; - GetDlgItem(IDC_TAB_MARKER)->GetWindowRect(&rcTabMarker); - ScreenToClient(rcTabMarker); - - m_dlgPropSheet.AddPage(&m_TabMessages); - m_dlgPropSheet.AddPage(&m_TabTests); - m_dlgPropSheet.AddPage(&m_TabDOM); - - m_TabMessages.m_pBrowseDlg = this; - m_TabTests.m_pBrowseDlg = this; - m_TabDOM.m_pBrowseDlg = this; - - m_dlgPropSheet.Create(this, WS_CHILD | WS_VISIBLE, 0); - m_dlgPropSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT); - m_dlgPropSheet.ModifyStyle( 0, WS_TABSTOP ); - m_dlgPropSheet.SetWindowPos( NULL, rcTabMarker.left-7, rcTabMarker.top-7, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE ); - - // Image list - m_cImageList.Create(16, 16, ILC_COLOR | ILC_MASK, 0, 10); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CLOSEDFOLDER)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_OPENFOLDER)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_TEST)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_TESTFAILED)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_TESTPASSED)); - m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_TESTPARTIAL)); - - // Set up the editor bar - CRect rcEditBarMarker; - GetDlgItem(IDC_EDITBAR_MARKER)->GetWindowRect(&rcEditBarMarker); - ScreenToClient(rcEditBarMarker); - GetDlgItem(IDC_EDITBAR_MARKER)->DestroyWindow(); - - m_EditBar.Create(this); - m_EditBar.LoadToolBar(IDR_DHTMLEDIT); - m_EditBar.SetWindowPos(&wndTop, rcEditBarMarker.left, rcEditBarMarker.top, - rcEditBarMarker.Width(), rcEditBarMarker.Height(), SWP_SHOWWINDOW); - - // Set up some URLs. The first couple are internal - m_cmbURLs.AddString(m_szTestURL); - for (int i = 0; i < sizeof(aURLs) / sizeof(aURLs[0]); i++) - { - m_cmbURLs.AddString(aURLs[i]); - } - m_cmbURLs.SetCurSel(0); - - // Create the contained web browser - CreateWebBrowser(); - - // Load the menu - m_menu.LoadMenu(IDR_MAIN); - SetMenu(&m_menu); - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - - return TRUE; // return TRUE unless you set the focus to a control -} - - -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. - -void CBrowseDlg::OnPaint() -{ - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CPaintDC dc(this); - - m_pControlSite->Draw(dc.m_hDC); - } -} - -// The system calls this to obtain the cursor to display while the user drags -// the minimized window. -HCURSOR CBrowseDlg::OnQueryDragIcon() -{ - return (HCURSOR) m_hIcon; -} - -struct EnumData -{ - CBrowseDlg *pBrowseDlg; - CSize sizeDelta; -}; - -BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) -{ - EnumData *pData = (EnumData *) lParam; - CBrowseDlg *pThis = pData->pBrowseDlg; - - switch (::GetDlgCtrlID(hwnd)) - { - case IDC_BROWSER_MARKER: - { - CWnd *pMarker = pThis->GetDlgItem(IDC_BROWSER_MARKER); - CRect rcMarker; - pMarker->GetWindowRect(&rcMarker); - pThis->ScreenToClient(rcMarker); - - rcMarker.right += pData->sizeDelta.cx; - rcMarker.bottom += pData->sizeDelta.cy; - - if (rcMarker.Width() > 10 && rcMarker.Height() > 10) - { - pMarker->SetWindowPos(&CWnd::wndBottom, 0, 0, rcMarker.Width(), rcMarker.Height(), - SWP_NOMOVE | SWP_NOACTIVATE | SWP_HIDEWINDOW); - pThis->m_pControlSite->SetPosition(rcMarker); - } - } - break; - case IDC_TAB_MARKER: - { - CWnd *pMarker = pThis->GetDlgItem(IDC_TAB_MARKER); - CRect rcMarker; - pMarker->GetWindowRect(&rcMarker); - pThis->ScreenToClient(rcMarker); - - rcMarker.top += pData->sizeDelta.cy; - - if (rcMarker.top > 70) - { - pMarker->SetWindowPos(&CWnd::wndBottom, rcMarker.left, rcMarker.top, 0, 0, - SWP_NOSIZE | SWP_NOACTIVATE | SWP_HIDEWINDOW); - pThis->m_dlgPropSheet.SetWindowPos(NULL, rcMarker.left - 7, rcMarker.top - 7, 0, 0, - SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOACTIVATE); - } - } - - } - - return TRUE; -} - -void CBrowseDlg::OnSize(UINT nType, int cx, int cy) -{ - CDialog::OnSize(nType, cx, cy); - - if (m_hWnd == NULL) - { - return; - } - - static CSize sizeOld(-1, -1); - CSize sizeNew(cx, cy); - - if (sizeOld.cx != -1) - { - EnumData data; - data.pBrowseDlg = this; - data.sizeDelta = sizeNew - sizeOld; - ::EnumChildWindows(GetSafeHwnd(), EnumChildProc, (LPARAM) &data); - } - sizeOld = sizeNew; -} - -HRESULT CBrowseDlg::CreateWebBrowser() -{ - // Get the position of the browser marker - CRect rcMarker; - GetDlgItem(IDC_BROWSER_MARKER)->GetWindowRect(&rcMarker); - ScreenToClient(rcMarker); - GetDlgItem(IDC_BROWSER_MARKER)->ShowWindow(FALSE); - -// GetDlgItem(IDC_BROWSER_MARKER)->DestroyWindow(); - - CBrowserCtlSiteInstance::CreateInstance(&m_pControlSite); - if (m_pControlSite == NULL) - { - OutputString(_T("Error: could not create control site")); - return E_OUTOFMEMORY; - } - - CBrowseEventSinkInstance *pEventSink = NULL; - CBrowseEventSinkInstance::CreateInstance(&pEventSink); - if (pEventSink == NULL) - { - m_pControlSite->Release(); - m_pControlSite = NULL; - OutputString(_T("Error: could not create event sink")); - return E_OUTOFMEMORY; - } - pEventSink->m_pBrowseDlg = this; - - HRESULT hr; - - PropertyList pl; - m_pControlSite->AddRef(); - m_pControlSite->m_bUseCustomPopupMenu = m_bUseCustomPopupMenu; - m_pControlSite->m_bUseCustomDropTarget = m_bUseCustomDropTarget; - m_pControlSite->Create(m_clsid, pl); - hr = m_pControlSite->Attach(GetSafeHwnd(), rcMarker, NULL); - if (hr != S_OK) - { - OutputString(_T("Error: Cannot attach to browser control, hr = 0x%08x"), hr); - } - else - { - OutputString(_T("Successfully attached to browser control")); - } - - m_pControlSite->SetPosition(rcMarker); - hr = m_pControlSite->Advise(pEventSink, DIID_DWebBrowserEvents2, &m_dwCookie); - if (hr != S_OK) - { - OutputString(_T("Error: Cannot subscribe to DIID_DWebBrowserEvents2 events, hr = 0x%08x"), hr); - } - else - { - OutputString(_T("Successfully subscribed to events")); - } - - CComPtr spUnkBrowser; - m_pControlSite->GetControlUnknown(&spUnkBrowser); - - CIPtr(IWebBrowser2) spWebBrowser = spUnkBrowser; - if (spWebBrowser) - { - spWebBrowser->put_RegisterAsDropTarget(VARIANT_TRUE); - } - - return S_OK; -} - - -HRESULT CBrowseDlg::DestroyWebBrowser() -{ - if (m_pControlSite) - { - m_pControlSite->Unadvise(DIID_DWebBrowserEvents2, m_dwCookie); - m_pControlSite->Detach(); - m_pControlSite->Release(); - m_pControlSite = NULL; - } - - return S_OK; -} - -void CBrowseDlg::PopulateTests() -{ - // Create the test tree - CTreeCtrl &tc = m_TabTests.m_tcTests; - - tc.SetImageList(&m_cImageList, TVSIL_NORMAL); - for (int i = 0; i < nTestSets; i++) - { - TestSet *pTestSet = &aTestSets[i]; - HTREEITEM hParent = tc.InsertItem(pTestSet->szName, IL_CLOSEDFOLDER, IL_CLOSEDFOLDER); - m_TabTests.m_tcTests.SetItemData(hParent, (DWORD) pTestSet); - - if (pTestSet->pfnPopulator) - { - pTestSet->pfnPopulator(pTestSet); - } - - for (int j = 0; j < pTestSet->nTests; j++) - { - Test *pTest = &pTestSet->aTests[j]; - HTREEITEM hTest = tc.InsertItem(pTest->szName, IL_TEST, IL_TEST, hParent); - if (hTest) - { - tc.SetItemData(hTest, (DWORD) pTest); - } - } - } -} - - -void CBrowseDlg::UpdateURL() -{ - CIPtr(IWebBrowser) spBrowser; - - GetWebBrowser(&spBrowser); - if (spBrowser) - { - USES_CONVERSION; - BSTR szLocation = NULL; - spBrowser->get_LocationURL(&szLocation); - m_cmbURLs.SetWindowText(W2T(szLocation)); - SysFreeString(szLocation); - } -} - - -HRESULT CBrowseDlg::GetWebBrowser(IWebBrowser **pWebBrowser) -{ - if (pWebBrowser == NULL) - { - return E_INVALIDARG; - } - - *pWebBrowser = NULL; - - if (m_pControlSite) - { - IUnknown *pIUnkBrowser = NULL; - m_pControlSite->GetControlUnknown(&pIUnkBrowser); - if (pIUnkBrowser) - { - pIUnkBrowser->QueryInterface(IID_IWebBrowser, (void **) pWebBrowser); - pIUnkBrowser->Release(); - if (*pWebBrowser) - { - return S_OK; - } - } - } - - return E_FAIL; -} - -void CBrowseDlg::OnGo() -{ - UpdateData(); - - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - CString szURL; - m_cmbURLs.GetWindowText(szURL); - CComVariant vFlags(m_bNewWindow ? navOpenInNewWindow : 0); - BSTR bstrURL = szURL.AllocSysString(); - HRESULT hr = webBrowser->Navigate(bstrURL, &vFlags, NULL, NULL, NULL); - if (FAILED(hr)) - { - OutputString("Navigate failed (hr=0x%08x)", hr); - } - ::SysFreeString(bstrURL); - } -} - - -void CBrowseDlg::OnStop() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - webBrowser->Stop(); - } -} - -void CBrowseDlg::OnReload() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - CComVariant vValue(REFRESH_COMPLETELY); - webBrowser->Refresh2(&vValue); - } -} - -void CBrowseDlg::OnBackward() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - webBrowser->GoBack(); - } -} - -void CBrowseDlg::OnForward() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - webBrowser->GoForward(); - } -} - -void CBrowseDlg::RunTestSet(TestSet *pTestSet) -{ - ASSERT(pTestSet); - if (pTestSet == NULL) - { - return; - } - - for (int j = 0; j < pTestSet->nTests; j++) - { - Test *pTest = &pTestSet->aTests[j]; - RunTest(pTest); - } -} - - -TestResult CBrowseDlg::RunTest(Test *pTest) -{ - ASSERT(pTest); - TestResult nResult = trFailed; - - CString szMsg; - szMsg.Format(_T("Running test \"%s\""), pTest->szName); - OutputString(szMsg); - - if (pTest && pTest->pfn) - { - BrowserInfo cInfo; - - cInfo.pTest = pTest; - cInfo.clsid = m_clsid; - cInfo.pControlSite = m_pControlSite; - cInfo.pIUnknown = NULL; - cInfo.pBrowseDlg = this; - cInfo.szTestURL = m_szTestURL; - cInfo.szTestCGI = m_szTestCGI; - if (cInfo.pControlSite) - { - cInfo.pControlSite->GetControlUnknown(&cInfo.pIUnknown); - } - nResult = pTest->pfn(cInfo); - pTest->nLastResult = nResult; - if (cInfo.pIUnknown) - { - cInfo.pIUnknown->Release(); - } - } - - switch (nResult) - { - case trFailed: - OutputString(_T("Test failed")); - break; - case trPassed: - OutputString(_T("Test passed")); - break; - case trPartial: - OutputString(_T("Test partial")); - break; - default: - break; - } - - return nResult; -} - -void CBrowseDlg::OutputString(const TCHAR *szMessage, ...) -{ - if (m_pBrowseDlg == NULL) - { - return; - } - - TCHAR szBuffer[256]; - - va_list cArgs; - va_start(cArgs, szMessage); - _vstprintf(szBuffer, szMessage, cArgs); - va_end(cArgs); - - CString szOutput; - szOutput.Format(_T("%s"), szBuffer); - - m_TabMessages.m_lbMessages.AddString(szOutput); - m_TabMessages.m_lbMessages.SetTopIndex(m_TabMessages.m_lbMessages.GetCount() - 1); -} - -void CBrowseDlg::UpdateTest(HTREEITEM hItem, TestResult nResult) -{ - if (nResult == trPassed) - { - m_TabTests.m_tcTests.SetItemImage(hItem, IL_TESTPASSED, IL_TESTPASSED); - } - else if (nResult == trFailed) - { - m_TabTests.m_tcTests.SetItemImage(hItem, IL_TESTFAILED, IL_TESTFAILED); - } - else if (nResult == trPartial) - { - m_TabTests.m_tcTests.SetItemImage(hItem, IL_TESTPARTIAL, IL_TESTPARTIAL); - } -} - -void CBrowseDlg::UpdateTestSet(HTREEITEM hItem) -{ - // Examine the results - HTREEITEM hTest = m_TabTests.m_tcTests.GetNextItem(hItem, TVGN_CHILD); - while (hTest) - { - Test *pTest = (Test *) m_TabTests.m_tcTests.GetItemData(hTest); - UpdateTest(hTest, pTest->nLastResult); - hTest = m_TabTests.m_tcTests.GetNextItem(hTest, TVGN_NEXT); - } -} - -void CBrowseDlg::OnRunTest() -{ - HTREEITEM hItem = m_TabTests.m_tcTests.GetNextItem(NULL, TVGN_FIRSTVISIBLE); - while (hItem) - { - UINT nState = m_TabTests.m_tcTests.GetItemState(hItem, TVIS_SELECTED); - if (!(nState & TVIS_SELECTED)) - { - hItem = m_TabTests.m_tcTests.GetNextItem(hItem, TVGN_NEXTVISIBLE); - continue; - } - - if (m_TabTests.m_tcTests.ItemHasChildren(hItem)) - { - // Run complete set of tests - TestSet *pTestSet = (TestSet *) m_TabTests.m_tcTests.GetItemData(hItem); - RunTestSet(pTestSet); - UpdateTestSet(hItem); - } - else - { - // Find the test - Test *pTest = (Test *) m_TabTests.m_tcTests.GetItemData(hItem); - TestResult nResult = RunTest(pTest); - UpdateTest(hItem, nResult); - } - - hItem = m_TabTests.m_tcTests.GetNextItem(hItem, TVGN_NEXTVISIBLE); - } -} - -struct _ElementPos -{ - HTREEITEM m_htiParent; - CIPtr(IHTMLElementCollection) m_cpElementCollection; - int m_nIndex; - - _ElementPos(HTREEITEM htiParent, IHTMLElementCollection *pElementCollection, int nIndex) - { - m_htiParent = htiParent; - m_cpElementCollection = pElementCollection; - m_nIndex = nIndex; - } - _ElementPos() - { - } -}; - -void CBrowseDlg::OnRefreshDOM() -{ - m_TabDOM.m_tcDOM.DeleteAllItems(); - - std::stack<_ElementPos> cStack; - - CComPtr cpUnkPtr; - m_pControlSite->GetControlUnknown(&cpUnkPtr); - CIPtr(IWebBrowserApp) cpWebBrowser = cpUnkPtr; - if (cpWebBrowser == NULL) - { - return; - } - - CIPtr(IDispatch) cpDispDocument; - cpWebBrowser->get_Document(&cpDispDocument); - if (cpDispDocument == NULL) - { - return; - } - - // Recurse the DOM, building a tree - - CIPtr(IHTMLDocument2) cpDocElement = cpDispDocument; - - CIPtr(IHTMLElementCollection) cpColl; - HRESULT hr = cpDocElement->get_all( &cpColl ); - - cStack.push(_ElementPos(NULL, cpColl, 0)); - while (!cStack.empty()) - { - // Pop next position from stack - _ElementPos pos = cStack.top(); - cStack.pop(); - - // Iterate through elemenets in collection - LONG nElements = 0;; - pos.m_cpElementCollection->get_length(&nElements); - for (int i = pos.m_nIndex; i < nElements; i++ ) - { - CComVariant vName(i); - CComVariant vIndex; - CIPtr(IDispatch) cpDisp; - - hr = pos.m_cpElementCollection->item( vName, vIndex, &cpDisp ); - if ( hr != S_OK ) - { - continue; - } - CIPtr(IHTMLElement) cpElem = cpDisp; - if (cpElem == NULL) - { - continue; - } - - // Get tag name - BSTR bstrTagName = NULL; - hr = cpElem->get_tagName(&bstrTagName); - CString szTagName = bstrTagName; - SysFreeString(bstrTagName); - - // Add an icon to the tree - HTREEITEM htiParent = m_TabDOM.m_tcDOM.InsertItem(szTagName, IL_CLOSEDFOLDER, IL_CLOSEDFOLDER, pos.m_htiParent); - - CIPtr(IDispatch) cpDispColl; - hr = cpElem->get_children(&cpDispColl); - if (hr == S_OK) - { - CIPtr(IHTMLElementCollection) cpChildColl = cpDispColl; - cStack.push(_ElementPos(pos.m_htiParent, pos.m_cpElementCollection, pos.m_nIndex + 1)); - cStack.push(_ElementPos(htiParent, cpChildColl, 0)); - break; - } - } - } -} - - -void CBrowseDlg::OnClose() -{ - DestroyWebBrowser(); - DestroyWindow(); -} - - -void CBrowseDlg::OnDestroy() -{ - CDialog::OnDestroy(); - delete this; -} - -void CBrowseDlg::ExecOleCommand(const GUID *pguidGroup, DWORD nCmdId) -{ - CComPtr spUnkBrowser; - m_pControlSite->GetControlUnknown(&spUnkBrowser); - - CIPtr(IOleCommandTarget) spCommandTarget = spUnkBrowser; - if (spCommandTarget) - { - HRESULT hr = spCommandTarget->Exec(&CGID_MSHTML, nCmdId, 0, NULL, NULL); - OutputString(_T("Exec(%d), returned %08x"), (int) nCmdId, hr); - } - else - { - OutputString(_T("Error: Browser does not support IOleCommandTarget")); - } -} - - -void CBrowseDlg::OnEditBold() -{ - ExecOleCommand(&CGID_MSHTML, IDM_BOLD); -} - -void CBrowseDlg::OnEditItalic() -{ - ExecOleCommand(&CGID_MSHTML, IDM_ITALIC); -} - -void CBrowseDlg::OnEditUnderline() -{ - ExecOleCommand(&CGID_MSHTML, IDM_UNDERLINE); -} - -void CBrowseDlg::OnFileExit() -{ - OnClose(); -} - -void CBrowseDlg::OnViewRefresh() -{ - OnReload(); -} - -void CBrowseDlg::OnViewGotoBack() -{ - OnBackward(); -} - -void CBrowseDlg::OnViewGotoForward() -{ - OnForward(); -} - -void CBrowseDlg::OnUpdateViewGotoBack(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_bCanGoBack); -} - -void CBrowseDlg::OnUpdateViewGotoForward(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(m_bCanGoForward); -} - -void CBrowseDlg::OnViewGotoHome() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - webBrowser->GoHome(); - } -} - -void CBrowseDlg::OnEditCopy() -{ - ExecOleCommand(NULL, OLECMDID_COPY); -} - -void CBrowseDlg::OnEditCut() -{ - ExecOleCommand(NULL, OLECMDID_CUT); -} - -void CBrowseDlg::OnEditPaste() -{ - ExecOleCommand(NULL, OLECMDID_PASTE); -} - -void CBrowseDlg::OnEditSelectAll() -{ - ExecOleCommand(NULL, OLECMDID_SELECTALL); -} - -void CBrowseDlg::OnHelpAbout() -{ - AfxMessageBox(_T("CBrowse - Browser Control Test Harness")); -} - -void CBrowseDlg::OnViewViewSource() -{ - ExecOleCommand(&CGID_MSHTML, 3); -} - -void CBrowseDlg::OnFileSaveAs() -{ - ExecOleCommand(NULL, OLECMDID_SAVEAS); -} - -void CBrowseDlg::OnFilePrint() -{ - ExecOleCommand(NULL, OLECMDID_PRINT); -} - -void CBrowseDlg::OnFilePagesetup() -{ - ExecOleCommand(NULL, OLECMDID_PAGESETUP); -} - -void CBrowseDlg::OnDebugVisible() -{ - VARIANT_BOOL visible = VARIANT_TRUE; - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - CIPtr(IWebBrowserApp) cpWebBrowser = webBrowser; - cpWebBrowser->get_Visible(&visible); - cpWebBrowser->put_Visible(visible == VARIANT_TRUE ? VARIANT_FALSE : VARIANT_TRUE); - } -} - -void CBrowseDlg::OnUpdateDebugVisible(CCmdUI* pCmdUI) -{ - VARIANT_BOOL visible = VARIANT_TRUE; - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - CIPtr(IWebBrowserApp) cpWebBrowser = webBrowser; - cpWebBrowser->get_Visible(&visible); - } - - pCmdUI->SetCheck(visible == VARIANT_TRUE ? 1 : 0); -} - -void CBrowseDlg::OnDebugPostDataTest() -{ - CComPtr webBrowser; - if (SUCCEEDED(GetWebBrowser(&webBrowser))) - { - CIPtr(IWebBrowser2) cpWebBrowser = webBrowser; - - CComVariant vURL(L"http://www.mozilla.org/htdig-cgi/htsearch"); - const char *szPostData="config=htdig&restrict=&exclude=&words=embedding&method=and&format=builtin-long"; - - size_t nSize = strlen(szPostData); - SAFEARRAY *psa = SafeArrayCreateVector(VT_UI1, 0, nSize); - - LPSTR pPostData; - SafeArrayAccessData(psa, (LPVOID*) &pPostData); - memcpy(pPostData, szPostData, nSize); - SafeArrayUnaccessData(psa); - - CComVariant vPostData; - vPostData.vt = VT_ARRAY | VT_UI1; - vPostData.parray = psa; - - CComVariant vHeaders(L"Content-Type: application/x-www-form-urlencoded\r\n"); - - cpWebBrowser->Navigate2( - &vURL, - NULL, // Flags - NULL, // Target - &vPostData, - &vHeaders // Headers - ); - } -} - -void CBrowseDlg::OnViewEditmode() -{ - m_bEditMode = m_bEditMode ? FALSE : TRUE; - DWORD nCmdID = m_bEditMode ? IDM_EDITMODE : IDM_BROWSEMODE; - ExecOleCommand(&CGID_MSHTML, nCmdID); - -// if (m_pControlSite) -// { -// m_pControlSite->SetAmbientUserMode((m_btnEditMode.GetCheck() == 0) ? FALSE : TRUE); -// } -} - -void CBrowseDlg::OnViewOpenInNewWindow() -{ - m_bNewWindow = m_bNewWindow ? FALSE : TRUE; -} - -void CBrowseDlg::OnUpdateViewEditmode(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(m_bEditMode ? 1 : 0); -} - -void CBrowseDlg::OnUpdateViewOpenInNewWindow(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(1); //m_bNewWindow ? 1 : 0); -} - diff --git a/embedding/browser/activex/tests/cbrowse/CBrowseDlg.h b/embedding/browser/activex/tests/cbrowse/CBrowseDlg.h deleted file mode 100644 index b1148b8f5c8..00000000000 --- a/embedding/browser/activex/tests/cbrowse/CBrowseDlg.h +++ /dev/null @@ -1,127 +0,0 @@ -// CBrowseDlg.h : header file -// - -#if !defined(AFX_CBROWSEDLG_H__5121F5E6_5324_11D2_93E1_000000000000__INCLUDED_) -#define AFX_CBROWSEDLG_H__5121F5E6_5324_11D2_93E1_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "TabMessages.h" -#include "TabTests.h" -#include "TabDOM.h" - -///////////////////////////////////////////////////////////////////////////// -// CBrowseDlg dialog - -class CBrowseDlg : public CDialog -{ -// Construction -public: - CBrowserCtlSiteInstance *m_pControlSite; - CLSID m_clsid; - BOOL m_bUseCustomPopupMenu; - BOOL m_bUseCustomDropTarget; - CMenu m_menu; - BOOL m_bNewWindow; - BOOL m_bEditMode; - BOOL m_bCanGoBack; - BOOL m_bCanGoForward; - CBrowseDlg(CWnd* pParent = NULL); // standard constructor - - static CBrowseDlg *m_pBrowseDlg; - - HRESULT CreateWebBrowser(); - HRESULT DestroyWebBrowser(); - HRESULT GetWebBrowser(IWebBrowser **pWebBrowser); - - void RunTestSet(TestSet *pTestSet); - TestResult RunTest(Test *pTest); - void UpdateTest(HTREEITEM hItem, TestResult nResult); - void UpdateTestSet(HTREEITEM hItem); - void UpdateURL(); - void OutputString(const TCHAR *szMessage, ...); - void ExecOleCommand(const GUID *pguidGroup, DWORD nCmdId); - -// Dialog Data - //{{AFX_DATA(CBrowseDlg) - enum { IDD = IDD_CBROWSE_DIALOG }; - CButton m_btnStop; - CButton m_btnForward; - CButton m_btnBack; - CComboBox m_cmbURLs; - //}}AFX_DATA - - CToolBar m_EditBar; - CPropertySheet m_dlgPropSheet; - CTabMessages m_TabMessages; - CTabTests m_TabTests; - CTabDOM m_TabDOM; - CImageList m_cImageList; - - void OnRefreshDOM(); - void OnRunTest(); - void PopulateTests(); - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CBrowseDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - HICON m_hIcon; - CString m_szTestURL; - CString m_szTestCGI; - DWORD m_dwCookie; - - // Generated message map functions - //{{AFX_MSG(CBrowseDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnGo(); - afx_msg void OnBackward(); - afx_msg void OnForward(); - afx_msg void OnClose(); - afx_msg void OnDestroy(); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnFileExit(); - afx_msg void OnViewGotoBack(); - afx_msg void OnViewGotoForward(); - afx_msg void OnViewGotoHome(); - afx_msg void OnEditCopy(); - afx_msg void OnEditCut(); - afx_msg void OnEditPaste(); - afx_msg void OnHelpAbout(); - afx_msg void OnUpdateViewGotoBack(CCmdUI* pCmdUI); - afx_msg void OnUpdateViewGotoForward(CCmdUI* pCmdUI); - afx_msg void OnEditSelectAll(); - afx_msg void OnViewRefresh(); - afx_msg void OnViewViewSource(); - afx_msg void OnStop(); - afx_msg void OnFileSaveAs(); - afx_msg void OnFilePrint(); - afx_msg void OnDebugVisible(); - afx_msg void OnUpdateDebugVisible(CCmdUI* pCmdUI); - afx_msg void OnDebugPostDataTest(); - afx_msg void OnReload(); - afx_msg void OnViewEditmode(); - afx_msg void OnViewOpenInNewWindow(); - afx_msg void OnUpdateViewEditmode(CCmdUI* pCmdUI); - afx_msg void OnUpdateViewOpenInNewWindow(CCmdUI* pCmdUI); - afx_msg void OnFilePagesetup(); - //}}AFX_MSG - afx_msg void OnEditBold(); - afx_msg void OnEditItalic(); - afx_msg void OnEditUnderline(); - - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_CBROWSEDLG_H__5121F5E6_5324_11D2_93E1_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.cpp b/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.cpp deleted file mode 100644 index ab150087944..00000000000 --- a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.cpp +++ /dev/null @@ -1,172 +0,0 @@ -// CBrowserCtlSite.cpp : Implementation of CBrowserCtlSite -#include "stdafx.h" -#include "Cbrowse.h" -#include "CBrowserCtlSite.h" - -#include -#include - -///////////////////////////////////////////////////////////////////////////// -// CBrowserCtlSite - -CBrowserCtlSite::CBrowserCtlSite() -{ - m_bUseCustomPopupMenu = TRUE; - m_bUseCustomDropTarget = FALSE; -} - -static void _InsertMenuItem(HMENU hmenu, int nPos, int nID, const TCHAR *szItemText) -{ - MENUITEMINFO mii; - memset(&mii, 0, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_TYPE; - mii.fType = MFT_STRING; - mii.fState = MFS_ENABLED; - mii.dwTypeData = (LPTSTR) szItemText; - mii.cch = _tcslen(szItemText); - InsertMenuItem(hmenu, nPos, TRUE, &mii); -} - -static void _InsertMenuSeparator(HMENU hmenu, int nPos) -{ - MENUITEMINFO mii; - memset(&mii, 0, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_TYPE; - mii.fType = MFT_SEPARATOR; - mii.fState = MFS_ENABLED; - InsertMenuItem(hmenu, nPos, TRUE, &mii); -} - -///////////////////////////////////////////////////////////////////////////// -// IDocHostUIHandler - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::ShowContextMenu(/* [in] */ DWORD dwID, /* [in] */ POINT __RPC_FAR *ppt, /* [in] */ IUnknown __RPC_FAR *pcmdtReserved, /* [in] */ IDispatch __RPC_FAR *pdispReserved) -{ - if (m_bUseCustomPopupMenu) - { - tstring szMenuText(_T("Unknown context")); - HMENU hmenu = CreatePopupMenu(); - _InsertMenuItem(hmenu, 0, 1, _T("CBrowse context popup")); - _InsertMenuSeparator(hmenu, 1); - switch (dwID) - { - case CONTEXT_MENU_DEFAULT: - szMenuText = _T("Default context"); - break; - case CONTEXT_MENU_IMAGE: - szMenuText = _T("Image context"); - break; - case CONTEXT_MENU_CONTROL: - szMenuText = _T("Control context"); - break; - case CONTEXT_MENU_TABLE: - szMenuText = _T("Table context"); - break; - case CONTEXT_MENU_TEXTSELECT: - szMenuText = _T("TextSelect context"); - break; - case CONTEXT_MENU_ANCHOR: - szMenuText = _T("Anchor context"); - break; - case CONTEXT_MENU_UNKNOWN: - szMenuText = _T("Unknown context"); - break; - } - - _InsertMenuItem(hmenu, 2, 2, szMenuText.c_str()); - - POINT pt; - GetCursorPos(&pt); - TrackPopupMenu(hmenu, TPM_RETURNCMD, pt.x, pt.y, 0, AfxGetMainWnd()->GetSafeHwnd(), NULL); - DestroyMenu(hmenu); - return S_OK; - } - return S_FALSE; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::GetHostInfo(/* [out][in] */ DOCHOSTUIINFO __RPC_FAR *pInfo) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::ShowUI(/* [in] */ DWORD dwID, /* [in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [in] */ IOleCommandTarget __RPC_FAR *pCommandTarget, /* [in] */ IOleInPlaceFrame __RPC_FAR *pFrame, /* [in] */ IOleInPlaceUIWindow __RPC_FAR *pDoc) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::HideUI(void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::UpdateUI(void) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::EnableModeless(/* [in] */ BOOL fEnable) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::OnDocWindowActivate(/* [in] */ BOOL fActivate) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::OnFrameWindowActivate(/* [in] */ BOOL fActivate) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::ResizeBorder(/* [in] */ LPCRECT prcBorder, /* [in] */ IOleInPlaceUIWindow __RPC_FAR *pUIWindow, /* [in] */ BOOL fRameWindow) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::TranslateAccelerator(/* [in] */ LPMSG lpMsg, /* [in] */ const GUID __RPC_FAR *pguidCmdGroup, /* [in] */ DWORD nCmdID) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::GetOptionKeyPath(/* [out] */ LPOLESTR __RPC_FAR *pchKey, /* [in] */ DWORD dw) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::GetDropTarget(/* [in] */ IDropTarget __RPC_FAR *pDropTarget, /* [out] */ IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::GetExternal(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDispatch) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::TranslateUrl(/* [in] */ DWORD dwTranslate, /* [in] */ OLECHAR __RPC_FAR *pchURLIn, /* [out] */ OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::FilterDataObject(/* [in] */ IDataObject __RPC_FAR *pDO, /* [out] */ IDataObject __RPC_FAR *__RPC_FAR *ppDORet) -{ - return E_NOTIMPL; -} - - -/////////////////////////////////////////////////////////////////////////////// -// IDocHostShowUI - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::ShowMessage(/* [in] */ HWND hwnd, /* [in] */ LPOLESTR lpstrText, /* [in] */ LPOLESTR lpstrCaption, /* [in] */ DWORD dwType, /* [in] */ LPOLESTR lpstrHelpFile, /* [in] */ DWORD dwHelpContext,/* [out] */ LRESULT __RPC_FAR *plResult) -{ - return S_FALSE; -} - -HRESULT STDMETHODCALLTYPE CBrowserCtlSite::ShowHelp(/* [in] */ HWND hwnd, /* [in] */ LPOLESTR pszHelpFile, /* [in] */ UINT uCommand, /* [in] */ DWORD dwData, /* [in] */ POINT ptMouse, /* [out] */ IDispatch __RPC_FAR *pDispatchObjectHit) -{ - return S_FALSE; -} - diff --git a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.h b/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.h deleted file mode 100644 index f4b911e2fd7..00000000000 --- a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.h +++ /dev/null @@ -1,56 +0,0 @@ -// CBrowserCtlSite.h : Declaration of the CBrowserCtlSite - -#ifndef __CBROWSERCTLSITE_H_ -#define __CBROWSERCTLSITE_H_ - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CBrowserCtlSite -class ATL_NO_VTABLE CBrowserCtlSite : - public CControlSite, - public IDocHostUIHandler, - public IDocHostShowUI -{ -public: - CBrowserCtlSite(); - -DECLARE_REGISTRY_RESOURCEID(IDR_CBROWSERCTLSITE) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CBrowserCtlSite) - CCONTROLSITE_INTERFACES() - COM_INTERFACE_ENTRY(IDocHostUIHandler) - COM_INTERFACE_ENTRY(IDocHostShowUI) -END_COM_MAP() - - BOOL m_bUseCustomPopupMenu; - BOOL m_bUseCustomDropTarget; - -public: -// IDocHostUIHandler - virtual HRESULT STDMETHODCALLTYPE ShowContextMenu(/* [in] */ DWORD dwID, /* [in] */ POINT __RPC_FAR *ppt, /* [in] */ IUnknown __RPC_FAR *pcmdtReserved, /* [in] */ IDispatch __RPC_FAR *pdispReserved); - virtual HRESULT STDMETHODCALLTYPE GetHostInfo(/* [out][in] */ DOCHOSTUIINFO __RPC_FAR *pInfo); - virtual HRESULT STDMETHODCALLTYPE ShowUI(/* [in] */ DWORD dwID, /* [in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, /* [in] */ IOleCommandTarget __RPC_FAR *pCommandTarget, /* [in] */ IOleInPlaceFrame __RPC_FAR *pFrame, /* [in] */ IOleInPlaceUIWindow __RPC_FAR *pDoc); - virtual HRESULT STDMETHODCALLTYPE HideUI(void); - virtual HRESULT STDMETHODCALLTYPE UpdateUI(void); - virtual HRESULT STDMETHODCALLTYPE EnableModeless(/* [in] */ BOOL fEnable); - virtual HRESULT STDMETHODCALLTYPE OnDocWindowActivate(/* [in] */ BOOL fActivate); - virtual HRESULT STDMETHODCALLTYPE OnFrameWindowActivate(/* [in] */ BOOL fActivate); - virtual HRESULT STDMETHODCALLTYPE ResizeBorder(/* [in] */ LPCRECT prcBorder, /* [in] */ IOleInPlaceUIWindow __RPC_FAR *pUIWindow, /* [in] */ BOOL fRameWindow); - virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(/* [in] */ LPMSG lpMsg, /* [in] */ const GUID __RPC_FAR *pguidCmdGroup, /* [in] */ DWORD nCmdID); - virtual HRESULT STDMETHODCALLTYPE GetOptionKeyPath(/* [out] */ LPOLESTR __RPC_FAR *pchKey, /* [in] */ DWORD dw); - virtual HRESULT STDMETHODCALLTYPE GetDropTarget(/* [in] */ IDropTarget __RPC_FAR *pDropTarget, /* [out] */ IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget); - virtual HRESULT STDMETHODCALLTYPE GetExternal(/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDispatch); - virtual HRESULT STDMETHODCALLTYPE TranslateUrl(/* [in] */ DWORD dwTranslate, /* [in] */ OLECHAR __RPC_FAR *pchURLIn, /* [out] */ OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut); - virtual HRESULT STDMETHODCALLTYPE FilterDataObject(/* [in] */ IDataObject __RPC_FAR *pDO, /* [out] */ IDataObject __RPC_FAR *__RPC_FAR *ppDORet); - -// IDocHostShowUI - virtual HRESULT STDMETHODCALLTYPE ShowMessage(/* [in] */ HWND hwnd, /* [in] */ LPOLESTR lpstrText, /* [in] */ LPOLESTR lpstrCaption, /* [in] */ DWORD dwType, /* [in] */ LPOLESTR lpstrHelpFile, /* [in] */ DWORD dwHelpContext,/* [out] */ LRESULT __RPC_FAR *plResult); - virtual HRESULT STDMETHODCALLTYPE ShowHelp(/* [in] */ HWND hwnd, /* [in] */ LPOLESTR pszHelpFile, /* [in] */ UINT uCommand, /* [in] */ DWORD dwData, /* [in] */ POINT ptMouse, /* [out] */ IDispatch __RPC_FAR *pDispatchObjectHit); -}; - -typedef CComObject CBrowserCtlSiteInstance; - -#endif //__CBROWSERCTLSITE_H_ diff --git a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.rgs b/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.rgs deleted file mode 100644 index 1e1f11f1d40..00000000000 --- a/embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.rgs +++ /dev/null @@ -1,24 +0,0 @@ -HKCR -{ - Cbrowse.CBrowserCtlSite.1 = s 'CBrowserCtlSite Class' - { - CLSID = s '{8EC06081-21DE-11D3-941E-000000000000}' - } - Cbrowse.CBrowserCtlSite = s 'CBrowserCtlSite Class' - { - CLSID = s '{8EC06081-21DE-11D3-941E-000000000000}' - CurVer = s 'Cbrowse.CBrowserCtlSite.1' - } - NoRemove CLSID - { - ForceRemove {8EC06081-21DE-11D3-941E-000000000000} = s 'CBrowserCtlSite Class' - { - ProgID = s 'Cbrowse.CBrowserCtlSite.1' - VersionIndependentProgID = s 'Cbrowse.CBrowserCtlSite' - ForceRemove 'Programmable' - LocalServer32 = s '%MODULE%' - val AppID = s '{5B209214-F756-11D2-A27F-000000000000}' - 'TypeLib' = s '{5B209213-F756-11D2-A27F-000000000000}' - } - } -} diff --git a/embedding/browser/activex/tests/cbrowse/Cbrowse.idl b/embedding/browser/activex/tests/cbrowse/Cbrowse.idl deleted file mode 100644 index e5317514209..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Cbrowse.idl +++ /dev/null @@ -1,64 +0,0 @@ -// Cbrowse.idl : IDL source for Cbrowse.exe - -import "oaidl.idl"; - -typedef enum -{ - trNotRun, - trFailed, - trPassed, - trPartial -} TestResult; - -[ - object, - uuid(95AF1AB1-FA66-11D2-A284-000000000000), - dual, - helpstring("DITestScriptHelper Interface"), - pointer_default(unique) -] -interface DITestScriptHelper : IDispatch -{ - [id(1), helpstring("method OutputString")] HRESULT OutputString(BSTR bstrMessage); - [propget, id(2), helpstring("property WebBrowser")] HRESULT WebBrowser([out, retval] LPDISPATCH *pVal); - [propput, id(3), helpstring("property Result")] HRESULT Result([in] TestResult newVal); - [propget, id(4), helpstring("property TestURL")] HRESULT TestURL([out, retval] BSTR *pVal); - [propget, id(5), helpstring("property TestCGI")] HRESULT TestCGI([out, retval] BSTR *pVal); -}; - -[ - uuid(5B209213-F756-11D2-A27F-000000000000), - version(1.0), - helpstring("Cbrowse 1.0 Type Library") -] -library CbrowseLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - [ - uuid(95AF1AB2-FA66-11D2-A284-000000000000), - helpstring("TestScriptHelper Class") - ] - coclass TestScriptHelper - { - [default] interface DITestScriptHelper; - }; - [ - uuid(31204F42-FCE8-11D2-A289-000000000000), - helpstring("ControlEventSink Class") - ] - coclass ControlEventSink - { - [default] interface IDispatch; - }; - [ - uuid(8EC06081-21DE-11D3-941E-000000000000), - helpstring("CBrowserCtlSite Class") - ] - coclass CBrowserCtlSite - { - [default] interface IUnknown; - }; -}; - - \ No newline at end of file diff --git a/embedding/browser/activex/tests/cbrowse/Cbrowse.rgs b/embedding/browser/activex/tests/cbrowse/Cbrowse.rgs deleted file mode 100644 index e3325c9c8e3..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Cbrowse.rgs +++ /dev/null @@ -1,11 +0,0 @@ -HKCR -{ - NoRemove AppID - { - {5B209214-F756-11D2-A27F-000000000000} = s 'Cbrowse' - 'Cbrowse.EXE' - { - val AppID = s {5B209214-F756-11D2-A27F-000000000000} - } - } -} diff --git a/embedding/browser/activex/tests/cbrowse/ControlEventSink.cpp b/embedding/browser/activex/tests/cbrowse/ControlEventSink.cpp deleted file mode 100644 index 1139eaecf5a..00000000000 --- a/embedding/browser/activex/tests/cbrowse/ControlEventSink.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// ControlEventSink.cpp : Implementation of CBrowseEventSink -#include "stdafx.h" -#include "Cbrowse.h" -#include "ControlEventSink.h" - -///////////////////////////////////////////////////////////////////////////// -// CBrowseEventSink - -HRESULT STDMETHODCALLTYPE CBrowseEventSink::GetTypeInfoCount( - /* [out] */ UINT __RPC_FAR *pctinfo) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowseEventSink::GetTypeInfo( - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowseEventSink::GetIDsOfNames( - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID __RPC_FAR *rgDispId) -{ - return E_NOTIMPL; -} - -HRESULT STDMETHODCALLTYPE CBrowseEventSink:: Invoke( - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, - /* [out] */ VARIANT __RPC_FAR *pVarResult, - /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, - /* [out] */ UINT __RPC_FAR *puArgErr) -{ - CString szEvent; - - switch (dispIdMember) - { - case 0x66: - { - USES_CONVERSION; - CString szText(OLE2T(pDispParams->rgvarg[0].bstrVal)); - szEvent.Format(_T("StatusTextChange: \"%s\""), szText); - m_pBrowseDlg->m_TabMessages.m_szStatus = szText; - m_pBrowseDlg->m_TabMessages.UpdateData(FALSE); - } - break; - case 0x6c: - { - LONG nProgress = pDispParams->rgvarg[1].lVal; - LONG nProgressMax = pDispParams->rgvarg[0].lVal; - szEvent.Format("ProgressChange(%d of %d)", nProgress, nProgressMax); - CProgressCtrl &pc = m_pBrowseDlg->m_TabMessages.m_pcProgress; - pc.SetRange(0, nProgressMax); - pc.SetPos(nProgress); - } - break; - case 0x69: - { - BOOL enable = pDispParams->rgvarg[0].boolVal == VARIANT_TRUE ? TRUE : FALSE; - LONG commandState = pDispParams->rgvarg[1].lVal; - if (commandState == CSC_NAVIGATEBACK) - { - m_pBrowseDlg->m_bCanGoBack = enable; - m_pBrowseDlg->m_btnBack.EnableWindow(enable); - } - else if (commandState == CSC_NAVIGATEFORWARD) - { - m_pBrowseDlg->m_bCanGoForward = enable; - m_pBrowseDlg->m_btnForward.EnableWindow(enable); - } - szEvent.Format(_T("CommandStateChange(%ld, %d)"), commandState, enable); - } - break; - case 0x6a: - szEvent = _T("DownloadBegin"); - m_pBrowseDlg->m_btnStop.EnableWindow(TRUE); - break; - case 0x68: - szEvent = _T("DownloadComplete"); - m_pBrowseDlg->m_btnStop.EnableWindow(FALSE); - break; - case 0x71: - { - USES_CONVERSION; - CString szText(OLE2T(pDispParams->rgvarg[0].bstrVal)); - szEvent.Format(_T("TitleChange: \"%s\""), szText); - CString szTitle; - szTitle.Format(_T("CBrowse - %s"), szText); - m_pBrowseDlg->SetWindowText(szTitle); - } - break; - case 0x70: - szEvent = _T("PropertyChange"); - break; - case 0xfa: - szEvent = _T("BeforeNavigate2"); - break; - case 0xfb: - { - szEvent = _T("NewWindow2"); - - VARIANTARG *pvars = pDispParams->rgvarg; - CBrowseDlg *pDlg = new CBrowseDlg; - if (pDlg) - { - pDlg->m_clsid = m_pBrowseDlg->m_clsid; - pDlg->Create(IDD_CBROWSE_DIALOG); - - if (pDlg->m_pControlSite) - { - CIUnkPtr spUnkBrowser; - pDlg->m_pControlSite->GetControlUnknown(&spUnkBrowser); - - pvars[0].byref = (void *) VARIANT_FALSE; - spUnkBrowser->QueryInterface(IID_IDispatch, (void **) pvars[1].byref); - } - } - } - break; - case 0xfc: - szEvent = _T("NavigateComplete2"); - break; - case 0x103: - szEvent = _T("DocumentComplete"); - if (m_pBrowseDlg) - { - m_pBrowseDlg->UpdateURL(); - } - break; - case 0xfd: - szEvent = _T("OnQuit"); - break; - case 0xfe: - szEvent = _T("OnVisible"); - break; - case 0xff: - szEvent = _T("OnToolBar"); - break; - case 0x100: - szEvent = _T("OnMenuBar"); - break; - case 0x101: - szEvent = _T("OnStatusBar"); - break; - case 0x102: - szEvent = _T("OnFullScreen"); - break; - case 0x104: - szEvent = _T("OnTheaterMode"); - break; - default: - szEvent.Format(_T("%d"), dispIdMember); - } - - if (m_pBrowseDlg) - { - m_pBrowseDlg->OutputString(_T("Event %s"), szEvent); - } - return S_OK; -} diff --git a/embedding/browser/activex/tests/cbrowse/ControlEventSink.h b/embedding/browser/activex/tests/cbrowse/ControlEventSink.h deleted file mode 100644 index 648c37e4bf1..00000000000 --- a/embedding/browser/activex/tests/cbrowse/ControlEventSink.h +++ /dev/null @@ -1,60 +0,0 @@ -// ControlEventSink.h : Declaration of the CBrowseEventSink - -#ifndef __CONTROLEVENTSINK_H_ -#define __CONTROLEVENTSINK_H_ - -#include "CBrowseDlg.h" -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CBrowseEventSink -class ATL_NO_VTABLE CBrowseEventSink : - public CComObjectRootEx, - public CComCoClass, - public IDispatch -{ -public: - CBrowseEventSink() - { - m_pBrowseDlg = NULL; - } - - CBrowseDlg *m_pBrowseDlg; - -DECLARE_REGISTRY_RESOURCEID(IDR_CONTROLEVENTSINK) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CBrowseEventSink) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, IDispatch) -END_COM_MAP() - -// IDispatch -public: - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( - /* [out] */ UINT __RPC_FAR *pctinfo); - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke( - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, - /* [out] */ VARIANT __RPC_FAR *pVarResult, - /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, - /* [out] */ UINT __RPC_FAR *puArgErr); -}; - -typedef CComObject CBrowseEventSinkInstance; - -#endif //__CONTROLEVENTSINK_H_ diff --git a/embedding/browser/activex/tests/cbrowse/ControlEventSink.rgs b/embedding/browser/activex/tests/cbrowse/ControlEventSink.rgs deleted file mode 100644 index b6504637115..00000000000 --- a/embedding/browser/activex/tests/cbrowse/ControlEventSink.rgs +++ /dev/null @@ -1,24 +0,0 @@ -HKCR -{ - Cbrowse.ControlEventSink.1 = s 'ControlEventSink Class' - { - CLSID = s '{31204F42-FCE8-11D2-A289-000000000000}' - } - Cbrowse.ControlEventSink = s 'ControlEventSink Class' - { - CLSID = s '{31204F42-FCE8-11D2-A289-000000000000}' - CurVer = s 'Cbrowse.ControlEventSink.1' - } - NoRemove CLSID - { - ForceRemove {31204F42-FCE8-11D2-A289-000000000000} = s 'ControlEventSink Class' - { - ProgID = s 'Cbrowse.ControlEventSink.1' - VersionIndependentProgID = s 'Cbrowse.ControlEventSink' - ForceRemove 'Programmable' - LocalServer32 = s '%MODULE%' - val AppID = s '{5B209214-F756-11D2-A27F-000000000000}' - 'TypeLib' = s '{5B209213-F756-11D2-A27F-000000000000}' - } - } -} diff --git a/embedding/browser/activex/tests/cbrowse/EditToolBar.cpp b/embedding/browser/activex/tests/cbrowse/EditToolBar.cpp deleted file mode 100644 index 7bfafcaab42..00000000000 --- a/embedding/browser/activex/tests/cbrowse/EditToolBar.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// EditToolBar.cpp : implementation file -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "EditToolBar.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CEditToolBar - -CEditToolBar::CEditToolBar() -{ -} - -CEditToolBar::~CEditToolBar() -{ -} - - -BEGIN_MESSAGE_MAP(CEditToolBar, CToolBarCtrl) - //{{AFX_MSG_MAP(CEditToolBar) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CEditToolBar message handlers diff --git a/embedding/browser/activex/tests/cbrowse/EditToolBar.h b/embedding/browser/activex/tests/cbrowse/EditToolBar.h deleted file mode 100644 index 06de03dd395..00000000000 --- a/embedding/browser/activex/tests/cbrowse/EditToolBar.h +++ /dev/null @@ -1,48 +0,0 @@ -#if !defined(AFX_EDITTOOLBAR_H__39B3B0A1_5412_11D3_9441_000000000000__INCLUDED_) -#define AFX_EDITTOOLBAR_H__39B3B0A1_5412_11D3_9441_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// EditToolBar.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CEditToolBar window - -class CEditToolBar : public CToolBarCtrl -{ -// Construction -public: - CEditToolBar(); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CEditToolBar) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CEditToolBar(); - - // Generated message map functions -protected: - //{{AFX_MSG(CEditToolBar) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_EDITTOOLBAR_H__39B3B0A1_5412_11D3_9441_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/Html/main.htm b/embedding/browser/activex/tests/cbrowse/Html/main.htm deleted file mode 100644 index 825ae19eb44..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Html/main.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - -This is the main test page for the Mozilla control - - - - -

This is the main test page for the Mozilla control

-

Try out some links:

-

http://www.yahoo.com

-

http://www.netscape.com

-

http://www.excite.com

-

http://www.mozilla.org

-

How about a nice form to test out the PostData value in BeforeNavigate2?

-

Ok then! An Altavista Search -

-
- - - - -
-

 

-

 

- - - - diff --git a/embedding/browser/activex/tests/cbrowse/PickerDlg.cpp b/embedding/browser/activex/tests/cbrowse/PickerDlg.cpp deleted file mode 100644 index 6c0f7d42045..00000000000 --- a/embedding/browser/activex/tests/cbrowse/PickerDlg.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// PickerDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "PickerDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -// CLSIDs for the Mozilla and IE browser controls - -static const CLSID CLSID_Mozilla = -{ 0x1339B54C, 0x3453, 0x11D2, { 0x93, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; - -// XX is a hack to avoid linker errors with some Platform SDKs defining -// a GUID with the same name -static const CLSID CLSID_XXInternetExplorer = -{ 0x8856F961, 0x340A, 0x11D0, { 0xA9, 0x6B, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2 } }; - -static const CLSID CLSID_MSHTML = -{ 0x2D360200, 0xFFF5, 0x11D1, { 0x8D, 0x03, 0x00, 0xA0, 0xC9, 0x59, 0xBC, 0x0A } }; - -struct BrowserControl -{ - TCHAR *szName; - const CLSID *clsid; -}; - -BrowserControl aControls[] = -{ - { _T("Mozilla Control"), &CLSID_Mozilla }, - { _T("Internet Explorer Control"), &CLSID_XXInternetExplorer } -}; - - -///////////////////////////////////////////////////////////////////////////// -// CPickerDlg dialog - - -CPickerDlg::CPickerDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPickerDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CPickerDlg) - m_szTestURL = _T(""); - m_szTestCGI = _T(""); - m_bDebugging = FALSE; - m_sDebugFlags = _T(""); - m_bUseCustom = FALSE; - //}}AFX_DATA_INIT - m_clsid = CLSID_NULL; - - CWinApp *pApp = AfxGetApp(); - m_szTestURL = pApp->GetProfileString(SECTION_TEST, KEY_TESTURL, KEY_TESTURL_DEFAULTVALUE); - m_szTestCGI = pApp->GetProfileString(SECTION_TEST, KEY_TESTCGI, KEY_TESTCGI_DEFAULTVALUE); - m_sDebugFlags = _T("NSPR_LOG_MODULES=nsComponentManager:5"); -} - -void CPickerDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPickerDlg) - DDX_Control(pDX, IDC_LISTBROWSER, m_lbPicker); - DDX_Text(pDX, IDC_TESTURL, m_szTestURL); - DDX_Text(pDX, IDC_TESTCGI, m_szTestCGI); - DDX_Check(pDX, IDC_CHECK1, m_bDebugging); - DDX_Text(pDX, IDC_EDIT1, m_sDebugFlags); - DDX_Check(pDX, IDC_OVERRIDE, m_bUseCustom); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CPickerDlg, CDialog) - //{{AFX_MSG_MAP(CPickerDlg) - ON_BN_CLICKED(IDOK, OnOk) - ON_LBN_DBLCLK(IDC_LISTBROWSER, OnDblclkListbrowser) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPickerDlg message handlers - -BOOL CPickerDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - for (int i = 0; i < sizeof(aControls) / sizeof(aControls[0]); i++) - { - m_lbPicker.AddString(aControls[i].szName); - } - m_lbPicker.SetCurSel(0); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - - -void CPickerDlg::OnOk() -{ - UpdateData(); - - int nItem = m_lbPicker.GetCurSel(); - if (nItem == LB_ERR) - { - AfxMessageBox(IDS_CHOOSEBROWSER); - return; - } - - m_clsid = *aControls[nItem].clsid; - - CWinApp *pApp = AfxGetApp(); - pApp->WriteProfileString(SECTION_TEST, KEY_TESTURL, m_szTestURL); - pApp->WriteProfileString(SECTION_TEST, KEY_TESTCGI, m_szTestCGI); - - if (m_bDebugging) - { - putenv("NSPR_LOG_FILE=.\\mozilla.log"); - putenv(m_sDebugFlags); - } - - EndDialog(IDOK); -} - - -void CPickerDlg::OnDblclkListbrowser() -{ - OnOk(); -} diff --git a/embedding/browser/activex/tests/cbrowse/PickerDlg.h b/embedding/browser/activex/tests/cbrowse/PickerDlg.h deleted file mode 100644 index 36663e2b262..00000000000 --- a/embedding/browser/activex/tests/cbrowse/PickerDlg.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_PICKERDLG_H__648FC652_D34B_11D2_A255_000000000000__INCLUDED_) -#define AFX_PICKERDLG_H__648FC652_D34B_11D2_A255_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PickerDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPickerDlg dialog - -class CPickerDlg : public CDialog -{ -// Construction -public: - CPickerDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPickerDlg) - enum { IDD = IDD_PICKBROWSER }; - CListBox m_lbPicker; - CString m_szTestURL; - CString m_szTestCGI; - BOOL m_bDebugging; - CString m_sDebugFlags; - BOOL m_bUseCustom; - //}}AFX_DATA - - CLSID m_clsid; - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPickerDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CPickerDlg) - afx_msg void OnOk(); - virtual BOOL OnInitDialog(); - afx_msg void OnDblclkListbrowser(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PICKERDLG_H__648FC652_D34B_11D2_A255_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/Scripts/Basic.vbs b/embedding/browser/activex/tests/cbrowse/Scripts/Basic.vbs deleted file mode 100644 index 4b722c11997..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Scripts/Basic.vbs +++ /dev/null @@ -1,4 +0,0 @@ -' A simple test just to prove things are sane - -OutputString "Simple Navigation Test" -WebBrowser.Navigate TestURL diff --git a/embedding/browser/activex/tests/cbrowse/Scripts/NewWindow.vbs b/embedding/browser/activex/tests/cbrowse/Scripts/NewWindow.vbs deleted file mode 100644 index 69e4ddb8068..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Scripts/NewWindow.vbs +++ /dev/null @@ -1,4 +0,0 @@ -' Opens a new window - -OutputString "Navigate in new window" -WebBrowser.Navigate TestURL, 1 diff --git a/embedding/browser/activex/tests/cbrowse/Scripts/Post.vbs b/embedding/browser/activex/tests/cbrowse/Scripts/Post.vbs deleted file mode 100644 index 80d77dcf8c1..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Scripts/Post.vbs +++ /dev/null @@ -1,6 +0,0 @@ -' Opens a URL and POST data - - -sPostData = "name1=value1" -OutputString "CGI script POST test to URL " + TestCGI + sPostData -WebBrowser.Navigate TestCGI, 0, , sPostData diff --git a/embedding/browser/activex/tests/cbrowse/StdAfx.cpp b/embedding/browser/activex/tests/cbrowse/StdAfx.cpp deleted file mode 100644 index d1706d0e211..00000000000 --- a/embedding/browser/activex/tests/cbrowse/StdAfx.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// cbrowse.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -#ifdef _ATL_STATIC_REGISTRY -#include -#endif -#include -#include -#include - diff --git a/embedding/browser/activex/tests/cbrowse/StdAfx.h b/embedding/browser/activex/tests/cbrowse/StdAfx.h deleted file mode 100644 index aa2d85c9b47..00000000000 --- a/embedding/browser/activex/tests/cbrowse/StdAfx.h +++ /dev/null @@ -1,78 +0,0 @@ -// 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__5121F5E8_5324_11D2_93E1_000000000000__INCLUDED_) -#define AFX_STDAFX_H__5121F5E8_5324_11D2_93E1_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - -#include // MFC core and standard components -#include // MFC extensions -#include // MFC OLE automation classes -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - -#define _ATL_APARTMENT_THREADED -#define _ATL_DEBUG_INTERFACES - -// ATL headers -#include - -class CBrowseModule : public CComModule -{ -public: - DWORD dwThreadID; - - LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2); - virtual LONG Unlock(); - virtual LONG Lock(); -}; - -extern CBrowseModule _Module; - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "..\..\src\control\ActiveXTypes.h" -#include "..\..\src\control\BrowserDiagnostics.h" -#include "..\..\src\control\ActiveScriptSite.h" - -#include "..\..\src\common\PropertyList.h" -#include "..\..\src\common\PropertyBag.h" -#include "..\..\src\common\ControlSiteIPFrame.h" -#include "..\..\src\common\ControlSite.h" - -#include "CBrowserCtlSite.h" -#include "Tests.h" - -#define SECTION_TEST _T("Test") -#define KEY_TESTURL _T("TestURL") -#define KEY_TESTCGI _T("TestCGI") -#define KEY_TESTURL_DEFAULTVALUE _T("http://www.mozilla.org") -#define KEY_TESTCGI_DEFAULTVALUE _T("http://www.mozilla.org") - -#define NS_ASSERTION(x,y) -#define TRACE_METHOD(x) - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__5121F5E8_5324_11D2_93E1_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/TabDOM.cpp b/embedding/browser/activex/tests/cbrowse/TabDOM.cpp deleted file mode 100644 index efd6a25b3e0..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabDOM.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// TabDOM.cpp : implementation file -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "TabDOM.h" -#include "CBrowseDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTabDOM property page - -IMPLEMENT_DYNCREATE(CTabDOM, CPropertyPage) - -CTabDOM::CTabDOM() : CPropertyPage(CTabDOM::IDD, CTabDOM::IDD) -{ - //{{AFX_DATA_INIT(CTabDOM) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -CTabDOM::~CTabDOM() -{ -} - - -void CTabDOM::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CTabDOM) - DDX_Control(pDX, IDC_DOMLIST, m_tcDOM); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CTabDOM, CPropertyPage) - //{{AFX_MSG_MAP(CTabDOM) - ON_BN_CLICKED(IDC_REFRESHDOM, OnRefreshDOM) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CTabDOM message handlers - -void CTabDOM::OnRefreshDOM() -{ - if (m_pBrowseDlg) - { - m_pBrowseDlg->OnRefreshDOM(); - } -} - - -BOOL CTabDOM::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - // Create the DOM tree - m_tcDOM.SetImageList(&m_pBrowseDlg->m_cImageList, TVSIL_NORMAL); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} diff --git a/embedding/browser/activex/tests/cbrowse/TabDOM.h b/embedding/browser/activex/tests/cbrowse/TabDOM.h deleted file mode 100644 index ed301d22553..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabDOM.h +++ /dev/null @@ -1,54 +0,0 @@ -#if !defined(AFX_TABDOM_H__5216DE08_12D4_11D3_9407_000000000000__INCLUDED_) -#define AFX_TABDOM_H__5216DE08_12D4_11D3_9407_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// TabDOM.h : header file -// - -class CBrowseDlg; - -///////////////////////////////////////////////////////////////////////////// -// CTabDOM dialog - -class CTabDOM : public CPropertyPage -{ - DECLARE_DYNCREATE(CTabDOM) - -// Construction -public: - CTabDOM(); - ~CTabDOM(); - - CBrowseDlg *m_pBrowseDlg; - -// Dialog Data - //{{AFX_DATA(CTabDOM) - enum { IDD = IDD_TAB_DOM }; - CTreeCtrl m_tcDOM; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CTabDOM) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CTabDOM) - afx_msg void OnRefreshDOM(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TABDOM_H__5216DE08_12D4_11D3_9407_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/TabMessages.cpp b/embedding/browser/activex/tests/cbrowse/TabMessages.cpp deleted file mode 100644 index ae72388141b..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabMessages.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// TabMessages.cpp : implementation file -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "TabMessages.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTabMessages property page - -IMPLEMENT_DYNCREATE(CTabMessages, CPropertyPage) - -CTabMessages::CTabMessages() : CPropertyPage(CTabMessages::IDD, CTabMessages::IDD) -{ - //{{AFX_DATA_INIT(CTabMessages) - m_szStatus = _T(""); - //}}AFX_DATA_INIT -} - - -CTabMessages::~CTabMessages() -{ -} - - -void CTabMessages::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CTabMessages) - DDX_Control(pDX, IDC_PROGRESS, m_pcProgress); - DDX_Control(pDX, IDC_OUTPUT, m_lbMessages); - DDX_Text(pDX, IDC_STATUS, m_szStatus); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CTabMessages, CPropertyPage) - //{{AFX_MSG_MAP(CTabMessages) - // NOTE: the ClassWizard will add message map macros here - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CTabMessages message handlers diff --git a/embedding/browser/activex/tests/cbrowse/TabMessages.h b/embedding/browser/activex/tests/cbrowse/TabMessages.h deleted file mode 100644 index 629401ef94a..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabMessages.h +++ /dev/null @@ -1,55 +0,0 @@ -#if !defined(AFX_TABMESSAGES_H__33D0A350_12E1_11D3_9407_000000000000__INCLUDED_) -#define AFX_TABMESSAGES_H__33D0A350_12E1_11D3_9407_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// TabMessages.h : header file -// - -class CBrowseDlg; - -///////////////////////////////////////////////////////////////////////////// -// CTabMessages dialog - -class CTabMessages : public CPropertyPage -{ - DECLARE_DYNCREATE(CTabMessages) - -// Construction -public: - CTabMessages(); - ~CTabMessages(); - - CBrowseDlg *m_pBrowseDlg; - -// Dialog Data - //{{AFX_DATA(CTabMessages) - enum { IDD = IDD_TAB_MESSAGES }; - CProgressCtrl m_pcProgress; - CListBox m_lbMessages; - CString m_szStatus; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CTabMessages) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CTabMessages) - // NOTE: the ClassWizard will add member functions here - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TABMESSAGES_H__33D0A350_12E1_11D3_9407_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/TabTests.cpp b/embedding/browser/activex/tests/cbrowse/TabTests.cpp deleted file mode 100644 index 4f1e355075e..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabTests.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// TabTests.cpp : implementation file -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "TabTests.h" -#include "CBrowseDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTabTests property page - -IMPLEMENT_DYNCREATE(CTabTests, CPropertyPage) - -CTabTests::CTabTests() : CPropertyPage(CTabTests::IDD, CTabTests::IDD) -{ - //{{AFX_DATA_INIT(CTabTests) - m_szTestDescription = _T(""); - //}}AFX_DATA_INIT -} - - -CTabTests::~CTabTests() -{ -} - - -void CTabTests::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CTabTests) - DDX_Control(pDX, IDC_RUNTEST, m_btnRunTest); - DDX_Control(pDX, IDC_TESTLIST, m_tcTests); - DDX_Text(pDX, IDC_TESTDESCRIPTION, m_szTestDescription); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CTabTests, CPropertyPage) - //{{AFX_MSG_MAP(CTabTests) - ON_BN_CLICKED(IDC_RUNTEST, OnRunTest) - ON_NOTIFY(TVN_SELCHANGED, IDC_TESTLIST, OnSelchangedTestlist) - ON_NOTIFY(NM_DBLCLK, IDC_TESTLIST, OnDblclkTestlist) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CTabTests message handlers - -void CTabTests::OnRunTest() -{ - m_pBrowseDlg->OnRunTest(); -} - - -void CTabTests::OnSelchangedTestlist(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; - - BOOL bItemSelected = FALSE; - m_szTestDescription.Empty(); - - HTREEITEM hItem = m_tcTests.GetNextItem(NULL, TVGN_FIRSTVISIBLE); - while (hItem) - { - UINT nState; - - nState = m_tcTests.GetItemState(hItem, TVIS_SELECTED); - if (nState & TVIS_SELECTED) - { - bItemSelected = TRUE; - if (m_tcTests.ItemHasChildren(hItem)) - { - TestSet *pTestSet = (TestSet *) m_tcTests.GetItemData(hItem); - m_szTestDescription = pTestSet->szDesc; - } - else - { - Test *pTest = (Test *) m_tcTests.GetItemData(hItem); - m_szTestDescription = pTest->szDesc; - } - } - - hItem = m_tcTests.GetNextItem(hItem, TVGN_NEXTVISIBLE); - } - - UpdateData(FALSE); - m_btnRunTest.EnableWindow(bItemSelected); - - *pResult = 0; -} - - -void CTabTests::OnDblclkTestlist(NMHDR* pNMHDR, LRESULT* pResult) -{ - OnRunTest(); - *pResult = 0; -} - - -BOOL CTabTests::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - m_pBrowseDlg->PopulateTests(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} diff --git a/embedding/browser/activex/tests/cbrowse/TabTests.h b/embedding/browser/activex/tests/cbrowse/TabTests.h deleted file mode 100644 index 97ad46c87c4..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TabTests.h +++ /dev/null @@ -1,58 +0,0 @@ -#if !defined(AFX_TABTESTS_H__33D0A351_12E1_11D3_9407_000000000000__INCLUDED_) -#define AFX_TABTESTS_H__33D0A351_12E1_11D3_9407_000000000000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// TabTests.h : header file -// - -class CBrowseDlg; - -///////////////////////////////////////////////////////////////////////////// -// CTabTests dialog - -class CTabTests : public CPropertyPage -{ - DECLARE_DYNCREATE(CTabTests) - -// Construction -public: - CTabTests(); - ~CTabTests(); - - CBrowseDlg *m_pBrowseDlg; - -// Dialog Data - //{{AFX_DATA(CTabTests) - enum { IDD = IDD_TAB_TESTS }; - CButton m_btnRunTest; - CTreeCtrl m_tcTests; - CString m_szTestDescription; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CTabTests) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CTabTests) - afx_msg void OnRunTest(); - afx_msg void OnSelchangedTestlist(NMHDR* pNMHDR, LRESULT* pResult); - afx_msg void OnDblclkTestlist(NMHDR* pNMHDR, LRESULT* pResult); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TABTESTS_H__33D0A351_12E1_11D3_9407_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.cpp b/embedding/browser/activex/tests/cbrowse/TestScriptHelper.cpp deleted file mode 100644 index 0cecabdd2d6..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// TestScriptHelper.cpp : Implementation of CTestScriptHelper -#include "stdafx.h" -#include "Cbrowse.h" -#include "TestScriptHelper.h" - -///////////////////////////////////////////////////////////////////////////// -// CTestScriptHelper - - -STDMETHODIMP CTestScriptHelper::OutputString(BSTR bstrMessage) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()) - - if (bstrMessage == NULL) - { - return E_INVALIDARG; - } - if (m_pBrowserInfo == NULL) - { - return E_UNEXPECTED; - } - - USES_CONVERSION; - m_pBrowserInfo->OutputString(OLE2T(bstrMessage)); - return S_OK; -} - - -STDMETHODIMP CTestScriptHelper::get_WebBrowser(LPDISPATCH *pVal) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()) - - if (pVal == NULL) - { - return E_INVALIDARG; - } - - *pVal = NULL; - if (m_pBrowserInfo == NULL) - { - return E_UNEXPECTED; - } - - CIPtr(IWebBrowserApp) spWebBrowserApp; - m_pBrowserInfo->GetWebBrowser(&spWebBrowserApp); - return spWebBrowserApp->QueryInterface(IID_IDispatch, (void **) pVal); -} - - -STDMETHODIMP CTestScriptHelper::put_Result(TestResult newVal) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()) - - if (m_pBrowserInfo == NULL) - { - return E_UNEXPECTED; - } - - m_pBrowserInfo->nResult = newVal; - - return S_OK; -} - - -STDMETHODIMP CTestScriptHelper::get_TestURL(BSTR *pVal) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()) - - if (pVal == NULL) - { - return E_INVALIDARG; - } - if (m_pBrowserInfo) - { - USES_CONVERSION; - *pVal = SysAllocString(T2OLE(m_pBrowserInfo->szTestURL)); - } - - return S_OK; -} - - -STDMETHODIMP CTestScriptHelper::get_TestCGI(BSTR *pVal) -{ - AFX_MANAGE_STATE(AfxGetStaticModuleState()) - - if (pVal == NULL) - { - return E_INVALIDARG; - } - if (m_pBrowserInfo) - { - USES_CONVERSION; - *pVal = SysAllocString(T2OLE(m_pBrowserInfo->szTestCGI)); - } - - return S_OK; -} diff --git a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.h b/embedding/browser/activex/tests/cbrowse/TestScriptHelper.h deleted file mode 100644 index 8dfffebd791..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.h +++ /dev/null @@ -1,43 +0,0 @@ -// TestScriptHelper.h : Declaration of the CTestScriptHelper - -#ifndef __TESTSCRIPTHELPER_H_ -#define __TESTSCRIPTHELPER_H_ - -#include "resource.h" // main symbols - -///////////////////////////////////////////////////////////////////////////// -// CTestScriptHelper -class ATL_NO_VTABLE CTestScriptHelper : - public CComObjectRootEx, - public CComCoClass, - public IDispatchImpl -{ -public: - CTestScriptHelper() - { - m_pBrowserInfo = NULL; - } - - BrowserInfo *m_pBrowserInfo; - -DECLARE_REGISTRY_RESOURCEID(IDR_TESTSCRIPTHELPER) - -DECLARE_PROTECT_FINAL_CONSTRUCT() - -BEGIN_COM_MAP(CTestScriptHelper) - COM_INTERFACE_ENTRY(DITestScriptHelper) - COM_INTERFACE_ENTRY(IDispatch) -END_COM_MAP() - -// DITestScriptHelper -public: - STDMETHOD(get_TestCGI)(/*[out, retval]*/ BSTR *pVal); - STDMETHOD(get_TestURL)(/*[out, retval]*/ BSTR *pVal); - STDMETHOD(put_Result)(/*[in]*/ TestResult newVal); - STDMETHOD(get_WebBrowser)(/*[out, retval]*/ LPDISPATCH *pVal); - STDMETHOD(OutputString)(BSTR bstrMessage); -}; - -typedef CComObject CTestScriptHelperInstance; - -#endif //__TESTSCRIPTHELPER_H_ diff --git a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.rgs b/embedding/browser/activex/tests/cbrowse/TestScriptHelper.rgs deleted file mode 100644 index 591f8eb0bdd..00000000000 --- a/embedding/browser/activex/tests/cbrowse/TestScriptHelper.rgs +++ /dev/null @@ -1,24 +0,0 @@ -HKCR -{ - Cbrowse.TestScriptHelper.1 = s 'TestScriptHelper Class' - { - CLSID = s '{95AF1AB2-FA66-11D2-A284-000000000000}' - } - Cbrowse.TestScriptHelper = s 'TestScriptHelper Class' - { - CLSID = s '{95AF1AB2-FA66-11D2-A284-000000000000}' - CurVer = s 'Cbrowse.TestScriptHelper.1' - } - NoRemove CLSID - { - ForceRemove {95AF1AB2-FA66-11D2-A284-000000000000} = s 'TestScriptHelper Class' - { - ProgID = s 'Cbrowse.TestScriptHelper.1' - VersionIndependentProgID = s 'Cbrowse.TestScriptHelper' - ForceRemove 'Programmable' - LocalServer32 = s '%MODULE%' - val AppID = s '{5B209214-F756-11D2-A27F-000000000000}' - 'TypeLib' = s '{5B209213-F756-11D2-A27F-000000000000}' - } - } -} diff --git a/embedding/browser/activex/tests/cbrowse/Tests.cpp b/embedding/browser/activex/tests/cbrowse/Tests.cpp deleted file mode 100644 index 97eb6d7b6de..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Tests.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "stdafx.h" - -#include "resource.h" -#include "Cbrowse.h" -#include "CBrowseDlg.h" -#include "TestScriptHelper.h" - -#define BEGIN_TESTSET() \ - TestSet aTestSets[] = { -#define DECL_SET(name, descr) \ - { _T(#name), _T(descr), sizeof(a##name)/sizeof(a##name[0]), a##name, NULL }, -#define DECL_SET_DYNAMIC(name, descr, pop) \ - { _T(#name), _T(descr), 0, NULL, pop }, -#define END_TESTSET() \ - { NULL, NULL, 0, NULL } }; \ - int nTestSets = sizeof(aTestSets) / sizeof(aTestSets[0]) - 1; - -/////////////////////////////////////////////////////////////////////////////// - -void BrowserInfo::OutputString(const TCHAR *szMessage, ...) -{ - TCHAR szBuffer[256]; - - va_list cArgs; - va_start(cArgs, szMessage); - _vstprintf(szBuffer, szMessage, cArgs); - va_end(cArgs); - - CString szOutput; - szOutput.Format(_T(" Test: %s"), szBuffer); - - pBrowseDlg->OutputString(szOutput); -} - - -HRESULT BrowserInfo::GetWebBrowser(IWebBrowserApp **pWebBrowser) -{ - if (pIUnknown == NULL) - { - return E_FAIL; - } - return pIUnknown->QueryInterface(IID_IWebBrowserApp, (void **) pWebBrowser); -} - - -HRESULT BrowserInfo::GetDocument(IHTMLDocument2 **pDocument) -{ - CIPtr(IWebBrowserApp) cpWebBrowser; - if (FAILED(GetWebBrowser(&cpWebBrowser))) - { - return E_FAIL; - } - - CIPtr(IDispatch) cpDispDocument; - cpWebBrowser->get_Document(&cpDispDocument); - if (cpDispDocument == NULL) - { - return E_FAIL; - } - - return cpDispDocument->QueryInterface(IID_IHTMLDocument2, (void **) pDocument); -} - -/////////////////////////////////////////////////////////////////////////////// - -struct InterfaceInfo -{ - const IID *piid; - const TCHAR *szName; -}; - - -static InterfaceInfo aDocIIDs[] = -{ - { &IID_IOleCommandTarget, _T("IOleCommandTarget") }, - { &IID_IHTMLDocument, _T("IHTMLDocument") }, - { &IID_IHTMLDocument2, _T("IHTMLDocument2") }, - { &IID_IHTMLElementCollection, _T("IHTMLElementCollection") }, - { &IID_IHTMLElement, _T("IHTMLElement") } -}; - - -TestResult __cdecl tstDocument(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - // Dump out all the interfaces supported by the document element - for (int i = 0; i < sizeof(aDocIIDs) / sizeof(aDocIIDs[0]); i++) - { - IUnknown *pUnkI = NULL; - if (SUCCEEDED(cpDocElement->QueryInterface(*(aDocIIDs[i].piid), (void **) &pUnkI))) - { - cInfo.OutputString(_T("Info: Document supports interface %s"), aDocIIDs[i].szName); - pUnkI->Release(); - } - else - { - cInfo.OutputString(_T("Info: Document doesn't support interface %s"), aDocIIDs[i].szName); - } - } - - return trPassed; -} - - -TestResult __cdecl tstBody(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CIPtr(IHTMLElement) cpBody; - cpDocElement->get_body(&cpBody); - if (cpBody == NULL) - { - cInfo.OutputString(_T("Error: No Body")); - return trFailed; - } - - return trPassed; -} - -TestResult __cdecl tstPutInnerHTML(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CIPtr(IHTMLElement) cpBody; - cpDocElement->get_body(&cpBody); - if (cpBody == NULL) - { - cInfo.OutputString(_T("Error: No Body")); - return trFailed; - } - - CComBSTR bstr("

Hello world!

Click here to visit our sponsor"); - if (FAILED(cpBody->put_innerHTML(bstr))) - { - cInfo.OutputString(_T("Error: put_innerHTML returned error")); - return trFailed; - } - - return trPassed; -} - -TestResult __cdecl tstGetInnerHTML(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CIPtr(IHTMLElement) cpBody; - HRESULT hr = cpDocElement->get_body( &cpBody ); - if (hr == S_OK) - { - CComBSTR html; - if (FAILED(cpBody->get_innerHTML(&html))) - { - cInfo.OutputString(_T("Error: get_innerHTML returned error")); - return trFailed; - } - } - - return trPassed; -} - -TestResult __cdecl tstSetBgColor(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CComVariant v("red"); - if (FAILED(cpDocElement->put_bgColor(v))) - { - cInfo.OutputString(_T("Error: put_bgColor returned an error")); - return trFailed; - } - - return trPassed; -} - -TestResult __cdecl tstCollectionEnum(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CIPtr(IHTMLElementCollection) cpColl; - HRESULT hr = cpDocElement->get_all( &cpColl ); - if (hr == S_OK) - { - CComPtr cpUnkEnum; - cpColl->get__newEnum(&cpUnkEnum); - if (cpUnkEnum == NULL) - { - cInfo.OutputString(_T("Error: No collection")); - return trFailed; - } - - CIPtr(IEnumVARIANT) cpEnumVARIANT = cpUnkEnum; - if (cpEnumVARIANT) - { - cInfo.OutputString(_T("Collection has IEnumVARIANT")); - } - CIPtr(IEnumUnknown) cpEnumUnknown = cpUnkEnum; - if (cpEnumUnknown) - { - cInfo.OutputString(_T("Collection has IEnumUnknown")); - } - } - else - { - cInfo.OutputString(_T("Error: No collection from document")); - return trFailed; - } - - return trPassed; -} - - -void tstDrillerLevel(BrowserInfo &cInfo, IHTMLElementCollection *pCollection, int nLevel) -{ - if (pCollection == NULL) - { - return; - } - - LONG nElements = 0;; - HRESULT hr = pCollection->get_length( &nElements ); - if (FAILED(hr)) - { - cInfo.OutputString(_T("Error: Collection failed to return number of elements!")); - return; - } - - USES_CONVERSION; - char szLevel[256]; - memset(szLevel, 0, sizeof(szLevel)); - memset(szLevel, ' ', nLevel); - TCHAR *szIndent = A2T(szLevel); - - cInfo.OutputString(_T("%sParsing collection..."), szIndent); - cInfo.OutputString(_T("%sCollection with %d elements"), szIndent, (int) nElements); - - for ( int i=0; i< nElements; i++ ) - { - VARIANT varIndex; - varIndex.vt = VT_UINT; - varIndex.lVal = i; - - VARIANT var2; - VariantInit( &var2 ); - CIPtr(IDispatch) cpDisp; - - hr = pCollection->item( varIndex, var2, &cpDisp ); - if ( hr != S_OK ) - { - continue; - } - - CIPtr(IHTMLElement) cpElem; - - hr = cpDisp->QueryInterface( IID_IHTMLElement, (void **)&cpElem ); - if ( hr == S_OK ) - { - - BSTR bstrTagName = NULL; - hr = cpElem->get_tagName(&bstrTagName); - CString szTagName = bstrTagName; - SysFreeString(bstrTagName); - - BSTR bstrID = NULL; - hr = cpElem->get_id(&bstrID); - CString szID = bstrID; - SysFreeString(bstrID); - - BSTR bstrClassName = NULL; - hr = cpElem->get_className(&bstrClassName); - CString szClassName = bstrClassName; - SysFreeString(bstrClassName); - - cInfo.OutputString(_T("%sElement at %d is %s"), szIndent, i, szTagName); - cInfo.OutputString(_T("%s id=%s"), szIndent, szID); - cInfo.OutputString(_T("%s classname=%s"), szIndent, szClassName); - - CIPtr(IHTMLImgElement) cpImgElem; - hr = cpDisp->QueryInterface( IID_IHTMLImgElement, (void **)&cpImgElem ); - if ( hr == S_OK ) - { -// cpImgElem->get_href(&bstr); - } - else - { - CIPtr(IHTMLAnchorElement) cpAnchElem; - hr = cpDisp->QueryInterface( IID_IHTMLAnchorElement, (void **)&cpAnchElem ); - if ( hr == S_OK ) - { -// cpAnchElem->get_href(&bstr); - } - } - - CIPtr(IDispatch) cpDispColl; - hr = cpElem->get_children(&cpDispColl); - if (hr == S_OK) - { - CIPtr(IHTMLElementCollection) cpColl = cpDispColl; - tstDrillerLevel(cInfo, cpColl, nLevel + 1); - } - } - } - - cInfo.OutputString(_T("%sEnd collection"), szIndent); -} - - -TestResult __cdecl tstDriller(BrowserInfo &cInfo) -{ - CIPtr(IHTMLDocument2) cpDocElement; - cInfo.GetDocument(&cpDocElement); - if (cpDocElement == NULL) - { - cInfo.OutputString(_T("Error: No document")); - return trFailed; - } - - CIPtr(IHTMLElementCollection) cpColl; - HRESULT hr = cpDocElement->get_all( &cpColl ); - if (hr == S_OK) - { - tstDrillerLevel(cInfo, cpColl, 0); - } - - return trPassed; -} - - -TestResult __cdecl tstTesters(BrowserInfo &cInfo) -{ - cInfo.OutputString("Test architecture is reasonably sane!"); - return trPassed; -} - - -TestResult __cdecl tstControlActive(BrowserInfo &cInfo) -{ - CBrowserCtlSiteInstance *pControlSite = cInfo.pControlSite; - if (pControlSite == NULL) - { - cInfo.OutputString(_T("Error: No control site")); - return trFailed; - } - - if (!pControlSite->IsInPlaceActive()) - { - cInfo.OutputString(_T("Error: Control is not in-place active")); - return trFailed; - } - - return trPassed; -} - - -TestResult __cdecl tstIWebBrowser(BrowserInfo &cInfo) -{ - if (cInfo.pIUnknown == NULL) - { - cInfo.OutputString(_T("Error: No control")); - return trFailed; - } - - CIPtr(IWebBrowser) cpIWebBrowser = cInfo.pIUnknown; - if (cpIWebBrowser) - { - return trPassed; - } - - cInfo.OutputString(_T("Error: No IWebBrowser")); - return trFailed; -} - - -TestResult __cdecl tstIWebBrowser2(BrowserInfo &cInfo) -{ - if (cInfo.pIUnknown == NULL) - { - cInfo.OutputString(_T("Error: No control")); - return trFailed; - } - CIPtr(IWebBrowser2) cpIWebBrowser = cInfo.pIUnknown; - if (cpIWebBrowser) - { - return trPassed; - } - - cInfo.OutputString(_T("Error: No IWebBrowser2")); - return trFailed; -} - - -TestResult __cdecl tstIWebBrowserApp(BrowserInfo &cInfo) -{ - if (cInfo.pIUnknown == NULL) - { - cInfo.OutputString(_T("Error: No control")); - return trFailed; - } - - CIPtr(IWebBrowserApp) cpIWebBrowser = cInfo.pIUnknown; - if (cpIWebBrowser) - { - return trPassed; - } - - cInfo.OutputString(_T("Error: No IWebBrowserApp")); - return trFailed; -} - - -TestResult __cdecl tstNavigate2(BrowserInfo &cInfo) -{ - return trFailed; -} - - -TestResult __cdecl tstScriptTest(BrowserInfo &cInfo) -{ - cInfo.nResult = trFailed; - - CTestScriptHelperInstance *pHelper = NULL; - CTestScriptHelperInstance::CreateInstance(&pHelper); - if (pHelper) - { - pHelper->m_pBrowserInfo = &cInfo; - - CActiveScriptSiteInstance *pSite = NULL; - CActiveScriptSiteInstance::CreateInstance(&pSite); - if (pSite) - { - // TODO read from registry - CString szScript; - szScript.Format(_T("Scripts\\%s"), cInfo.pTest->szName); - - pSite->AddRef(); - pSite->AttachVBScript(); - pSite->AddNamedObject(_T("BrowserInfo"), pHelper, TRUE); - pSite->ParseScriptFile(szScript); - pSite->PlayScript(); - pSite->Detach(); - pSite->Release(); - } - } - - return cInfo.nResult; -} - - -Test aScripts[] = -{ - { _T("Script test"), _T("Test that the scripting engine is sane"), tstScriptTest } -}; - - -void __cdecl ScriptSetPopulator(TestSet *pTestSet) -{ - // TODO read from registry - CString szTestDir(_T("Scripts")); - - CStringList cStringList; - CFileFind cFinder; - CString szPattern; - - - szPattern.Format(_T("%s\\*.vbs"), szTestDir); - BOOL bWorking = cFinder.FindFile(szPattern); - while (bWorking) - { - bWorking = cFinder.FindNextFile(); - cStringList.AddTail(cFinder.GetFileName()); - } - - szPattern.Format(_T("%s\\*.js"), szTestDir); - bWorking = cFinder.FindFile(szPattern); - while (bWorking) - { - bWorking = cFinder.FindNextFile(); - cStringList.AddTail(cFinder.GetFileName()); - } - - // Create a set of tests from the scripts found - Test *pTests = (Test *) malloc(sizeof(Test) * cStringList.GetCount()); - for (int i = 0; i < cStringList.GetCount(); i++) - { - CString szScript = cStringList.GetAt(cStringList.FindIndex(i)); - _tcscpy(pTests[i].szName, szScript); - _tcscpy(pTests[i].szDesc, _T("Run the specified script")); - pTests[i].pfn = tstScriptTest; - } - - pTestSet->nTests = cStringList.GetCount(); - pTestSet->aTests = pTests; -} - -/////////////////////////////////////////////////////////////////////////////// - -Test aBasic[] = -{ - { _T("Test Tester"), _T("Ensure that the testing architecture is working"), tstTesters, trNotRun }, - { _T("Control basics"), _T("Ensure that the browser control is active"), tstControlActive, trNotRun }, - { _T("IWebBrowser"), _T("Test if control has an IWebBrowser interface"), tstIWebBrowser, trNotRun }, - { _T("IWebBrowser2"), _T("Test if control has an IWebBrowser2 interface"), tstIWebBrowser2, trNotRun }, - { _T("IWebBrowserApp"), _T("Test if control has an IWebBrowserApp interface"), tstIWebBrowserApp, trNotRun } -}; - - -Test aBrowsing[] = -{ - { _T("IWebBrowser2::Navigate2"), _T("Test if browser can navigate to the test URL"), NULL } -}; - - -Test aDHTML[] = -{ - { _T("IWebBrowser::get_Document"), _T("Test if browser has a top level element"), tstDocument }, - { _T("IHTMLDocument::get_Body"), _T("Test if the body element can be retrieved"), tstBody}, - { _T("IHTMLElement::put_innerHTML"), _T("Test if the innerHTML attribute works"), tstPutInnerHTML }, - { _T("IHTMLElement::get_innerHTML"), _T("Dump the innerHTML for the BODY element"), tstGetInnerHTML }, - { _T("IHTMLElement::put_bgColor"), _T("Set the document background color to red"), tstSetBgColor }, - { _T("IHTMLElementCollection::get__newEnum"), _T("Test if element collections return enumerations"), tstCollectionEnum }, - { _T("Parse DOM"), _T("Parse the document DOM"), tstDriller } -}; - - -Test aOther[] = -{ - { _T("Print Page"), _T("Print the test URL page"), NULL } -}; - -BEGIN_TESTSET() - DECL_SET(Basic, "Basic sanity tests") - DECL_SET(Browsing, "Browsing and navigation tests") - DECL_SET(DHTML, "Test the DOM") - DECL_SET(Other, "Other tests") - DECL_SET_DYNAMIC(Scripts, "Script tests", ScriptSetPopulator) -END_TESTSET() - diff --git a/embedding/browser/activex/tests/cbrowse/Tests.h b/embedding/browser/activex/tests/cbrowse/Tests.h deleted file mode 100644 index 8b25074e6b8..00000000000 --- a/embedding/browser/activex/tests/cbrowse/Tests.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef TESTS_H -#define TESTS_H - -#include "CBrowse_i.h" - -class CBrowseDlg; -struct Test; - -class BrowserInfo -{ -public: - Test *pTest; - TestResult nResult; - CBrowserCtlSiteInstance *pControlSite; - IUnknown *pIUnknown; - CLSID clsid; - CBrowseDlg *pBrowseDlg; - CString szTestURL; - CString szTestCGI; - - void OutputString(const TCHAR *szMessage, ...); - HRESULT GetWebBrowser(IWebBrowserApp **pWebBrowser); - HRESULT GetDocument(IHTMLDocument2 **pDocument); -}; - - -typedef TestResult (__cdecl *TestProc)(BrowserInfo &cInfo); - -struct Test -{ - TCHAR szName[256]; - TCHAR szDesc[256]; - TestProc pfn; - TestResult nLastResult; -}; - -struct TestSet; -typedef void (__cdecl *SetPopulatorProc)(TestSet *pTestSet); - -struct TestSet -{ - TCHAR *szName; - TCHAR *szDesc; - int nTests; - Test *aTests; - SetPopulatorProc pfnPopulator; -}; - -extern TestSet aTestSets[]; -extern int nTestSets; - -#endif \ No newline at end of file diff --git a/embedding/browser/activex/tests/cbrowse/cbrowse.cpp b/embedding/browser/activex/tests/cbrowse/cbrowse.cpp deleted file mode 100644 index 0143114d141..00000000000 --- a/embedding/browser/activex/tests/cbrowse/cbrowse.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// cbrowse.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "cbrowse.h" -#include "PickerDlg.h" -#include -#include "Cbrowse_i.c" -#include "TestScriptHelper.h" -#include "ControlEventSink.h" -#include "CBrowserCtlSite.h" - - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CBrowseApp - -BEGIN_MESSAGE_MAP(CBrowseApp, CWinApp) - //{{AFX_MSG_MAP(CBrowseApp) - //}}AFX_MSG_MAP - ON_COMMAND(ID_HELP, CWinApp::OnHelp) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CBrowseApp construction - -CBrowseApp::CBrowseApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - -///////////////////////////////////////////////////////////////////////////// -// The one and only CBrowseApp object - -CBrowseApp theApp; - -///////////////////////////////////////////////////////////////////////////// -// CBrowseApp initialization - -BOOL CBrowseApp::InitInstance() -{ - // Initialize OLE libraries - if (!AfxOleInit()) - { - return FALSE; - } -// if (!InitATL()) -// return FALSE; - - AfxEnableControlContainer(); - _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, - REGCLS_MULTIPLEUSE); - - - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. - -#ifdef _AFXDLL - Enable3dControls(); // Call this when using MFC in a shared DLL -#else - Enable3dControlsStatic(); // Call this when linking to MFC statically -#endif - - int nResponse; - - CPickerDlg pickerDlg; - nResponse = pickerDlg.DoModal(); - if (nResponse != IDOK) - { - return FALSE; - } - - m_pDlg = new CBrowseDlg; - m_pDlg->m_clsid = pickerDlg.m_clsid; - m_pDlg->m_bUseCustomDropTarget = pickerDlg.m_bUseCustom; - m_pDlg->m_bUseCustomPopupMenu = pickerDlg.m_bUseCustom; - m_pDlg->Create(IDD_CBROWSE_DIALOG); - m_pMainWnd = m_pDlg; - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return TRUE; -} - -CBrowseModule _Module; - -BEGIN_OBJECT_MAP(ObjectMap) - OBJECT_ENTRY(CLSID_TestScriptHelper, CTestScriptHelper) -// OBJECT_ENTRY(CLSID_ControlEventSink, CControlEventSink) -// OBJECT_ENTRY(CLSID_CBrowserCtlSite, CCBrowserCtlSite) -END_OBJECT_MAP() - -LONG CBrowseModule::Unlock() -{ - AfxOleUnlockApp(); - return 0; -} - -LONG CBrowseModule::Lock() -{ - AfxOleLockApp(); - return 1; -} - -LPCTSTR CBrowseModule::FindOneOf(LPCTSTR p1, LPCTSTR p2) -{ - while (*p1 != NULL) - { - LPCTSTR p = p2; - while (*p != NULL) - { - if (*p1 == *p) - return CharNext(p1); - p = CharNext(p); - } - p1++; - } - return NULL; -} - - -int CBrowseApp::ExitInstance() -{ - if (m_bATLInited) - { - _Module.RevokeClassObjects(); - _Module.Term(); - CoUninitialize(); - } - return CWinApp::ExitInstance(); -} - - -BOOL CBrowseApp::InitATL() -{ - m_bATLInited = TRUE; - - HRESULT hRes; - -#if _WIN32_WINNT >= 0x0400 - // hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED); -#else - // hRes = CoInitialize(NULL); -#endif - if (!AfxOleInit()) - { - return FALSE; - } - - - //if (FAILED(hRes)) - //{ - // m_bATLInited = FALSE; - // return FALSE; - //} - - _Module.Init(ObjectMap, AfxGetInstanceHandle()); - _Module.dwThreadID = GetCurrentThreadId(); - - LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT - TCHAR szTokens[] = _T("-/"); - - BOOL bRun = TRUE; - LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens); - while (lpszToken != NULL) - { - if (lstrcmpi(lpszToken, _T("UnregServer"))==0) - { - _Module.UpdateRegistryFromResource(IDR_CBROWSE, FALSE); - _Module.UnregisterServer(TRUE); //TRUE means typelib is unreg'd - bRun = FALSE; - break; - } - if (lstrcmpi(lpszToken, _T("RegServer"))==0) - { - _Module.UpdateRegistryFromResource(IDR_CBROWSE, TRUE); - _Module.RegisterServer(TRUE); - bRun = FALSE; - break; - } - lpszToken = _Module.FindOneOf(lpszToken, szTokens); - } - - if (!bRun) - { - m_bATLInited = FALSE; - _Module.Term(); - CoUninitialize(); - return FALSE; - } - - hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, - REGCLS_MULTIPLEUSE); - if (FAILED(hRes)) - { - m_bATLInited = FALSE; - CoUninitialize(); - return FALSE; - } - - return TRUE; -} - -int CBrowseApp::Run() -{ - int rv = 1; - try { - rv = CWinApp::Run(); - } - catch (CException *e) - { - ASSERT(0); - } - catch (...) - { - ASSERT(0); - } - return rv; -} diff --git a/embedding/browser/activex/tests/cbrowse/cbrowse.dsp b/embedding/browser/activex/tests/cbrowse/cbrowse.dsp deleted file mode 100644 index 7796bc8703f..00000000000 --- a/embedding/browser/activex/tests/cbrowse/cbrowse.dsp +++ /dev/null @@ -1,331 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cbrowse" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=cbrowse - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cbrowse.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cbrowse.mak" CFG="cbrowse - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cbrowse - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "cbrowse - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cbrowse - Win32 Release" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "cbrowse - Win32 Debug" - -# PROP BASE Use_MFC 6 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 6 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "cbrowse - Win32 Release" -# Name "cbrowse - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\src\control\ActiveScriptSite.cpp -# End Source File -# Begin Source File - -SOURCE=.\cbrowse.cpp -# End Source File -# Begin Source File - -SOURCE=.\Cbrowse.idl -# ADD MTL /h "Cbrowse_i.h" /iid "Cbrowse_i.c" /Oicf -# End Source File -# Begin Source File - -SOURCE=.\cbrowse.rc -# End Source File -# Begin Source File - -SOURCE=.\CBrowseDlg.cpp -# End Source File -# Begin Source File - -SOURCE=.\CBrowserCtlSite.cpp -# End Source File -# Begin Source File - -SOURCE=.\ControlEventSink.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\ControlSite.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\ControlSiteIPFrame.cpp -# End Source File -# Begin Source File - -SOURCE=.\EditToolBar.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\MozActiveX.java -# End Source File -# Begin Source File - -SOURCE=.\PickerDlg.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\PropertyBag.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# Begin Source File - -SOURCE=.\TabDOM.cpp -# End Source File -# Begin Source File - -SOURCE=.\TabMessages.cpp -# End Source File -# Begin Source File - -SOURCE=.\TabTests.cpp -# End Source File -# Begin Source File - -SOURCE=.\Tests.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestScriptHelper.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\ActiveScriptSite.h -# End Source File -# Begin Source File - -SOURCE=.\cbrowse.h -# End Source File -# Begin Source File - -SOURCE=.\Cbrowse_i.h -# End Source File -# Begin Source File - -SOURCE=.\CBrowseDlg.h -# End Source File -# Begin Source File - -SOURCE=.\CBrowserCtlSite.h -# End Source File -# Begin Source File - -SOURCE=.\ControlEventSink.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\ControlSite.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\ControlSiteIPFrame.h -# End Source File -# Begin Source File - -SOURCE=.\EditToolBar.h -# End Source File -# Begin Source File - -SOURCE=.\PickerDlg.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\PropertyBag.h -# End Source File -# Begin Source File - -SOURCE=.\Resource.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# Begin Source File - -SOURCE=.\TabDOM.h -# End Source File -# Begin Source File - -SOURCE=.\TabMessages.h -# End Source File -# Begin Source File - -SOURCE=.\TabTests.h -# End Source File -# Begin Source File - -SOURCE=.\Tests.h -# End Source File -# Begin Source File - -SOURCE=.\TestScriptHelper.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\res\cbrowse.ico -# End Source File -# Begin Source File - -SOURCE=.\res\cbrowse.rc2 -# End Source File -# Begin Source File - -SOURCE=.\res\closedfolder.ico -# End Source File -# Begin Source File - -SOURCE=.\res\openfold.ico -# End Source File -# Begin Source File - -SOURCE=.\res\openfolder.ico -# End Source File -# Begin Source File - -SOURCE=.\res\test.ico -# End Source File -# Begin Source File - -SOURCE=.\res\testfailed.ico -# End Source File -# Begin Source File - -SOURCE=.\res\testpartial.ico -# End Source File -# Begin Source File - -SOURCE=.\res\testpassed.ico -# End Source File -# Begin Source File - -SOURCE=.\res\toolbar1.bmp -# End Source File -# End Group -# Begin Group "Scripts" - -# PROP Default_Filter "js;vbs" -# Begin Source File - -SOURCE=.\Scripts\Basic.vbs -# End Source File -# Begin Source File - -SOURCE=.\Scripts\NewWindow.vbs -# End Source File -# Begin Source File - -SOURCE=.\Scripts\Post.vbs -# End Source File -# End Group -# Begin Source File - -SOURCE=.\Cbrowse.rgs -# End Source File -# Begin Source File - -SOURCE=.\CBrowserCtlSite.rgs -# End Source File -# Begin Source File - -SOURCE=.\ControlEventSink.rgs -# End Source File -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# Begin Source File - -SOURCE=.\TestScriptHelper.rgs -# End Source File -# End Target -# End Project -# Section cbrowse : {10404710-0021-001E-1B00-1B00EAA80000} -# 1:11:IDR_CBROWSE:103 -# End Section diff --git a/embedding/browser/activex/tests/cbrowse/cbrowse.h b/embedding/browser/activex/tests/cbrowse/cbrowse.h deleted file mode 100644 index 8ee106ad389..00000000000 --- a/embedding/browser/activex/tests/cbrowse/cbrowse.h +++ /dev/null @@ -1,58 +0,0 @@ -// cbrowse.h : main header file for the CBROWSE application -// - -#if !defined(AFX_CBROWSE_H__5121F5E4_5324_11D2_93E1_000000000000__INCLUDED_) -#define AFX_CBROWSE_H__5121F5E4_5324_11D2_93E1_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH -#endif - -#include "resource.h" // main symbols -#include "Cbrowse_i.h" -#include "CBrowseDlg.h" - -///////////////////////////////////////////////////////////////////////////// -// CBrowseApp: -// See cbrowse.cpp for the implementation of this class -// - -class CBrowseApp : public CWinApp -{ -public: - CBrowseApp(); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CBrowseApp) - public: - virtual BOOL InitInstance(); - virtual int ExitInstance(); - virtual int Run(); - //}}AFX_VIRTUAL - -// Implementation - - //{{AFX_MSG(CBrowseApp) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -private: - - CBrowseDlg *m_pDlg; - BOOL m_bATLInited; -private: - BOOL InitATL(); - -}; - - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_CBROWSE_H__5121F5E4_5324_11D2_93E1_000000000000__INCLUDED_) diff --git a/embedding/browser/activex/tests/cbrowse/cbrowse.rc b/embedding/browser/activex/tests/cbrowse/cbrowse.rc deleted file mode 100644 index 6e44669d48c..00000000000 --- a/embedding/browser/activex/tests/cbrowse/cbrowse.rc +++ /dev/null @@ -1,464 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_CLOSEDFOLDER ICON DISCARDABLE "res\\closedfolder.ico" -IDI_OPENFOLDER ICON DISCARDABLE "res\\openfolder.ico" -IDI_TESTPASSED ICON DISCARDABLE "res\\testpassed.ico" -IDI_TESTFAILED ICON DISCARDABLE "res\\testfailed.ico" -IDI_TESTPARTIAL ICON DISCARDABLE "res\\testpartial.ico" -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// 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 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\cbrowse.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#endif\r\n" - "#include ""res\\cbrowse.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CBROWSE_DIALOG DIALOGEX 0, 0, 558, 349 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_APPWINDOW -CAPTION "CBrowse" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - PUSHBUTTON "<",IDC_BACKWARD,7,7,10,13 - PUSHBUTTON ">",IDC_FORWARD,20,7,10,13 - PUSHBUTTON "Reload",IDC_RELOAD,33,7,30,13 - PUSHBUTTON "&Stop",IDC_STOP,66,7,25,13 - DEFPUSHBUTTON "&Go",IDC_GO,526,7,25,13 - RTEXT "&URL:",IDC_STATIC,94,9,18,8 - COMBOBOX IDC_URL,116,7,405,52,CBS_DROPDOWN | CBS_AUTOHSCROLL | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_TAB_MARKER,"Static",SS_BLACKFRAME,7,252,544,89 - CONTROL "",IDC_BROWSER_MARKER,"Static",SS_BLACKFRAME,7,44,544, - 202 - CONTROL "",IDC_EDITBAR_MARKER,"Static",SS_BLACKFRAME,7,23,544,19 -END - - -#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 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "cbrowse MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "cbrowse\0" - VALUE "LegalCopyright", "Copyright (C) 1998\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "cbrowse.EXE\0" - VALUE "ProductName", "cbrowse Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_CBROWSE_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 551 - TOPMARGIN, 7 - BOTTOMMARGIN, 341 - HORZGUIDE, 246 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_CBROWSE REGISTRY DISCARDABLE "Cbrowse.rgs" -IDR_TESTSCRIPTHELPER REGISTRY DISCARDABLE "TestScriptHelper.rgs" -IDR_CONTROLEVENTSINK REGISTRY DISCARDABLE "ControlEventSink.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAIN MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "Sa&ve As...", ID_FILE_SAVEAS - MENUITEM SEPARATOR - MENUITEM "Page Setup...", ID_FILE_PAGESETUP - MENUITEM "&Print Page", ID_FILE_PRINT - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_FILE_EXIT - END - POPUP "&Edit" - BEGIN - MENUITEM "Cu&t", ID_EDIT_CUT - MENUITEM "&Copy", ID_EDIT_COPY - MENUITEM "&Paste", ID_EDIT_PASTE - MENUITEM SEPARATOR - MENUITEM "Select &All", ID_EDIT_SELECTALL - END - POPUP "&View" - BEGIN - POPUP "&Go To" - BEGIN - MENUITEM "&Back", ID_VIEW_GOTO_BACK - MENUITEM "&Forward", ID_VIEW_GOTO_FORWARD - MENUITEM SEPARATOR - MENUITEM "&Home Page", ID_VIEW_GOTO_HOME - END - MENUITEM "&Stop", ID_VIEW_STOP - MENUITEM "&Refresh", ID_VIEW_REFRESH - MENUITEM SEPARATOR - MENUITEM "Sour&ce", ID_VIEW_VIEWSOURCE - MENUITEM SEPARATOR - MENUITEM "Edit Mode", ID_VIEW_EDITMODE - MENUITEM "Open Links in New Windows", ID_VIEW_OPENLINKSINNEWWINDOWS - - END - POPUP "&Help" - BEGIN - MENUITEM "&About...", ID_HELP_ABOUT - END - POPUP "&Debug" - BEGIN - MENUITEM "&Visible", ID_DEBUG_VISIBLE - MENUITEM "Post Data Test", ID_DEBUG_POSTDATATEST - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_TEST ICON DISCARDABLE "res\\test.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PICKBROWSER DIALOG DISCARDABLE 0, 0, 284, 232 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Welcome to CBrowse!" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "This is a browser/test application written in MFC that exercises the IE browser interface of the control that you choose from the list below.", - IDC_STATIC,7,7,213,27 - LTEXT "Whatever control you choose, the exact same code is run upon it. Discrepancies in behaviour or test results may indicate a bug!", - IDC_STATIC,7,33,213,20 - LTEXT "Pick the browser to test:",IDC_STATIC,7,56,77,8 - LISTBOX IDC_LISTBROWSER,7,65,213,50,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Some of the tests require a test URL. You may change the default one if you want. Ensure that the URL is valid otherwise the tests might fail!", - IDC_STATIC,7,120,213,18 - EDITTEXT IDC_TESTURL,7,138,213,13,ES_AUTOHSCROLL - LTEXT "Some tests also need a CGI URL, enter that here:", - IDC_STATIC,7,157,157,8 - EDITTEXT IDC_TESTCGI,7,167,213,13,ES_AUTOHSCROLL - CONTROL "Override default drop target and popup menus", - IDC_OVERRIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,185, - 207,10 - CONTROL "Turn on Mozilla debugging (creates a mozilla.log file)", - IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,197, - 172,10 - EDITTEXT IDC_EDIT1,7,210,213,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,227,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,227,24,50,14 -END - -IDD_TAB_MESSAGES DIALOG DISCARDABLE 0, 0, 275, 75 -STYLE WS_CHILD | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - LISTBOX IDC_OUTPUT,5,5,265,50,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | - WS_TABSTOP - LTEXT "Static",IDC_STATUS,5,59,197,11,SS_SUNKEN - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER, - 205,59,65,11 -END - -IDD_TAB_TESTS DIALOG DISCARDABLE 0, 0, 275, 75 -STYLE WS_CHILD | WS_VISIBLE -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "Run",IDC_RUNTEST,212,56,50,14,WS_DISABLED - CONTROL "Tree1",IDC_TESTLIST,"SysTreeView32",TVS_HASBUTTONS | - TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | - TVS_TRACKSELECT | WS_BORDER | WS_TABSTOP,5,5,196,65 - GROUPBOX "Test Description",IDC_STATIC,203,5,66,47 - LTEXT "",IDC_TESTDESCRIPTION,208,15,56,32 -END - -IDD_TAB_DOM DIALOG DISCARDABLE 0, 0, 275, 80 -STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Tree1",IDC_DOMLIST,"SysTreeView32",TVS_HASBUTTONS | - TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | - TVS_TRACKSELECT | WS_BORDER | WS_TABSTOP,5,5,212,70 - PUSHBUTTON "Refresh",IDC_REFRESHDOM,220,5,50,14 - PUSHBUTTON "&Delete",IDC_BUTTON1,220,61,50,14,WS_DISABLED -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PICKBROWSER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 225 - END - - IDD_TAB_MESSAGES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 270 - TOPMARGIN, 5 - BOTTOMMARGIN, 70 - END - - IDD_TAB_TESTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 270 - TOPMARGIN, 5 - BOTTOMMARGIN, 70 - END - - IDD_TAB_DOM, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 270 - TOPMARGIN, 5 - BOTTOMMARGIN, 75 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_CBROWSERCTLSITE REGISTRY DISCARDABLE "CBrowserCtlSite.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// Toolbar -// - -IDR_DHTMLEDIT TOOLBAR DISCARDABLE 16, 15 -BEGIN - BUTTON IDB_BOLD - BUTTON IDB_ITALIC - BUTTON IDB_UNDERLINE - SEPARATOR - BUTTON IDB_H1 - BUTTON IDB_H2 - BUTTON IDB_PARAGRAPH - SEPARATOR - BUTTON ID_ORDEREDLIST - BUTTON IDB_UNORDEREDLIST -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDR_DHTMLEDIT BITMAP DISCARDABLE "res\\toolbar1.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CHOOSEBROWSER "You must choose a browser control from the list to proceed." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDD_TAB_MESSAGES "Messages" - IDD_TAB_TESTS "Tests" - IDD_TAB_DOM "DOM" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDB_BOLD "Bold" - IDB_ITALIC "Italic" - IDB_UNDERLINE "Underline" -END - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#pragma code_page(1252) -#endif -#include "res\cbrowse.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/embedding/browser/activex/tests/cbrowse/cbrowse.sln b/embedding/browser/activex/tests/cbrowse/cbrowse.sln deleted file mode 100644 index 2decf7be3d5..00000000000 --- a/embedding/browser/activex/tests/cbrowse/cbrowse.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cbrowse", "cbrowse.vcproj", "{5A3FE53C-9A16-44B8-B942-47E352354280}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {5A3FE53C-9A16-44B8-B942-47E352354280}.Debug.ActiveCfg = Debug|Win32 - {5A3FE53C-9A16-44B8-B942-47E352354280}.Debug.Build.0 = Debug|Win32 - {5A3FE53C-9A16-44B8-B942-47E352354280}.Release.ActiveCfg = Release|Win32 - {5A3FE53C-9A16-44B8-B942-47E352354280}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/embedding/browser/activex/tests/cbrowse/res/cbrowse.ico b/embedding/browser/activex/tests/cbrowse/res/cbrowse.ico deleted file mode 100644 index 7eef0bcbe65..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/cbrowse.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/cbrowse.rc2 b/embedding/browser/activex/tests/cbrowse/res/cbrowse.rc2 deleted file mode 100644 index 0cbf00b0037..00000000000 --- a/embedding/browser/activex/tests/cbrowse/res/cbrowse.rc2 +++ /dev/null @@ -1,13 +0,0 @@ -// -// CBROWSE.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/embedding/browser/activex/tests/cbrowse/res/closedfolder.ico b/embedding/browser/activex/tests/cbrowse/res/closedfolder.ico deleted file mode 100644 index 387080ef43b..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/closedfolder.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/openfolder.ico b/embedding/browser/activex/tests/cbrowse/res/openfolder.ico deleted file mode 100644 index ccd80d5c174..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/openfolder.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/test.ico b/embedding/browser/activex/tests/cbrowse/res/test.ico deleted file mode 100644 index abc72557732..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/test.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/testfailed.ico b/embedding/browser/activex/tests/cbrowse/res/testfailed.ico deleted file mode 100644 index 9e64c59c106..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/testfailed.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/testpartial.ico b/embedding/browser/activex/tests/cbrowse/res/testpartial.ico deleted file mode 100644 index 3cf170115af..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/testpartial.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/testpassed.ico b/embedding/browser/activex/tests/cbrowse/res/testpassed.ico deleted file mode 100644 index 410d03ffb4b..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/testpassed.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/res/toolbar1.bmp b/embedding/browser/activex/tests/cbrowse/res/toolbar1.bmp deleted file mode 100644 index 736967c8776..00000000000 Binary files a/embedding/browser/activex/tests/cbrowse/res/toolbar1.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/cbrowse/resource.h b/embedding/browser/activex/tests/cbrowse/resource.h deleted file mode 100644 index 3796aaf384b..00000000000 --- a/embedding/browser/activex/tests/cbrowse/resource.h +++ /dev/null @@ -1,84 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by cbrowse.rc -// -#define IDS_CHOOSEBROWSER 1 -#define IDD_CBROWSE_DIALOG 102 -#define IDR_CBROWSE 103 -#define IDR_TESTSCRIPTHELPER 104 -#define IDR_CONTROLEVENTSINK 105 -#define IDR_CBROWSERCTLSITE 106 -#define IDR_MAINFRAME 128 -#define IDD_PICKBROWSER 129 -#define IDI_CLOSEDFOLDER 130 -#define IDI_OPENFOLDER 131 -#define IDI_TEST 132 -#define IDI_TESTPASSED 133 -#define IDI_TESTFAILED 134 -#define IDD_TAB_MESSAGES 135 -#define IDD_TAB_TESTS 136 -#define IDD_TAB_DOM 137 -#define IDR_DHTMLEDIT 138 -#define IDI_TESTPARTIAL 140 -#define IDR_MAIN 141 -#define IDC_URL 1000 -#define IDC_GO 1001 -#define IDC_BROWSER_MARKER 1002 -#define IDC_LISTBROWSER 1003 -#define IDC_STOP 1003 -#define IDC_RUNTEST 1004 -#define IDC_LISTMESSAGES 1005 -#define IDC_TESTLIST 1006 -#define IDC_BACKWARD 1008 -#define IDC_FORWARD 1009 -#define IDC_TESTDESCRIPTION 1010 -#define IDC_TESTURL 1011 -#define IDC_DOMLIST 1012 -#define IDC_TESTCGI 1012 -#define IDC_REFRESHDOM 1013 -#define IDC_NEWWINDOW 1014 -#define IDC_OUTPUT 1016 -#define IDC_TAB_MARKER 1017 -#define IDC_STATUS 1019 -#define IDC_PROGRESS 1020 -#define IDC_CHECK1 1021 -#define IDC_EDIT1 1022 -#define IDC_EDITMODE 1023 -#define IDC_EDITBAR_MARKER 1025 -#define IDC_OVERRIDE 1026 -#define IDC_BUTTON1 1027 -#define IDC_RELOAD 1028 -#define IDB_BOLD 32771 -#define IDB_ITALIC 32772 -#define IDB_UNDERLINE 32773 -#define IDB_H1 32774 -#define IDB_H2 32775 -#define IDB_PARAGRAPH 32776 -#define ID_ORDEREDLIST 32777 -#define IDB_UNORDEREDLIST 32778 -#define ID_FILE_EXIT 32779 -#define ID_VIEW_VIEWSOURCE 32783 -#define ID_HELP_ABOUT 32784 -#define ID_VIEW_GOTO_BACK 32786 -#define ID_VIEW_GOTO_FORWARD 32787 -#define ID_VIEW_STOP 32788 -#define ID_VIEW_GOTO_HOME 32789 -#define ID_EDIT_SELECTALL 32790 -#define ID_VIEW_REFRESH 32791 -#define ID_FILE_SAVEAS 32793 -#define ID_DEBUG_VISIBLE 32794 -#define ID_DEBUG_POSTDATATEST 32795 -#define ID_VIEW_EDITMODE 32796 -#define ID_VIEW_OPENLINKSINNEWWINDOWS 32797 -#define ID_FILE_PAGESETUP 32798 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 142 -#define _APS_NEXT_COMMAND_VALUE 32799 -#define _APS_NEXT_CONTROL_VALUE 1029 -#define _APS_NEXT_SYMED_VALUE 107 -#endif -#endif diff --git a/embedding/browser/activex/tests/csbrowse/App.ico b/embedding/browser/activex/tests/csbrowse/App.ico deleted file mode 100644 index 3a5525fd794..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/App.ico and /dev/null differ diff --git a/embedding/browser/activex/tests/csbrowse/AssemblyInfo.cs b/embedding/browser/activex/tests/csbrowse/AssemblyInfo.cs deleted file mode 100644 index 9f89a3282c5..00000000000 --- a/embedding/browser/activex/tests/csbrowse/AssemblyInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/embedding/browser/activex/tests/csbrowse/CSBrowse.csproj b/embedding/browser/activex/tests/csbrowse/CSBrowse.csproj deleted file mode 100644 index 59f609df76d..00000000000 --- a/embedding/browser/activex/tests/csbrowse/CSBrowse.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/embedding/browser/activex/tests/csbrowse/CSBrowse.sln b/embedding/browser/activex/tests/csbrowse/CSBrowse.sln deleted file mode 100644 index 3c375d35827..00000000000 --- a/embedding/browser/activex/tests/csbrowse/CSBrowse.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSBrowse", "CSBrowse.csproj", "{41468AF6-24B5-4807-8AF4-7A41FBD2904F}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {41468AF6-24B5-4807-8AF4-7A41FBD2904F}.Debug.ActiveCfg = Debug|.NET - {41468AF6-24B5-4807-8AF4-7A41FBD2904F}.Debug.Build.0 = Debug|.NET - {41468AF6-24B5-4807-8AF4-7A41FBD2904F}.Release.ActiveCfg = Release|.NET - {41468AF6-24B5-4807-8AF4-7A41FBD2904F}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/embedding/browser/activex/tests/csbrowse/Form1.cs b/embedding/browser/activex/tests/csbrowse/Form1.cs deleted file mode 100644 index 0be864db132..00000000000 --- a/embedding/browser/activex/tests/csbrowse/Form1.cs +++ /dev/null @@ -1,444 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; - -namespace CSBrowse -{ - ///

- /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form - { - private AxMOZILLACONTROLLib.AxMozillaBrowser axMozillaBrowser1; - private System.Windows.Forms.StatusBar statusBar1; - private System.Windows.Forms.Button goBtn; - private System.Windows.Forms.StatusBarPanel statusMessagePane; - private System.Windows.Forms.ToolBar toolBar1; - private System.Windows.Forms.ToolBarButton btnBack; - private System.Windows.Forms.ToolBarButton btnForward; - private System.Windows.Forms.StatusBarPanel statusProgressPane; - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.ToolBarButton btnSep1; - private System.Windows.Forms.ToolBarButton btnStop; - private System.Windows.Forms.ToolBarButton btnReload; - private System.Windows.Forms.ToolBarButton btnHome; - private System.Windows.Forms.MainMenu mainMenu1; - private System.Windows.Forms.MenuItem menuItem1; - private System.Windows.Forms.MenuItem menuExit; - private System.Windows.Forms.MenuItem menuItem2; - private System.Windows.Forms.MenuItem menuAbout; - private System.Windows.Forms.ComboBox url; - private System.Windows.Forms.ToolBarButton btnSep2; - private System.ComponentModel.IContainer components; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); - this.axMozillaBrowser1 = new AxMOZILLACONTROLLib.AxMozillaBrowser(); - this.goBtn = new System.Windows.Forms.Button(); - this.statusBar1 = new System.Windows.Forms.StatusBar(); - this.statusMessagePane = new System.Windows.Forms.StatusBarPanel(); - this.statusProgressPane = new System.Windows.Forms.StatusBarPanel(); - this.toolBar1 = new System.Windows.Forms.ToolBar(); - this.btnBack = new System.Windows.Forms.ToolBarButton(); - this.btnForward = new System.Windows.Forms.ToolBarButton(); - this.btnSep1 = new System.Windows.Forms.ToolBarButton(); - this.btnStop = new System.Windows.Forms.ToolBarButton(); - this.btnReload = new System.Windows.Forms.ToolBarButton(); - this.btnHome = new System.Windows.Forms.ToolBarButton(); - this.imageList1 = new System.Windows.Forms.ImageList(this.components); - this.mainMenu1 = new System.Windows.Forms.MainMenu(); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.menuExit = new System.Windows.Forms.MenuItem(); - this.menuItem2 = new System.Windows.Forms.MenuItem(); - this.menuAbout = new System.Windows.Forms.MenuItem(); - this.url = new System.Windows.Forms.ComboBox(); - this.btnSep2 = new System.Windows.Forms.ToolBarButton(); - ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusMessagePane)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusProgressPane)).BeginInit(); - this.SuspendLayout(); - // - // axMozillaBrowser1 - // - this.axMozillaBrowser1.Enabled = true; - this.axMozillaBrowser1.Location = new System.Drawing.Point(24, 112); - this.axMozillaBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMozillaBrowser1.OcxState"))); - this.axMozillaBrowser1.Size = new System.Drawing.Size(640, 400); - this.axMozillaBrowser1.TabIndex = 3; - this.axMozillaBrowser1.DownloadComplete += new System.EventHandler(this.axMozillaBrowser1_DownloadComplete); - this.axMozillaBrowser1.StatusTextChange += new AxMOZILLACONTROLLib.DWebBrowserEvents2_StatusTextChangeEventHandler(this.axMozillaBrowser1_StatusTextChange); - this.axMozillaBrowser1.NavigateComplete2 += new AxMOZILLACONTROLLib.DWebBrowserEvents2_NavigateComplete2EventHandler(this.axMozillaBrowser1_NavigateComplete2); - this.axMozillaBrowser1.CommandStateChange += new AxMOZILLACONTROLLib.DWebBrowserEvents2_CommandStateChangeEventHandler(this.axMozillaBrowser1_CommandStateChange); - this.axMozillaBrowser1.LocationChanged += new System.EventHandler(this.axMozillaBrowser1_LocationChanged); - this.axMozillaBrowser1.BeforeNavigate2 += new AxMOZILLACONTROLLib.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.axMozillaBrowser1_BeforeNavigate2); - this.axMozillaBrowser1.NewWindow2 += new AxMOZILLACONTROLLib.DWebBrowserEvents2_NewWindow2EventHandler(this.axMozillaBrowser1_NewWindow2); - this.axMozillaBrowser1.DownloadBegin += new System.EventHandler(this.axMozillaBrowser1_DownloadBegin); - // - // goBtn - // - this.goBtn.Location = new System.Drawing.Point(616, 72); - this.goBtn.Name = "goBtn"; - this.goBtn.Size = new System.Drawing.Size(48, 21); - this.goBtn.TabIndex = 4; - this.goBtn.Text = "Go"; - this.goBtn.Click += new System.EventHandler(this.button1_Click); - // - // statusBar1 - // - this.statusBar1.Location = new System.Drawing.Point(0, 539); - this.statusBar1.Name = "statusBar1"; - this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { - this.statusMessagePane, - this.statusProgressPane}); - this.statusBar1.ShowPanels = true; - this.statusBar1.Size = new System.Drawing.Size(696, 22); - this.statusBar1.TabIndex = 5; - this.statusBar1.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar1_PanelClick); - this.statusBar1.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar1_DrawItem); - // - // statusMessagePane - // - this.statusMessagePane.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; - this.statusMessagePane.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None; - this.statusMessagePane.Width = 580; - // - // statusProgressPane - // - this.statusProgressPane.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; - this.statusProgressPane.Text = "statusBarPanel1"; - // - // toolBar1 - // - this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat; - this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.btnBack, - this.btnForward, - this.btnSep1, - this.btnReload, - this.btnStop, - this.btnSep2, - this.btnHome}); - this.toolBar1.ButtonSize = new System.Drawing.Size(32, 32); - this.toolBar1.DropDownArrows = true; - this.toolBar1.ImageList = this.imageList1; - this.toolBar1.Name = "toolBar1"; - this.toolBar1.ShowToolTips = true; - this.toolBar1.Size = new System.Drawing.Size(696, 55); - this.toolBar1.TabIndex = 6; - this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick); - // - // btnBack - // - this.btnBack.Enabled = false; - this.btnBack.ImageIndex = 0; - this.btnBack.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton; - this.btnBack.Tag = "Back"; - this.btnBack.Text = "Back"; - this.btnBack.ToolTipText = "Back one page"; - // - // btnForward - // - this.btnForward.Enabled = false; - this.btnForward.ImageIndex = 1; - this.btnForward.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton; - this.btnForward.Text = "Forward"; - this.btnForward.ToolTipText = "Forward one page"; - // - // btnSep1 - // - this.btnSep1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator; - // - // btnStop - // - this.btnStop.Enabled = false; - this.btnStop.ImageIndex = 4; - this.btnStop.Text = "Stop"; - this.btnStop.ToolTipText = "Stop loading"; - // - // btnReload - // - this.btnReload.ImageIndex = 3; - this.btnReload.Text = "Reload"; - this.btnReload.ToolTipText = "Reload this page"; - // - // btnHome - // - this.btnHome.ImageIndex = 2; - this.btnHome.Text = "Home"; - this.btnHome.ToolTipText = "Go Home"; - // - // imageList1 - // - this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.imageList1.ImageSize = new System.Drawing.Size(32, 32); - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Black; - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem1, - this.menuItem2}); - // - // menuItem1 - // - this.menuItem1.Index = 0; - this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuExit}); - this.menuItem1.Text = "&File"; - // - // menuExit - // - this.menuExit.Index = 0; - this.menuExit.Text = "E&xit"; - this.menuExit.Click += new System.EventHandler(this.menuExit_Click); - // - // menuItem2 - // - this.menuItem2.Index = 1; - this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuAbout}); - this.menuItem2.Text = "&Help"; - // - // menuAbout - // - this.menuAbout.Index = 0; - this.menuAbout.Text = "&About..."; - this.menuAbout.Click += new System.EventHandler(this.menuAbout_Click); - // - // url - // - this.url.Items.AddRange(new object[] { - "http://127.0.0.1/", - "http://127.0.0.1:8080/", - "http://www.mozilla.org/", - "http://www.cnn.com/", - "http://www.yahoo.com/", - "http://www.slashdot.org/", - "http://www.amazon.com/"}); - this.url.Location = new System.Drawing.Point(24, 72); - this.url.MaxLength = 1024; - this.url.Name = "url"; - this.url.Size = new System.Drawing.Size(568, 21); - this.url.TabIndex = 0; - // - // btnSep2 - // - this.btnSep2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator; - // - // Form1 - // - this.AcceptButton = this.goBtn; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(696, 561); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.url, - this.toolBar1, - this.statusBar1, - this.goBtn, - this.axMozillaBrowser1}); - this.Menu = this.mainMenu1; - this.Name = "Form1"; - this.Text = "CSBrowse"; - this.Load += new System.EventHandler(this.Form1_Load); - this.Layout += new System.Windows.Forms.LayoutEventHandler(this.Form1_Layout); - ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusMessagePane)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.statusProgressPane)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - - private void Form1_Load(object sender, System.EventArgs e) - { - - } - - private void button1_Click(object sender, System.EventArgs e) - { - object n = null; - axMozillaBrowser1.Navigate(url.Text, ref n, ref n, ref n, ref n); - } - - private void statusBar1_PanelClick(object sender, System.Windows.Forms.StatusBarPanelClickEventArgs e) - { - - } - - private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) - { - if (e.Button.Equals(btnBack)) - { - axMozillaBrowser1.GoBack(); - } - else if (e.Button.Equals(btnForward)) - { - axMozillaBrowser1.GoForward(); - } - else if (e.Button.Equals(btnStop)) - { - axMozillaBrowser1.Stop(); - } - else if (e.Button.Equals(btnReload)) - { - axMozillaBrowser1.Refresh(); - } - else if (e.Button.Equals(btnHome)) - { - axMozillaBrowser1.GoHome(); - } - } - - private void statusBar1_DrawItem(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent) - { - if (sbdevent.Panel.Equals(statusProgressPane)) - { - - } - } - - private void axMozillaBrowser1_StatusTextChange(object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_StatusTextChangeEvent e) - { - statusMessagePane.Text = e.text; - } - - private void axMozillaBrowser1_CommandStateChange(object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_CommandStateChangeEvent e) - { - if ((e.command & 0x1) != 0) // Forward - { - btnForward.Enabled = e.enable; - } - if ((e.command & 0x2) != 0) // Backward - { - btnBack.Enabled = e.enable; - } - } - - private void axMozillaBrowser1_NewWindow2(object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_NewWindow2Event e) - { - Form1 f = new Form1(); - f.Show(); - object n = null; - f.axMozillaBrowser1.Navigate("about:blank", ref n, ref n, ref n, ref n); - e.ppDisp = f.axMozillaBrowser1.Application; - } - - private void axMozillaBrowser1_DownloadBegin(object sender, System.EventArgs e) - { - btnStop.Enabled = true; - } - - private void axMozillaBrowser1_DownloadComplete(object sender, System.EventArgs e) - { - btnStop.Enabled = false; - } - - private void axMozillaBrowser1_BeforeNavigate2(object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_BeforeNavigate2Event e) - { - } - - private void axMozillaBrowser1_NavigateComplete2(object sender, AxMOZILLACONTROLLib.DWebBrowserEvents2_NavigateComplete2Event e) - { - this.Text = axMozillaBrowser1.LocationName + " - CSBrowse"; - url.Text = axMozillaBrowser1.LocationURL; - } - - private void axMozillaBrowser1_LocationChanged(object sender, System.EventArgs e) - { - url.Text = axMozillaBrowser1.LocationURL; - } - - private void Form1_Layout(object sender, System.Windows.Forms.LayoutEventArgs e) - { - // Resize the browser to fit the new available space - toolBar1.Location = - new Point(this.ClientRectangle.Left, this.ClientRectangle.Top); - - goBtn.Location = new Point( - this.ClientRectangle.Right - goBtn.Width, - toolBar1.Left + toolBar1.Height); - - url.Location = new Point( - this.ClientRectangle.Left, - toolBar1.Left + toolBar1.Height); - url.Size = new Size( - goBtn.Left - url.Left, goBtn.Height); - - statusBar1.Location = new Point( - this.ClientRectangle.Left, - this.ClientRectangle.Bottom - statusBar1.Height); - - axMozillaBrowser1.Location = new Point( - this.ClientRectangle.Left, url.Bottom); - axMozillaBrowser1.Size = new Size( - this.ClientSize.Width, - statusBar1.Top - axMozillaBrowser1.Top); - } - - private void url_TextChanged(object sender, System.EventArgs e) - { - - } - - // Menu handlers - private void menuExit_Click(object sender, System.EventArgs e) - { - this.Close(); - } - - private void menuAbout_Click(object sender, System.EventArgs e) - { - // TODO about message box - MessageBox.Show(this, "CSBrowse Test Application", "CSBrowse"); - } - - - } -} diff --git a/embedding/browser/activex/tests/csbrowse/Form1.resx b/embedding/browser/activex/tests/csbrowse/Form1.resx deleted file mode 100644 index 73648d23e29..00000000000 --- a/embedding/browser/activex/tests/csbrowse/Form1.resx +++ /dev/null @@ -1,724 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAIQAA - AAIBAAAAAQAAAAAAAAAAAAAAAAwAAAAAAwAAkjYAAEkbAAAL - - - - 41, 26 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMA - AADUjAAAAk1TRnQBSQFMAgEBBQEAAQoBAAEEAQABIAEAASABAAT/ASEBEAj/AUIBTQE2BwABNgMAASgD - AAGAAwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ - AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ - AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AXgABzwEEAQIBDAGvASgBGgGJAawBPgEvArcBTgE+ArcB - TgE+AbcBtQFKATkBtwGwAUMBNAG3AasBPgEuAbcBkQEuASABtwF4AR8BFgG3AWgBFwEQAbcBZgEWAQ4B - twFmARYBDgG3AWYBFgEOAbcBZgEWAQ4BtwFmARMBDgG3AW0CDQGsAbgCBAEu/wC5AAHPAQUBAwEQAaIB - OgEnAb8BqQFpAVMB/wHIAY4BegH/AcsBlAGAAf8ByQGRAX0B/wHEAYsBdgH/Ab4BhAFvAf8BqAF0AWIB - /wGSAWQBVgH/AYEBWQFLAf8BewFTAUQB/wF3AUwBPgH/AXEBRwE4Af8BbAFAATAB/wFpATgBKgH/AWgB - LAEkAfYBmQEhARgBlAGqARwBEwFwAaoBHAEUAXABqwEcARMBcAGqARwBEwFwAbIBFgEPAVsBzgEEAQIB - Dv8AoQABzwEFAQQBEAGnAT0BKwG/AbsBgAFqAf8B6wG8AasB/wH0AckBuAH/AfUBywG6Af8B8gHHAbYB - /wHvAcEBsAH/AeoBugGpAf8B5QGyAaEB/wHcAagBlQH/AcsBlgGHAf8BvgGIAXsB/wG6AYEBcAH/AbcB - egFlAf8BsQFvAVoB/wGoAWIBTwH/AZIBWAFEAf8BiQFSAT4B/wGHAVABPQH/AYUBTQE5Af8BgQFIATQB - /wGFATcBKAHXAawBCQESAUMBswEBAQ4BKAGzAQEBCwEoAbIBAAEDASgBxwEAAQEBD/8AkQAB0AEFAQQB - EAGqAUABLgK/AYYBcQH/Ae8BxQG0Af8B+QHSAcEB/wH9AdcByAH/AfwB2AHIAf8B+wHSAcIB/wH5Ac0B - vQH/AfYBxgG2Af8B8QG/Aa8B/wG7AZcBpQH/AagBigGiAf8BxQGhAakB/wHjAbgBrwH/AfEBwwGzAf8B - 8AHDAbIB/wHkAbMBoQH/AdkBpQGSAf8BzwGYAYUB/wHDAYoBdQH/AbABcQFbAf8BhwFKAUYB+QEsAQ0B - TQHjAR0BAwFNAd8BHQEDATwB3wEbAQEBEQHfAY0BAAEEAVT/AJEAAdABBgEFARABrgFGATQBvwHEAYwB - dwH/AfEByQG5Af8B+wHUAcUB/wH9AdkBywH/Af0B2gHKAf8B/QHUAcUB/wH6AcMBsQH/AecBqwGfAf8B - ugGLAZkB/wGCAWoBqAH/AWcBXQGvAf8BcwFlAawB/wG0AZgBtAH/AeIBvgG9Af8B/AHVAcQB/wH5Ac0B - vAH/AfMBxAGzAf8B7QG7AakB/wHmAakBkwH/Ab4BfwFwAf8BfgFLAVkB/wEfARgBbgH/AREBEgF6Af8C - EAFwAf8CBQE+Af8BNwEBAR4BvgF+AQEBCgFo/wCNAAHQAQYBBQEQAbQBTAE6Ab8ByQGRAX4B/wHzAcwB - vQH/AfsB1gHIAf8B/QHaAcwB/wH9AdcByAH/AfwBzAG7Af8B5wGpAZ8B/wG9AYEBjwH/AXoBWQGXAf8B - WQFPAbcB/wFHAUkBxQH/AUQBRQG9Af8BeAFrAbUB/wG1AZoBtwH/AfEBywHCAf8B+gHRAcMB/wH8Ac8B - vgH/AfkBxgGzAf8B7wGrAZYB/wGvAXUBfAH/AWMBQAFzAf8BKwEnAZkB/wEiASQBqgH/AR8BIAGjAf8C - EAF2Af8CBwFFAf8BQwEBAR0Br/8AjQAB0QEHAQUBEAG3AU8BPwG/AcwBlgGDAf8B9AHPAcEB/wH7AdgB - ygH/Af0B2wHNAf8B/QHSAcIB/wH7AboBowH/Ab0BhAGPAf8BegFWAZMB/wFDAUIBuQH/AVEBVgHbAf8B - XAFiAe0B/wFbAWAB7AH/AkkBwgH/AXcBaQGzAf8B1AGyAbsB/wHyAcoBwgH/AfsBywG5Af8B9QG5AaQB - /wHYAY8BggH/AYMBVgGCAf8BNgEuAZsB/wE5AToB1gH/ATcBOQHiAf8BMAExAdYB/wEhASIBsQH/AhAB - dwH/AUUBAwE6Aa//AI0AAdEBBwEGARABvAFXAUUBvwHRAZ4BigH/AfYB1AHFAf8B/AHaAcwB/wH9AdIB - wQH/AfwBwgGtAf8B9QGqAZIB/wGvAXgBjgH/AW4BVAGgAf8BTwFQAc0B/wFcAWEB5AH/AWQBagHvAf8B - YwFoAe8B/wFZAVwB3gH/AVoBWAHHAf8BbAFgAa8B/wG4AZUBrwH/AdcBogGhAf8BzQKRAf8BgQFcAY8B - /wFWAUUBqgH/AT8BPgHLAf8BQQFDAeIB/wE9AUAB5gH/ATUBNwHbAf8BKAEqAcAB/wIVAYQB/wFJAQcB - QwGv/wCNAAHRAQcBBgEQAcABWwFLAb8B1AGiAY8B/wH2AdUBxgH/AfwB2gHNAf8B/QHUAcQB/wH8AcYB - sQH/AfgBsAGXAf8BywGNAZEB/wGWAW0BnAH/AWIBVQG8Af8BXwFeAdcB/wFjAWkB6QH/AWoBcAHxAf8B - ZQFrAewB/wFbAV8B3QH/AlIBxQH/AXwBaAGwAf8BjAFrAZ4B/wGFAWEBlwH/AVcBSwGxAf8BSgFIAc0B - /wFJAUsB4wH/AUcBSgHoAf8BPwFCAeAB/wEyATQBygH/AR8BIAGjAf8BDwEQAW8B/wFHAQUBOAGv/wCN - AAHSAQgBBwEQAcUBYQFRAb8B1wGlAZQB/wH3AdUByAH/AfsB2wHPAf8B/QHbAc0B/wH9AdUBxAH/Af0B - xQGsAf8B8wGwAZoB/wHRAZIBkwH/AYoBZAGdAf8BagFeAb8B/wFhAWQB3AH/AW4BdQHxAf8BbQF0AfIB - /wFpAW8B7wH/AWIBZwHmAf8BUwFQAcMB/wFLAUUBsQH/AUgBQwGyAf8BTwFRAdYB/wFRAVUB5gH/AVEB - VAHqAf8BSgFNAecB/wE7AT4BzwH/ASgBKgGpAf8CEgF1Af8BHwEGAUcB4QFfAQEBIQGO/wCNAAHSAQkB - BwEQAckBZwFXAb8B2wGqAZkB/wH5AdcBywH/Af0B3wHTAf8B/gHiAdYB/wH+AeMB1gL/AeAB0AH/AfwB - xgGwAf8B9AGtAZcB/wHmAZ4BkgH/AZUBcwGnAf8BZwFgAcYB/wFqAXEB6wH/AXEBeAHxAf8BcgF5AfMB - /wFuAXQB8QH/AWQBagHnAf8BXgFjAeMB/wFcAWEB5AH/AV0BYgHrAf8BWgFfAe0B/wFUAVgB6QH/AUcB - SwHcAf8BLwExAa4B/wIZAX8B/wIOAVgB/wF8AQUBIwFvAcYBAAEEARD/AI0AAdMBCQEIARABzgFtAV4B - vwHgAbIBogH/AfsB3QHTAf8B/gHkAdkC/wHnAdsC/wHnAdsB/wH+AeUB2QH/Af4B1gHFAf8B/AHEAbAB - /wH5AbYBnwH/Ac0BmwGkAf8BmwF9AbMB/wFlAV8BygH/AWkBbAHgAf8BbwF2Ae4B/wF1AXwB9AH/AW8B - dgHxAf8BagFwAe8B/wFnAW0B7wH/AWMBagHwAf8BWgFfAekB/wFLAU8B2AH/ATQBNQG2Af8CHwGGAf8B - LgENAVMB1wGBAQYBIwFqAbcBAgELAST/AI0AAcsBDAEJASEBvwEoAR8BYgHNAXwBbQHVAeUBuwGsAf8B - /QHkAdoB/wH+AecB3QL/AeoB3wL/AekB3gH/Af4B5gHbAf8B/gHfAdMB/wH+AdYBxgH/Af0ByQG1Af8B - 8QG7AasB/wHPAaABqgH/AZMBdgGwAf8BbgFnAc0B/wFoAWwB5AH/AXkBgAH1Af8BdgF9AfUB/wFyAXkB - 9AH/AW0BdAHyAf8BZwFuAfAB/wFVAVkB3QH/ATwBPwG+Af8CIgGTAf8CEgFcAf8BOwEGASgBvwHHAQEB - AwEQ/wCRAAG9ASQBGgFgAZsBZQFMAf8ByAGWAYIB/wHpAcUBtgH/Af4B6gHgAf8B/gHoAd4C/wHrAeAC - /wHsAeEB/wH+AeUB2wH/Af0B4wHYAf8B/QHgAdQB/wH8AdoBzQH/AfwBzQG6Af8B9gG/AawB/wHpAbEB - pwH/AYEBbQG+Af8CYgHZAf8BfQGEAfQB/wF7AYMB9gH/AXcBfgH1Af8BcQF4AfIB/wFpAXAB7QH/AUwB - TwHNAf8BKgEsAaMB/wIYAYAB/wIKAToB/wE2AQEBBgG/AcYCAAEQ/wCRAAHDASkBHwFgAawBcQFaAf8B - 0wGkAZIB/wHuAc4BwQH/Af4B7AHjAf8B/gHqAeEC/wHsAeIC/wHsAeIB/wH+AekB3wH/Af0B5gHcAf8B - /QHiAdgB/wH9Ad0B0gH/AfIBygHCAf8BzQGmAboB/wGIAW8BvAH/AXMBbwHXAf8BdAF6AeoB/wGFAY0B - 9wH/AYABiQH3Af8BfAGDAfYB/wF2AX0B9AH/AXEBdwHyAf8BXwFkAeIB/wFGAUkBxgH/AicBnAH/AhQB - YwH/ATwBBwEuAb8BxwEBAQQBEP8AkQABxgErASIBYAG0AXcBYQH/AdsBsQGhAf8B8gHYAcwB/wH+Ae8B - 5gH/Af4B7AHjAv8B7AHjAv8B7AHiAf8B/gHrAeEB/wH9AegB3QH/AfwB4gHXAf8B+gHXAcwB/wHNAa8B - yAH/AaABiwHMAf8BdwFzAdoB/wF/AYQB6wH/AYUBjwH1Af8BigGTAfkB/wGBAYoB9QH/AXsBgwH0Af8B - dwF+AfMB/wF0AXsB8wH/AWsBcgHuAf8BWwFhAd8B/wFBAUQBwQH/ASgBKQGTAf8BLAESAWIB3wFpAQcB - MAGIAa4BAwERATD/AIkAAbYCAAEmAawBLAEjAYMBuQF7AWUB/wHhAb4BrwH/AfUB4gHYAf8B/gHwAegB - /wH+Ae0B5AH/Af4B7AHjAf8B/gHrAeIB/wH+AesB4QH/AfwB5gHbAf8B8wHZAdQB/wHcAbwByAH/AaEB - kAHSAf8BgwF/AeAB/wGJAZIB9AH/AZIBnAH5Af8BkgGdAfsB/wGMAZYB+AH/AXkBgAHtAf8BbgF0AegB - /wFrAXEB6AH/AXIBegHwAf8BcQF5AfMB/wFqAXEB7wH/AVsBYAHhAf8BPwFDAb8B/wIlAZUB/wIRAWYB - /wFuAQcBLgGDAbYBAgEKASb/AIUAAVECAAGkAVMBLAElAfUBvwGAAWoB/wHnAcsBvgH/AfoB7AHjAf8B - /gHyAeoB/wH+Ae4B5gH/Af4B7QHkAf8B/gHsAeIB/wH+AeoB4AH/AfoB4QHWAf8B2QHBAdIB/wGHAXoB - 1wH/AYMBggHoAf8BjgGWAfUB/wGiAa0B/QH/AZ0BqAH+Af8BlwGhAfwB/wGLAZUB9gH/AWQBZQHaAf8B - TwFNAcsB/wFMAUoBygH/AWkBbwHnAf8BcQF4AfEB/wFvAXYB8wH/AWgBbgHwAf8BVwFcAd4B/wE+AUEB - vgH/AhwBjAH/ARYBDgFXAfUBUQEGASkBpP8AhQABcwEOAQsBrwF6AT4BMwH/Ac8BiwF1Af8B7wHTAcgB - /wH8AfAB5wH/Af4B8QHqAf8B/gHuAecB/wH+Ae0B5QH/Af0B6gHhAf8B+gHhAdcB/wHRAboB1wH/AaYB - mAHdAf8CiQHqAf8BmgGhAfYB/wGnAbIB/AH/AaoBtgL/AZ0BpwH8Af8BiAGQAfMB/wFyAXUB5AH/AZEB - gwHOAf8BmwGFAb8B/wGVAX0BugH/AWwBZAHJAf8BZgFoAd0B/wFqAXEB7gH/AWoBcAHxAf8BYQFnAesB - /wFRAVUB2gH/ATkBOwG6Af8BIAEiAYgB/wFQAQ4BSQGv/wCFAAGHAR4BFwGvAZIBUwFHAf8B3QGcAYgB - /wH1AdwB0gH/Af0B8gHrAf8B/gHwAekB/wH+Ae4B6AH/Af4B7gHlAf8B/QHrAeAB/wH6AeMB2AH/AcEB - rgHaAf8BkgGHAeQB/wGIAY4B9gH/AacBsQH8Af8BtwHDAv8BsAG8Av8BkgGaAfYB/wGGAYoB7AH/AY8B - iwHfAf8BxQGxAdEB/wHaAbkBwQH/AdEBpwGyAf8BiQFtAasB/wFmAVwBwAH/AVoBXwHcAf8BZwFuAe4B - /wFlAWsB8AH/AVoBXwHmAf8BRAFHAcwB/wEnASkBnQH/AVIBEAFZAa//AIUAAYQBLAEkAa8BkgFpAVwB - /wHlAbMBoQH/AfgB5gHcAf8B/gHzAe0B/wH9Ae4B6AH/Af4B8AHqAv8B8AHnAf8B/gHuAeMB/wH8AfAB - 4AH/Ac8BvwHgAf8BoAGUAeYB/wGBAYQB9gH/AaUBrQH8Af8BtwHDAf4B/wGuAbkB/QH/AYQBiAHuAf8B - lwGVAecB/wHaAdAB5gH/AfQB5QHhAf8B/QHdAc4B/wHxAcABsQH/AbYBhQGQAf8BbwFWAZoB/wE/AUAB - ugH/AV0BYwHiAf8BYQFnAesB/wFXAVsB4QH/ATwBPwHAAf8BIgEjAZIB/wFOAQwBUgGv/wCFAAGGAS4B - JgGvAZYBcwFnAf8B7QHIAboB/wH6AewB5QL/AfUB8QH/Af4B8wHtAv8B9gHwAv8B+AHxAv8B+AHwAf8B - /gH2AekB/wH0AeEB3gH/AdYBwAHbAf8BmQGOAekB/wKUAfQB/wGMAZMB+AH/AXsBfwHyAf8BnAGaAewB - /wHHAcEB7AH/AfcB7gHtAf8B/QHyAesB/wH9AeUB2gH/Ae8ByAG5Af8BsgGBAXcB/wFeAUQBZwH/AiAB - ewH/ATgBOwG1Af8BQwFGAccB/wE+AUEBvgH/ASEBIgGVAf8CEQFcAf8BRwEFASgBr/8AhQABowFCATcB - rwGzAY0BfwH/AfQB2gHQAf8B/AHyAewB/wH+AfgB9AH/Af4B9wHyAf8B/gH5AfMC/wH7AfUC/wH7AfUB - /wH+AfYB7QH/Af4B7AHhAf8B8QLZAf8BzgG4AdwB/wGrAaMB6wH/ApgB8gH/AZoBmAHuAf8ByAHDAe0B - /wHqAeMB7wL/AfgB8QH/Af4B9AHtAf8B+wHjAdoB/wHrAcUBtgH/AbEBgAFvAf8BjAE7AUIBvAFoAQ0B - OQGRASkBHQFxAe4BJwEpAZYB/wElAScBlQH/AhEBWwH/AU0BBwEuAasBkAEBAQ4BUv8AhQABxAFbAU0B - rwHVAaoBmwH/AfkB6QHiAf8B/QH2AfIB/wH+AfoB9wH/Af4B+wH3Af8B/gH5AfUC/wH7AfcC/wH7AfcB - /wH+AfcB8QH/Af4B8QHoAf8B/QHpAeAB/wH5AeEB2gH/AdEBxgHoAf8BvwG5Ae0B/wHLAcMB5gH/AeUB - 2gHgAf8B8wHnAeAB/wH3Ae0B5wH/AfgB7AHlAf8B9QHaAdAB/wHmAboBqwH/AbEBfwFtAf8BugE4AS8B - gAG3AQIBCwEkAVIBCgEwAacBRQEQAVUBvwFFARABWwG/ATwBBwElAb8BmQECAQ0BSP8AiQAB3gFyAWMB - rwHtAcIBtAH/AfwB8wHuAf8B/gH4AfYB/wH+AfsB+AL/AfwB+QH/Af4B+gH3Av8B+wH5Av8B/AH5Af8B - /gH7AfcB/wH+AfgB9AH/Af4B9QHvAf8B/gHyAesB/wH9AfUB8QH/AfYB7gHpAf8B6AHaAdMB/wHXAcEB - twH/AdQBvQGzAf8B3gHLAcMB/wHoAdYBzwH/AekByQG9Af8B3gGqAZgB/wGwAXoBaAH/AbsBNwEuAYAB - 0QIAAQIBzQEAAQIBBwHNAQEBBAEIAc0BAQEEAQgBzAEAAQIBCAHRAQABAQED/wCJAAHkAXwBbgGvAfIB - zQHAAf8B/QH3AfQB/wH+AfsB+QH/Af4B/AH7Af8B/gH8AfoB/wH+AfsB+AH/Af4B+wH4Af8B/gH7AfgB - /wH+AfoB9wH/Af4B+AH1Af8B/gH3AfMB/wH+AfgB9AH/Af4B+gH3Af8B7gHjAd0B/wHLAa4BogH/AcgB - mgGJAf8ByQGUAYEB/wHOAZoBhwH/Ac4BmwGKAf8BzwGZAYUB/wHFAYUBcgH/AYsBNwEvAf8BpwERAQ4B - gP8AnQABzQE5AS4BaAHmAZgBiAHQAfYB2AHMAf8B/gH7AfkB/wH+Av0B/wL+Af0B/wH+Af0B/AH/Af4B - +wH5Af8B/gH7AfgB/wH+AfsB+AH/Af4B+wH5Af8B/gH6AfgB/wH+AfoB+AH/Af4B/AH5Af8B/gH7AfoB - /wHoAdkB0wH/AboBjgF9Af8BzAGUAYAB/wHWAZgBggH/AdgBmQGDAf8B1QGTAX0B/wG4AX8BagH/AZUB - WAFJAfIBlAETAQ8BqwGzAgABTP8AnQABygGRAXUB/wHoAb0BqgH/AfkB4QHZAv8B/gH9B/8B/gH/Av4B - /QH/Af4B/AH6Av8B/AH5Av8B/AH5Av8B/QH7Av8C/AL/Af0B/AH/Av4B/QH/AfwB+gH5Af8B5gHUAcsB - /wG3AYEBawH/Ad4BqAGUAf8B8QG5AaYB/wHwAbYBowH/AeUBpgGRAf8BpwFvAV8B8QFtASkBIgHDAbwB - CQEIASr/AKEAAekBpwGPAf8B9AHNAb4B/wH8AekB4wH/Av4B/QH/Af4B/QH8Af8B/gH9AfwC/wH+Af0B - /wH+AfwB+wL/Af0B+wL/Af0B+wH/Af4B/AH6Af8B/gH7AfkB/wH+AfsB+QH/Af4B/AH6Af8B+AHxAe0B - /wHoAdEBxgH/AcsBmgGEAf8B6AG8Aa0B/wH0AcUBswH/AesBsAGcAf8BogF2AWcB/wGfATkBMwGhAcAB - BwEGASMBzgECAQEBCP8AoQAB8wGuAZcB/wH4AcgBtwH/AfsB2gHPAf8B/QHmAd4B/wH9AegB4AH/Af0B - 6QHjAf8B/QHrAeUB/wH9AewB5gH/Af4B7wHpAf8B/gHxAewB/wH+AfIB7gH/Af0B9AHvAf8B/QH1AfEB - /wH+AfYB8wH/AfYB5wHfAf8B6wHSAcUB/wHgAbgBpgH/AfABwgGxAf8B2QGrAZoB/wGlAXYBZQH2AakB - OwEyAZQBvAEVARIBP/8AqQAB7QF+AW4BtwHaAZoBjAHpAeMBswGlAf8B+QHIAbgB/wH6Ac0BvAH/AfsB - zwHAAf8B+wHRAcMB/wH8AdQBxgH/Af0B1wHJAf8B/QHZAc0B/wH9AdwB0QH/Af0B3gHTAf8B/QHfAdQB - /wH9AeEB1wH/AfUB1AHFAf8B8AHKAbgB/wHxAcUBtAH/AeEBsAGdAf8BuwF8AW4B5AGMATQBLQGsAcAB - DgEMAS7/ALEAAZICNQGvAaQBcAFnAf8B8wGrAZMB/wH0AbABlgH/AfYBswGZAf8B+AG0AZwB/wH5AbQB - nAH/AfoBtAGcAf8B+wG0AZwB/wH7AbYBnQH/AfwBtQGdAf8B/AG1AZ0B/wH8AbYBngH/AfYBsgGYAf8B - 9QGyAZcB/wH6AbYBnwH/Aa4BfwFrAf8BpgFAATQBn/8AzQABwQIBARcBXgIGAZUBUgETARIBtwFmASUB - IgG3AYIBQQE5AbcBkQFKAUMBtwGZAU8BSwG3AZ4BUwFPAbcBoAFVAVABtwGjAVcBUgG3AaUBVwFQAbcB - oAFTAU4BtwGbAU4BRgG3AZUBRgFAAbcBjwFBATkBtwF8ATEBKgG3AWMBHQEYAbcBVAETAREBtwGSAQkB - CAFcNAABwQIBARcBXgIGAZUBUgETARIBtwFmASUBIgG3AYIBQQE5AbcBkQFKAUMBtwGZAU8BSwG3AZ4B - UwFPAbcBoAFVAVABtwGjAVcBUgG3AaUBVwFQAbcBoAFTAU4BtwGbAU4BRgG3AZUBRgFAAbcBjwFBATkB - twF8ATEBKgG3AWMBHQEYAbcBVAETAREBtwGSAQkBCAFcPAABhwIBAVwBQAIGAbcBTwEXARgBtwFuATgB - OQG3AY4BWgFcAbcBqAF2AXkBtwGTAV8BYgG3AXoBRQFGAbcBYwIsAbcBVwEdASIBtwFNARIBGwG3AUUB - CQETAbcBQgEGAQsBtwGAAQIBBQFnQAABzQEIAQYBFwGrATMBKAGVAagBRgE4AbcBsAFLAT4BtwGrAUgB - OwG3AaUBQwE2AbcBoAE+ATEBtwGYATQBKgG3AXUBIgEbAbcBYQEXAREBtwFjARcBEgG3AWMBFwESAbcB - YwEXARIBtwFhARYBEQG3AVcBEAELAbcBjAEIAQYBZzwAAbMCCQExAYACFwGCAUQBKwEoAeQBRQE9AToB - /wFdAVIBTQH/AXwBcAFoAf8BkgGBAXoB/wGhAY0BhwH/AakBlAGOAf8BrgGXAZEB/wGyAZkBkgH/AbQB - mgGSAf8BsgGXAY8B/wGuAZMBiQH/AacBigGBAf8BlwF7AXAB/wF5AWABVgH/AVYBQgE6Af8BRgE0AS4B - /wFrASIBHgG4AaIBDwEOAVsBywICAQ4oAAGzAgkBMQGAAhcBggFEASsBKAHkAUUBPQE6Af8BXQFSAU0B - /wF8AXABaAH/AZIBgQF6Af8BoQGNAYcB/wGpAZQBjgH/Aa4BlwGRAf8BsgGZAZIB/wG0AZoBkgH/AbIB - lwGPAf8BrgGTAYkB/wGnAYoBgQH/AZcBewFwAf8BeQFgAVYB/wFWAUIBOgH/AUYBNAEuAf8BawEiAR4B - uAGiAQ8BDgFbAcsCAgEOLAABxwIAAQ4BiAIAAVsBRAIMAbgBGwEgASEB/wE3AUABQwH/AVYBYAFjAf8B - ewGGAYoB/wGqAbkBvAH/AZgBpgGqAf8BgQGNAZAB/wFqAXUBeAH/AUwBUwFkAf8BMwE2AVMB/wIhAUMB - /wIbATcB/wFHARMBKAHAAYIBDAEaAXABfQEHARABcAF6AQQBBwFwAYgCAAFbAccCAAEOLAABzAEMAQoB - IAGjAU8BPwHPAa4BdwFjAf8BxAGMAXgB/wHAAYgBdQH/AbsBgwFvAf8BtQF9AWkB/wGrAXMBYQH/AY0B - XwFRAf8BeAFTAUYB/wF1AU8BQgH/AW8BSgE9Af8BagFEATgB/wFjAT8BMgH/AVMBMwEoAf8BdQEmAR0B - wAGmAR0BFwFwAaYBHQEXAXABpgEdARcBcAGmAR0BFwFwAaUBHQEXAXABlAESAQ4BcAGaAQgBBgFUAc4B - AQEAAQcUAAHSAgABAwHBAgYBHgGCAR4BHQGGAUIBPwE+Af8BZwFdAVoB/wF+AXEBbQH/AZIBggF9Af8B - pQGVAZAB/wG5AagBowH/AcoBuAGxAf8B0wG+AbgB/wHXAcIBuwH/AdsBwwG9Af8B3gHFAb4B/wHhAcUB - vQH/AeIBxQG8Af8B4AHCAbgB/wHKAawBowH/Aa4BkAGGAf8BkAFzAWgB/wF9AWABVQH/AWUBRgFAAf8B - ZAEpAScB1wGyAQ8BDQFDAbkBBQEEASgBuwEBAQABHgHRAgABAxQAAdICAAEDAcECBgEeAYIBHgEdAYYB - QgE/AT4B/wFnAV0BWgH/AX4BcQFtAf8BkgGCAX0B/wGlAZUBkAH/AbkBqAGjAf8BygG4AbEB/wHTAb4B - uAH/AdcBwgG7Af8B2wHDAb0B/wHeAcUBvgH/AeEBxQG9Af8B4gHFAbwB/wHgAcIBuAH/AcoBrAGjAf8B - rgGQAYYB/wGQAXMBaAH/AX0BYAFVAf8BZQFGAUAB/wFkASkBJwHXAbIBDwENAUMBuQEFAQQBKAG7AQEB - AAEeAdECAAEDIAABugIBASABLQIFAc8BHwEjASQB/wFAAUoBTAH/AV0BbQFyAf8BawF4AXwB/wGIAZMB - lwH/AcMB0gHXAf8BwQHRAdYB/wG4AcgBzQH/Aa0BvgHDAf8BgAGKAacB/wFaAV4BjwH/AjwBeQH/AjYB - bQH/AiwBWgH/AiEBRgH/AhkBMgH/ARIBEwEeAf8BLAEMAQ0B1wGgAgUBQwG0AgIBKAG6AgEBHgHRAgAB - AyAAAc4BDgELASABrwFZAUoBzwHMAZQBfwH/AfIBuQGkAf8B8gG5AaQB/wHwAbYBoQH/AewBsgGcAf8B - 5gGrAZUB/wHeAaIBjgH/AdUBmwGGAf8BzQGUAX8B/wHDAYkBdQH/AbkBfwFrAf8BrQF1AWEB/wGdAWgB - VAH/AY4BXAFLAf8BgQFTAUQB/wF/AVIBQgH/AX0BUAFAAf8BewFOAT4B/wF3AUsBPAH/AUsBLgElAf8B - VAETAQ8BvwHIAQIBAQEQFAABywIDAQ4BbgEhAR8BpwFfAUgBRgHtAXkBcAFrAf8BiwF+AXoB/wGlAZcB - lAH/Ab0BrwGsAf8BygG8AbkB/wHOAcEBvQH/Ac8BwwHAAf8B0AHEAcAB/wHSAcUBwQH/AdQBxgHBAf8B - 1wHHAcEB/wHbAcgBwgH/AeABygHFAf8B5gHNAcYB/wHrAc4BxQH/AekBywHAAf8B3AG+AbEB/wGvAZEB - hQH/AYwBbQFiAf8BcwFPAUUB+QFqATwBMgHjAUABGgEWAd8BTQEEAQMBpwHHAgABDhQAAcsCAwEOAW4B - IQEfAacBXwFIAUYB7QF5AXABawH/AYsBfgF6Af8BpQGXAZQB/wG9Aa8BrAH/AcoBvAG5Af8BzgHBAb0B - /wHPAcMBwAH/AdABxAHAAf8B0gHFAcEB/wHUAcYBwQH/AdcBxwHBAf8B2wHIAcIB/wHgAcoBxQH/AeYB - zQHGAf8B6wHOAcUB/wHpAcsBwAH/AdwBvgGxAf8BrwGRAYUB/wGMAW0BYgH/AXMBTwFFAfkBagE8ATIB - 4wFAARoBFgHfAU0BBAEDAacBxwIAAQ4gAAG9AgQBIAE8ARcBGAHPAUQBTQFQAf8BbQF9AYEB/wFsAX0B - ggH/AXIBfwGDAf8BjAGXAZsB/wHJAdgB3AH/AccB1gHbAf8BvwHOAdQB/wG2AccBzAH/AYkBkwGyAf8B - YwFnAZsB/wJFAYgB/wJBAYMB/wI9AXwB/wI7AXcB/wE/AUABcQH/AUABRgFgAf8BPAE/AUMB+QEtAhsB - 4wEkAgoB3wFMAgQBpwHHAgABDiAAAc4BDgEMASABsQFdAUwBzwHRAZoBhgH/AfkBwgGtAf8B+wHEAa8B - /wH8AcUBsAH/AfsBwgGtAf8B9wG9AagB/wH0AboBpQH/AfMBuQGjAf8B8wG4AaMB/wH0AbkBogH/AfIB - twGhAf8B8AGzAZ0B/wHtAbMBnAH/AecBrAGVAf8B3QGiAYwB/wHQAZYBgQH/AcUBjAF3Af8BuQGAAWsB - /wGqAXIBXgH/AWYBQwE2Af8BXAEWARIBvwHJAgIBEBAAAbACDAE5AXYBJQEjAZ4BagFNAUsB5QF5AXEB - bgH/AZcBjgGKAf8BqwGhAZ4B/wG6AbIBsAH/AcUBvgG8Af8ByAHCAcEB/wHIAcMBwgH/AcgBwwHCAf8B - yAHDAcIB/wHIAcMBwgH/AcoBwwHBAf8BzAHEAcIB/wHPAcUBwgH/AdUBxwHEAf8B2wHKAcQB/wHjAc0B - xwH/AekB0AHIAf8B6gHPAcQB/wHaAbwBsQH/AcABoQGVAf8BngF+AXIB/wF1AVYBSgH/AUsBNgEuAf8B - WQEZARYBvwHJAgIBEBAAAbACDAE5AXYBJQEjAZ4BagFNAUsB5QF5AXEBbgH/AZcBjgGKAf8BqwGhAZ4B - /wG6AbIBsAH/AcUBvgG8Af8ByAHCAcEB/wHIAcMBwgH/AcgBwwHCAf8ByAHDAcIB/wHJAcMBwgH/AcoB - xAHBAf8BywHEAcEB/wHPAcUBwgH/AdUBxwHEAf8B2wHKAcQB/wHjAc0BxwH/AekB0AHIAf8B6gHPAcQB - /wHaAbwBsQH/AcABoQGVAf8BngF+AXIB/wF1AVYBSgH/AUsBNgEuAf8BWQEZARYBvwHJAgIBEBwAAaQC - CgFDAWcCHwGkAVcBUQFTAewBaQF2AXsB/wF8AYwBkQH/AXQBhAGJAf8BdgGDAYYB/wGPAZoBngH/AcwB - 2gHeAf8BygHZAd4B/wHEAdMB2AH/Ab0BzQHSAf8BjwGZAbkB/wFoAWwBoQH/AkgBjwH/AkUBiwH/AkIB - hgH/AkMBgwH/AU0BUQGGAf8BZgFxAY8B/wF2AYgBjwH/AWIBcgF3Af8BUAFdAWEB/wFLAT8BQQHlAVwB - DgEPAZ4BpwIEATkYAAGtAQoBBwFDAYIBIwEaAqQBZQFUAewB1AGfAYsB/wH7AcYBsgH/Af0ByAGzAf8B - /QHIAbMB/wH9AcYBsgH/AfsBxAGvAf8B+gHCAa0B/wH5AcABqwH/AfkBwAGrAf8B/AHFAa4B/wH9AcIB - qwH/AfoBugGiAf8B+AG3AZ0B/wHwAawBkwH/AecBogGIAf8B5wGmAY4B/wHmAagBkQH/AeEBpQGOAf8B - 0AGUAX8B/wF4AVIBRQH/AV0BGQETAb8ByQICARAMAAGsAgcBNwF9ASMBIgGSAVIBUAFMAf8BewF1AXIB - /wGYAZEBjwH/Aa0BpwGmAf8BvQK4Af8BwwLAAf8DwwH/AcIBwwHEAf8BwgLEAf8BvwHCAcAB/wG0AbwB - tgH/AZsBrgGcAf8BjwGnAY0B/wGSAagBkAH/Aa8BtwGsAf8BwwHAAbwB/wHNAcUBwgH/AdQBxgHDAf8B - 3AHKAcUB/wHlAc4BxgH/Ae0B0gHIAf8B4wHFAbsB/wHKAasBnwH/AZ4BfQFxAf8BdAFXAU4B/wFuATMB - LQHTAaQCDgFbAcMCBAEeCAABrAIHATcBfQEjASIBkgFSAVABTAH/AXsBdQFyAf8BmAGRAY8B/wGtAacB - pgH/Ab0CuAH/AcMCwAH/A8MB/wHCAcMBxAH/AcICxAH/AcICxAH/AcACwwH/AawBtwGsAf8BmAGsAZcB - /wGKAaQBhwH/AZ8BrgGaAf8BtgG5Aa4B/wHNAcQBwQH/AdQBxgHDAf8B3AHKAcUB/wHlAc4BxgH/Ae0B - 0gHIAf8B4wHFAbsB/wHKAasBnwH/AZ4BfQFxAf8BdAFXAU4B/wFuATMBLQHTAaQCDgFbAcMCBAEeEAAB - 0AIBAQUBpwIHATwBcgElASYBnQFKAVIBVAH/AXgBhgGKAf8BhAGVAZoB/wGCAZIBlwH/AXkBiAGMAf8B - egGGAYkB/wGTAZ4BoQH/AdEB3gHjAf8BzwHdAeIB/wHJAdgB3AH/AcUB1AHZAf8BmQGjAcEB/wF9AYEB - sAH/Am0BpgH/AmABnQH/AlEBkgH/AUcBSAGJAf8BVQFZAY8B/wF9AYsBqQH/AZ8BtgG+Af8BmAGvAbcB - /wGHAZ0BpAH/AWEBcQF2Af8BFwEbAR0B/wGKAQcBCAFgGAABmgEWAQ8BcAFeATsBLAH/AaIBcAFdAf8B - 2AGkAZEB/wH8AckBtgH/AfwByQG2Af8B/QHIAbUB/wH9AcgBtAH/AfwByAGzAf8B+wHGAbEB/wH7AcUB - sAH/AfoBxAGvAf8B/QHEAawB/wH8AbcBnAH/AfYBoQGBAf8B6AGUAXUB/wHgAYsBbAH/Ad0BhwFnAf8B - 4AGRAXQB/wHsAacBjQH/AfMBtgGfAf8B5AGoAZMB/wGCAVwBTwH/AV0BGQETAb8ByQICARAMAAFZAhcB - rwFEAUIBQQH/AX8BegF3Af8BlAGPAYwB/wGsAagBpwH/AcABvgHAAf8BvwHAAcIB/wHAAcMBxAH/AcAB - xAHGAf8BwQHGAcgB/wHBAccByAH/AbUBwAG7Af8BkAGuAZQB/wFFAYUBRwH/ARwBbwEcAf8BIQFwASEB - /wF2AZwBeAH/AasBtgGsAf8BwwLCAf8ByAHDAcIB/wHPAcQBwgH/AdcBxwHDAf8B4QHMAcUB/wHtAdMB - ygH/AfAB0gHGAf8B1gG4AawB/wGgAYABdAH/AW4BTQFDAf8BTgIoAf8BnAIPAWUBzwIAAQUEAAFZAhcB - rwFEAUIBQQH/AX8BegF3Af8BlAGPAYwB/wGsAagBpwH/AcABvgHAAf8BvwHAAcIB/wHAAcMBxAH/AcAB - xAHGAf8BwQHGAcgB/wHCAccByQH/AcEBxwHJAf8BugHEAcIB/wF2AaABegH/ATgBfgE6Af8BCgFjAQoB - /wFDAX8BQwH/AYABnwGBAf8BvgG/AbsB/wHHAcEBwAH/Ac4BxAHCAf8B1wHHAcMB/wHhAcwBxQH/Ae0B - 0wHKAf8B8AHSAcYB/wHWAbgBrAH/AaABgAF0Af8BbgFNAUMB/wFOAigB/wGcAg8BZQHPAgABBQgAAdEC - AAEDAcICAgEXAUkBGQEaAcEBTgFVAVgB/wGOAZwBoQH/AZgBqAGtAf8BkgGjAagB/wGGAZYBmwH/AXwB - iwGPAf8BfQGIAYsB/wGXAaEBpAH/AdkB5wHrAf8B1gHjAegB/wHPAd0B4gH/Ac4B3QHiAf8BqQGyAc0B - /wGlAakBygH/ArcB1AH/ApcBvwH/Am8BpQH/AUwBTQGOAf8BWAFcAZQB/wGBAY4BrQH/AaUBuwHDAf8B - oAG4Ab8B/wGZAbEBuAH/AXUBiAGNAf8BHwEjASUB/wGNAQoBCwFgGAABqwEgARkBcAGAAVABPwH/Aa4B - egFnAf8B3AGpAZYB/wH9AcwBuQH/AfsBygG3Af8B/AHJAbYB/wH8AckBtgH/Af0BygG2Af8B/AHKAbYB - /wH8AcoBtgH/Af0ByAG0Af8B/QG6AZ8B/wH4AZoBdgH/AewBbgFAAf8BygFYAS4B/wHHAVgBLwH/AdEB - YgE5Af8BxAFdATcB/wHZAYcBagH/Ae8BsQGaAf8B5QGpAZQB/wGDAV0BUAH/AV8BGQEVAb8BygICARAM - AAFxAi4BrwFfAVsBWgH/AYwBhwGFAf8BpwKlAf8CuAG5Af8BwQHEAcUB/wHDAccByQH/AcUBygHMAf8B - xQHMAc4B/wHGAc0BzwH/AaoBwAGyAf8BfQGrAYMB/wE6AZABPQH/ASkBkAEtAf8BIQGRASYB/wEgAY8B - JAH/AUgBkgFMAf8BfwGlAYMB/wG9AcIBwQH/AsIBwwH/AccCwwH/Ac0BxAHCAf8B1QHHAcMB/wHhAc0B - xgH/AesB0QHIAf8B7AHNAcMB/wHAAaABlQH/AZABcQFlAf8BaQFKAUIB/wFPAR8BHQHXAXACBgGDBAAB - cQIuAa8BXwFbAVoB/wGMAYcBhQH/AacCpQH/ArgBuQH/AcEBxAHFAf8BwwHHAckB/wHFAcoBzAH/AcYB - zAHPAf8ByAHOAdEB/wHJAc8B0wH/AboByQHFAf8BkwG1AZkB/wFNAZoBUgH/ASMBjQEnAf8BHgGSASIB - /wElAYoBKAH/AUUBjwFHAf8BeAGeAXoB/wGqAbUBqgH/AcIBwAG+Af8BzQHEAcIB/wHVAccBwwH/AeEB - zQHGAf8B6wHRAcgB/wHsAc0BwwH/AcABoAGVAf8BkAFxAWUB/wFpAUoBQgH/AU8BHwEdAdcBcAIGAYMI - AAGZAgIBSAE+AgwBwwFcAVQBVwHvAX8BiwGOAf8BnQGsAbEB/wGaAaoBrgH/AZYBpQGqAf8BjgGeAaMB - /wGCAZEBlgH/AYIBjQGQAf8BnAGmAagB/wHhAe0B8QH/AeIB8AHzAf8B3QHrAe8B/wHaAekB7gH/AacB - sQHPAf8BhwGMAbwB/wJ6AbEB/wJ5AbAB/wJlAaEB/wFOAU8BkQH/AVoBXgGXAf8BgwGQAa8B/wGpAb8B - xwH/AagBwAHHAf8BpAG8AcMB/wF+AZEBmAH/ASEBJgEnAf8BjQILAWAYAAGtASIBGwFwAYcBVgFFAf8B - twGDAXEB/wHhAbABnQH/AfwBzgG8Af8B+gHMAbkB/wH8AcsBuAH/Af0BywG4Af8B/AHKAbgB/wH9AckB - tgH/Af0BxAGtAf8B/QG6AZ0B/wHwAZYBcQH/AeABdwFOAf8B0AFfATUB/wHaAWsBQAH/AeUBdAFJAf8B - 6gF5AUwB/wHXAWoBQgH/Ad8BiAFpAf8B6QGqAZMB/wHiAaoBlQH/AYIBXwFSAf8BYAEbARYBvwHKAgIB - EAwAAYkCRQGvAXwCeQH/AZ4CnAH/AbUBtgG3Af8BwAHEAcYB/wHEAcoBzAH/AccBzgHRAf8BygHRAdUB - /wHGAtEB/wGzAckBvgH/AX8BswGHAf8BTAGgAVIB/wEnAZgBLAH/ASkBoQEvAf8BKwGmATEB/wEoAaIB - LQH/ATcBlAE7Af8BbQGiAXIB/wG8AcUBwwH/AcEBxAHFAf8CwwHEAf8BxQHDAcIB/wHMAcUBwgH/AdYB - yQHEAf8B4gHNAcYB/wHuAdIByQH/AdkBugGvAf8BsgGUAYgB/wF6AVwBUgH/AUEBMAErAf8BWQIQAa8E - AAGJAkUBrwF8AnkB/wGeApwB/wG1AbYBtwH/AcABxAHGAf8BxAHKAcwB/wHHAc4B0QH/AcoB0QHVAf8B - zAHVAdgB/wHOAdcB2gH/Ac8B2AHcAf8BuAHNAcMB/wF2AawBfQH/AT4BnQFEAf8BIwGbASgB/wErAacB - MAH/ASMBmgEnAf8BKgGRAS4B/wFBAY8BRAH/AXcBoQF5Af8BogGyAaMB/wHCAcEBwAH/AcsBxAHCAf8B - 1gHJAcQB/wHiAc0BxgH/Ae4B0gHJAf8B2QG6Aa8B/wGyAZQBiAH/AXoBXAFSAf8BQQEwASsB/wFZAhAB - rwQAAZUCBgFSAWEBHgEfAasBQwFHAUgB/wF/AYgBiwH/AZMBngGhAf8BkgGdAaAB/wGUAaIBpQH/AZUB - pAGoAf8BkgGhAaYB/wGGAZUBmQH/AYQBjwGSAf8BngGnAakB/wHlAfEB9AH/AeoB9wH5Af8B5wH1AfgB - /wHkAfMB9wH/AaoBswHUAf8BfQGBAbgB/wJdAaQB/wJiAaQB/wJaAZ0B/wFPAVABlAH/AV0BYAGaAf8B - hgGTAbIB/wGsAcEByQH/Aa4BxAHLAf8BqwHCAckB/wGFAZgBngH/ASMBKAEqAf8BjQILAWAYAAGuASMB - HAFwAYsBWgFJAf8BvgGLAXkB/wHkAbQBogH/AfwBzwG9Af8B+gHMAbsB/wH8Ac0BuwH/Af0BzQG7Af8B - /AHLAbkB/wH7AbwBpgH/AfQBqAGKAf8B6AGOAWoB/wHeAXgBTwH/AdoBbwFEAf8B2wFwAUYB/wHrAX8B - UgH/AfEBggFVAf8B7AF9AVAB/wHVAWsBQwH/Ad0BiQFrAf8B6QGsAZYB/wHfAagBkwH/AYIBXgFRAf8B - YAEcARYBvwHKAgIBEAgAAb4CEwEwAZgCXwG+AZYClQH/AbICtAH/Ab8BwwHFAf8BxgHMAc8B/wHKAdEB - 1AH/AcwB1QHZAf8BygHXAdgB/wG5AdEBxgH/AYcBugGRAf8BUAGnAVcB/wEvAaIBNgH/ATcBsAE+Af8B - NwGyAT8B/wE1AbEBOwH/ATABrAE2Af8BOwGcAT8B/wFwAakBdgH/AcABywHKAf8BxAHJAcoB/wHDAccB - yAH/AcEBwwHEAf8BxgHEAcIB/wHNAcUBwwH/AdgByAHEAf8B5QHPAcYB/wHoAc0BwwH/AdABsQGnAf8B - jAFtAWMB/wFZAUMBPQH/AW0BIAEdAa8BvgITATABmAJfAb4BlgKVAf8BsgK0Af8BvwHDAcUB/wHGAcwB - zwH/AcoB0QHUAf8BzQHVAdkB/wHQAdkB3QH/AdIB3QHhAf8B1AHgAeQB/wHVAeIB5gH/AbwB1QHLAf8B - cwGyAX0B/wFBAaYBSQH/ASsBpQExAf8BMwGvATkB/wEuAaoBNAH/AScBnwEsAf8BIAGQASUB/wFAAY8B - QwH/AXUBoAF4Af8BrgG5AbEB/wLBAb4B/wHNAcUBwgH/AdgByAHEAf8B5QHPAcYB/wHoAc0BwwH/AdAB - sQGnAf8BjAFtAWMB/wFZAUMBPQH/AW0BIAEdAa8EAAFVAhQBrwFDAUcBSQH/AYYBkAGTAf8BngGoAasB - /wGTAZsBngH/AX4BhAGGAf8BjQGYAZsB/wGUAaMBpgH/AZQBpAGoAf8BiQGYAZwB/wGHAZIBlAH/AaEB - qQGrAf8B6QH0AfUB/wHuAfoB/AH/AesB+QH7Af8B6gH3AfoB/wGuAbYB1wH/AXwBgAG6Af8CVgGjAf8C - VAGfAf8CUQGaAf8CUgGYAf8BYAFjAZ4B/wGKAZYBtQH/AbABxAHMAf8BsgHHAc4B/wGvAcYBzAH/AYkB - nAGhAf8BJAEpASwB/wGOAgwBYAgAAbkBAQEAASEBrgEBAQABMAGxAQIBAQEwAcQBCQEDATABrgEqAR0B - iwGTAVoBRwH/AcEBiQF1Af8B4QGsAZkB/wH1AcQBsgH/AfkBywG5Af8B/AHPAb0B/wH9Ac4BuwH/AfwB - xgGxAf8B8wGkAYcB/wHlAYMBXgH/AdEBYwE7Af8B1gFsAUEB/wHjAXsBTgH/AfQBjQFfAf8B9QGMAV0B - /wHtAYEBVAH/Ad4BcwFJAf8BzwFxAU4B/wHeAZQBeQH/AewBswGfAf8B3AGlAZEB/wGBAV0BTwH/AWAB - HAEWAb8BygICARAIAAFvAlsB5wGGAn8B+AGiAaMBpAH/Ab8BxAHFAf8BxgHMAc8B/wHLAdMB1gH/Ac8B - 2AHcAf8B0QHdAeAB/wG9AdYBywH/AY4BwwGZAf8BNQGdATkB/wEzAakBOQH/AT8BuAFHAf8BQwG9AUsB - /wFBAbsBSQH/ATkBswFAAf8BLAGmATIB/wFOAaQBVAH/AYYBtQGPAf8BywHVAdcB/wHJAdEB1AH/AcYB - zAHOAf8BwwHHAcgB/wLCAcMB/wHHAsIB/wHPAcQBwgH/AdoByQHEAf8B6gHQAcgB/wHhAcIBuAH/Aa4B - jwGFAf8BfAFjAVwB/wGGATMBLwGvAW8CWwHnAYYCfwH4AaIBowGkAf8BvwHEAcUB/wHGAcwBzwH/AcsB - 0wHWAf8BzwHYAdwB/wHTAd4B4gH/AdYB4wHnAf8B2QHnAewB/wHcAeoB7wH/Ad0B7AHyAf8B0AHmAeQB - /wGrAdQBvAH/AVYBsQFgAf8BLAGkATIB/wE5AbQBQQH/ATYBsQE+Af8BMgGsATgB/wEsAaUBMgH/ASIB - kQEnAf8BQwGSAUYB/wF8AaIBfwH/Aa8BuQGxAf8BxQHBAcAB/wHPAcQBwgH/AdoByQHEAf8B6gHQAcgB - /wHhAcIBuAH/Aa4BjwGFAf8BfAFjAVwB/wGGATMBLwGvBAABbwIvAa8BawFxAXMB/wGuAbkBvQH/AZgB - oAGhAf8BhAGIAYkB/wF5AnwB/wGQAZoBnQH/AZgBpwGqAf8BmAGnAasB/wGOAZ0BoQH/AYsBlQGYAf8B - pAGrAa0B/wHtAfYB9wH/Ae8B+gH8Af8B6QH2AfkB/wHkAfEB9AH/AaoBsgHTAf8BewF/AboB/wJZAacB - /wJWAaMB/wJUAZ4B/wJVAZwB/wFjAWcBogH/AY4BmgG5Af8BtAHIAc8B/wG1AcoB0AH/AbEBxwHNAf8B - iQGbAZ8B/wEjASgBKgH/AY4BCwEMAWAIAAFVAQIBAQGfASIBBQECAecBLwEKAQQB5wGMASsBDgHnAakB - QQEdAfIBrAFUATMB/wG+AW8BUgH/Ac8BhwFsAf8B4AGgAYgB/wHzAcEBrgH/AfsBzQG7Af8B/QHIAbEB - /wH4AasBigH/AeABfwFaAf8B0QFoAUAB/wHRAWwBQQH/AewBiQFbAf8B+QGXAWcB/wH5AZYBZQH/AesB - hAFWAf8B1AFtAUMB/wHDAWEBPwH/AeEBmwGBAf8B8QG3AaIB/wHxAb0BqgH/AdoBpAGQAf8BgAFcAU8B - /wFjARwBGAG/AcoCAgEQCAABeQJ4Af8BkgGRAZIB/wGsAa4BrwH/AcUBywHNAf8BywHTAdYB/wHQAdoB - 3gH/AdAB3gHgAf8BuwHYAcoB/wGJAcUBlQH/AVUBswFfAf8BPAGxAUMB/wFCAbwBTAH/AUwBxQFWAf8B - TAHGAVYB/wE/AboBSAH/ATwBsQFEAf8BRgGrAU4B/wGGAcEBkgH/AbUB0wHDAf8B0gHeAeEB/wHOAdgB - 2wH/AcoB0QHUAf8BxgHLAc0B/wHCAcUBxwH/AcQBwwHEAf8ByQLDAf8B0wHGAcMB/wHjAc0BxwH/AeYB - yQHAAf8B0AGyAacB/wGVAXoBcQH/AZEBPgE5Aa8BeQJ4Af8BkgGRAZIB/wGsAa4BrwH/AcUBywHNAf8B - ywHTAdYB/wHQAdoB3gH/AdQB4AHlAf8B2QHmAesB/wHdAewB8QH/AeEB8AH2Af8B5AH0AfgB/wHmAfYB - +gH/AeEC9QH/AdMB7QHmAf8BjgHNAZsB/wFSAbQBWwH/ASkBpgEvAf8BNQGwATwB/wE4AbMBQAH/ATMB - rgE7Af8BKQGhAS8B/wEsAZUBMQH/AUABjwFDAf8BdgGfAXkB/wGkAbIBowH/AcYBwQG+Af8B0wHGAcIB - /wHjAc0BxwH/AeYByQHAAf8B0AGyAacB/wGVAXoBcQH/AZEBPgE5Aa8EAAF4AjoBrwFxAXgBegH/AacB - sAGyAf8BfQGBAYIB/wFwAnEB/wF4AnoB/wGUAZ0BoAH/AZ0BqgGuAf8BmwGqAa4B/wGQAZ4BogH/AYkB - kwGWAf8BoAGnAakB/wHpAfEB8wH/Ae0B9gH5Af8B6AH0AfcB/wHkAe8B8gH/AbwBxQHcAf8BlwGeAcgB - /wF2AXoBtwH/AWkBbAGvAf8BYQFiAagB/wFeAV8BpQH/AWsBbgGoAf8BkgGdAbsB/wG1AccBzQH/AbQB - xwHNAf8BsQHFAcsB/wGKAZoBnwH/ASMBKAEqAf8BjgELAQwBYAgAAXoBFQEHAa8BYQEnARAB/wGBATkB - HAH/AbQBWAEvAf8BywFuAUAB/wHSAX4BUQH/AdkBjgFjAf8B3QGYAW8B/wHdAZoBdQH/AdkBkgF0Af8B - 7AGoAYwB/wH0AasBjAH/Ad0BggFcAf8B2QF9AVQB/wHgAYUBWQH/Ae4BmAFpAf8B+QGfAXAB/wH9AaAB - cAH/AfkBmAFoAf8B4wF/AVEB/wHSAW0BQwH/AcgBZwFCAf8B1wGGAWYB/wHeAZUBeQH/AdwBmQGAAf8B - zQGOAXYB/wF8AVMBRAH/AWMBHAEWAb8BygICARAIAAGFAYQBhQH/AZwBnQGeAf8BswG3AbkB/wHKAdEB - 1AH/Ac8B2QHdAf8BzgHdAd4B/wHAAdwB0QH/AYcBxgGTAf8BWgG5AWQB/wFAAbYBSgH/AU0BxgFYAf8B - UwHMAV8B/wFUAc0BXwH/AU0ByQFYAf8BMgGyAToB/wErAaUBMAH/AT0BowFEAf8BcwG6AX4B/wGPAcQB - mwH/AZMBwQGeAf8BjwG7AZkB/wGMAbQBlAH/AYkBrgGPAf8BiAGpAY0B/wGbAa8BnAH/AbMBuQGwAf8B - ygHDAb8B/wHbAcoBxQH/AeUBzAHEAf8B5gHIAb0B/wGmAYkBgAH/AZgBRQE+Aa8BhQGEAYUB/wGcAZ0B - ngH/AbMBtwG5Af8BygHRAdQB/wHPAdkB3QH/Ac8B3gHfAf8ByAHfAdkB/wGrAdUBugH/AaAB0wGvAf8B - nQHVAawB/wGfAdkBrgH/AaEB2gGuAf8BoQHbAa4B/wGfAdkBrAH/AXkBxQGDAf8BSQGuAVAB/wEVAZYB - GAH/ASkBpwEuAf8BNgGyAT0B/wE5AbQBQgH/ATIBrQE5Af8BJwGfAS0B/wEjAZABJgH/AUEBjgFEAf8B - dwGgAXgB/wGsAbQBqAH/AcoBwgG+Af8B2wHKAcUB/wHlAcwBxAH/AeYByAG9Af8BpgGJAYAB/wGYAUUB - PgGvBAABfAI+Aa8BcgF4AXoB/wGfAacBqQH/AWkBawFsAf8DYAH/AXQCdgH/AZYBnwGiAf8BngGqAa4B - /wGYAaQBpwH/AYcBkAGSAf8BggGGAYgB/wGbAZ8BoAH/AeQB6wHtAf8B6wH0AfYB/wHpAfMB9gH/AeYB - 8QH0Af8B0AHaAeYB/wG5AcIB2QH/AaIBqwHNAf8BlwGeAcgB/wGLAZIBwQH/AYIBiAG6Af8BhwGOAbkB - /wGhAawBxAH/AbgByQHPAf8BtQHHAc0B/wGzAcUBywH/AYsBmwGgAf8BJAEpASoB/wGOAQsBDAFgBAAB - vwENAQcBWAGfASsBEgHLAacBSQEkAf8BzgFnATsB/wHdAX0BTgH/AegBkAFeAf8B7gGfAWoB/wHwAaoB - dQH/Ae4BrwF7Af8B5AGjAXQB/wHJAXQBTgH/AeABjAFoAf8B6gGVAXEB/wHJAWkBQgH/AdwBigFfAf8B - 8QGpAXoC/wG5AYkC/wGwAYAB/wH+AacBdwH/AfsBnQFsAf8B6QGIAVkB/wHgAXwBUAH/AdwBeQFPAf8B - 3AF9AVYB/wHcAX8BWwH/AdYBfQFcAf8BxgFzAVUB/wGMAUsBNAH/AXMBJgEVAdUBqgETAQIBYgHGAQcB - AAEhBAABhwGJAYoB/wGhAaUBqAH/AbkBwAHDAf8BzgHWAdkB/wHTAd4B4gH/AcMB3AHTAf8BmwHPAaoB - /wFAAa0BRgH/ATwBtwFDAf8BUgHNAV8B/wFbAdQBaAH/AV4B1gFrAf8BWgHTAWYB/wFKAcgBVQH/ASMB - qQEnAf8BDgGWAQ8B/wESAZMBFQH/ARUBkAEYAf8BFwGMARkB/wEWAYcBGAH/ARUBgQEWAf8BFAF8ARYB - /wEUAXYBFQH/ARsBcwEbAf8BSwGHAUwB/wGIAaQBhwH/Ar4BuAH/AdQBxwHDAf8B4gHLAcUB/wHvAc8B - xgH/Aa8BkgGKAf8BnwFLAUcBrwGHAYkBigH/AaEBpQGoAf8BuQHAAcMB/wHOAdYB2QH/AdMB3gHiAf8B - xgHeAdYB/wGjAdMBsgH/AU0BrgFUAf8BJwGgASsB/wEZAZ0BHAH/ARoBnwEcAf8BGwGfARwB/wEbAZ8B - HQH/ARsBngEcAf8BGAGbARoB/wERAZYBEwH/AQcBjQEHAf8BGgGbAR0B/wEtAasBNAH/AT8BugFIAf8B - OAGzAUEB/wEwAawBOAH/ASgBowEuAf8BHAGLASAB/wFDAY4BRQH/AX4BngF+Af8BvAG+AbYB/wHUAcYB - wwH/AeIBywHFAf8B7wHPAcYB/wGvAZIBigH/AZ8BSwFHAa8EAAF8Aj4BrwFzAXkBewH/AZ8BpwGpAf8B - YgFkAWUB/wFYAVkBWgH/AXACcgH/AZcBoAGjAf8BmQGkAacB/wGMAZMBlQH/AXcBcwFyAf8BeAFyAW8B - /wGWAZIBkAH/Ad0C5AH/AekB8gH0Af8B7AH2AfgB/wHqAfQB9wH/AeAB6wHuAf8B2gHmAekB/wHWAeIB - 5gH/AdgB5QHrAf8BzwHcAeUB/wHAAc0B2wH/AbcBxAHUAf8BugHJAdQB/wG/Ac8B1QH/AbsBywHQAf8B - tgHIAc0B/wGOAZ0BoQH/ASUBKgErAf8BjgIMAWAEAAGcAScBEwH/AbQBRAEiAf8B0QFmATsB/wHxAYoB - WQH/AfYBlgFjAf8B+AGgAWwB/wH5AakBcwH/AfsBswF7Af8B+wG+AYYB/wHwAbIBfwH/AcgBcgFKAf8B - 2gGDAV4B/wHjAYwBZwH/AcIBZQE9Af8B5QGhAXUB/wH9AcgBmQL/AcgBmQL/Ab0BjQH/Af4BsAGAAf8B - /QGjAXIB/wH8AZ0BbAH/AfoBlgFmAf8B+AGQAWEB/wH2AYwBXQH/AfABggFVAf8B5AF0AUkB/wHMAV0B - NgH/AbIBSgEkAf8BlgE7ARMB/wFxATUBAwH/AagBFQEBAWoBzQIBAQsBiAGKAYwB/wGmAaoBrQH/Ab4B - xgHJAf8B0AHaAd4B/wHOAeAB3gH/AZUBzAGjAf8BTQGzAVYB/wFIAb8BUQH/AVMBzAFfAf8BYQHZAW8B - /wFoAdwBdgH/AWsB3gF5Af8BawHeAXkB/wFmAdoBdAH/AVkB0QFkAf8BTwHJAVkB/wFLAcYBVQH/AUcB - wAFQAf8BQgG6AUsB/wE8AbMBRAH/ATUBrQE8Af8BLwGlATUB/wEoAZ4BLgH/ASMBlgEnAf8BJQGIAScB - /wFCAYcBQgH/AaEBsAGdAf8BxwHBAboB/wHdAckBxAH/AeoBzQHFAf8BsgGXAY8B/wGlAVEBSwGvAYgB - igGMAf8BpgGqAa0B/wG+AcYByQH/AdAB2gHeAf8BzwLgAf8BmAHMAaUB/wFPAbMBWAH/AUgBvQFRAf8B - TQHGAVcB/wFUAc0BXwH/AVkBzwFkAf8BWwHRAWYB/wFcAdIBaAH/AVsB0QFmAf8BVgHOAWEB/wFQAckB - WgH/AUgBxAFRAf8BSAHDAVEB/wFHAcEBUQH/AUUBvwFPAf8BPQG4AUYB/wE1AbEBPQH/AS0BqAE0Af8B - JAGcASgB/wEkAYoBJgH/AT4BhQE+Af8BnQGuAZkB/wHFAb8BuAH/Ad0ByQHEAf8B6gHNAcUB/wGyAZcB - jwH/AaUBUQFLAa8EAAF+AkEBrwF4AX4BgAH/AacBrwGxAf8BbwFyAXMB/wFxAXUBdgH/AY8BlgGYAf8B - lAGeAaEB/wGHAokB/wF9AXEBbAH/AY0BawFgAf8BjgFsAWAB/wGcAYUBfQH/A8cB/wHfAuUB/wHrAfMB - 9QH/AeoB8wH2Af8B5AHuAfEB/wHgAesB7gH/Ad4B6gHuAf8B4gHvAfMB/wHeAesB8QH/AdUB4gHpAf8B - zgHdAeMB/wHLAdoB4AH/AccB1wHdAf8BwAHQAdUB/wG7AcwB0QH/AZABnwGjAf8BJgEqASsB/wGPAgwB - YAQAAaQBNwEWAf8BxwFVAS4B/wHiAW8BQwH/AfMBhAFUAf8B7AGEAVUB/wHiAYEBUwH/AdkBgAFTAf8B - 2wGKAV4B/wHZAYsBYQH/AdYBiQFiAf8B1AGGAWYB/wHoAZsBegH/AesBmQF2Af8BxAFmAUAB/wHfAZsB - cQH/AfUBxQGXAv8B1AGlAf8B/gHFAZYB/wH4Aa4BfwH/Ae4BlAFlAf8B7QGMAV0B/wHtAYgBWgH/Ae8B - iAFZAf8B8gGIAVoB/wH0AYYBWAH/AfMBgQFUAf8B6wF3AUsB/wHZAWYBPQH/AcIBVAEsAf8BowFBARgB - /wF+ASMBDgHcAYsBDQEGAokBiwGOAf8BqgGuAbEB/wHCAcoBzgH/AdIB3gHiAf8BxwHgAdgB/wGEAckB - kQH/ATkBsAFAAf8BUwHLAV4B/wFjAdkBcQH/AW8B4AF+Af8BdgHjAYUB/wF6AeQBigH/AXwB5QGMAf8B - eQHkAYkB/wFzAeEBgQH/AWsB3QF4Af8BYgHZAW4B/wFaAdIBZgH/AVIBywFeAf8BSgHEAVUB/wFCAb0B - TAH/AToBtQFCAf8BMQGtATkB/wEoAaQBLgH/ARsBjQEeAf8BKgGBASsB/wGJAaUBhwH/ArsBsAH/AdkB - yAHDAf8B5QHMAcQB/wGzAZoBkgH/AagBVAFPAa8BiQGLAY4B/wGqAa4BsQH/AcIBygHOAf8B0gHeAeIB - /wHKAeAB3AH/AYcByQGTAf8BOAGvAT4B/wFRAcoBXAH/AWIB2AFwAf8BbwHfAX4B/wF2AeIBhQH/AXoB - 5AGKAf8BfAHlAYwB/wF5AeQBiQH/AXMB4QGBAf8BawHdAXgB/wFiAdkBbgH/AVoB0gFmAf8BUgHLAV4B - /wFKAcQBVQH/AUIBvQFMAf8BOgG1AUIB/wEyAa0BOQH/ASkBpAEuAf8BHAGOAR8B/wEpAYIBKgH/AYIB - oQGBAf8BuAG5Aa0B/wHZAcgBwwH/AeUBzAHEAf8BswGaAZIB/wGoAVQBTwGvBAABgAFCAUMBrwF9AYMB - hQH/AbMBugG8Af8BkAGVAZcB/wGMAZIBlAH/AZUBmwGdAf8BigGJAYgB/wGIAXcBcAH/AYwBawFfAf8B - oAFxAWEB/wGjAXMBYwH/AaQBfgFwAf8BqQGXAZEB/wHJAcYBxAH/AeAB5gHnAf8B6QHxAfQB/wHmAe8B - 8gH/Ad8B6QHrAf8B1gHgAeMB/wHcAeYB6gH/AdsB5wHrAf8B1wHkAecB/wHXAeQB6QH/AdMB4QHmAf8B - zQHdAeEB/wHGAdYB2wH/Ab4BzgHTAf8BkQGeAaIB/wElASkBKgH/AY8CDAFgBAABpwE8ARcB/wHTAV8B - NgH/Ae0BdAFIAf8B8gF8AU8B/wHVAW0BQwH/AcoBbwFKAf8BzQGBAWEB/wHdAaEBhAH/AeEBpwGMAf8B - 4gGnAY4B/wHpAbUBnwH/AfUBuQGfAf8B9AGsAY4B/wHcAYcBZAH/AdsBkQFrAf8B5gGrAYEB/wH9AdMB - pQH/Af4BxgGYAf8B9QGtAX4B/wHkAYoBXAH/AdYBcwFIAf8B1gFyAUgB/wHfAXoBUAH/Ad4BdgFMAf8B - 4QF1AUoB/wHnAXYBSgH/AfEBfAFPAf8B7AF1AUoB/wHfAWkBPwH/AcoBVwEvAf8BkAE4ARsB/wGNARsB - CwGvAYkBjQGPAf8BqwGwAbMB/wHEAcwB0AH/AdMB4QHlAf8BxgHiAdkB/wGFAcwBkgH/AT0BtgFDAf8B - WQHRAWYB/wFsAd4BewH/AXsB5AGLAf8BhAHoAZUB/wGKAeoBmwH/AYwB6wGdAf8BhwHpAZgB/wF+AeUB - jQH/AXIB4AGBAf8BZwHcAXQB/wFdAdUBagH/AVQBzgFgAf8BTAHHAVcB/wFEAb8BTgH/ATwBtgFEAf8B - NAGuAToB/wEqAaUBMAH/AR4BjwEhAf8BKwGEASwB/wGDAaIBgwH/AbYBuAGuAf8B1QHHAcIB/wHhAcoB - wwH/AbEBmQGSAf8BpwFWAVABrwGJAY0BjwH/AasBsAGzAf8BxAHMAdAB/wHUAeEB5QH/AcsB4wHdAf8B - iAHNAZUB/wE8AbUBQwH/AVgB0AFjAf8BagHcAXgB/wF3AeMBhwH/AYEB5gGRAf8BhwHpAZgB/wGJAekB - mgH/AYQB6AGWAf8BfQHkAYwB/wFyAeABgQH/AWcB3AF0Af8BXQHVAWoB/wFVAc4BYQH/AU4ByAFZAf8B - RgHAAVAB/wE9AbgBRgH/ATUBrwE8Af8BKwGnATEB/wEdAZEBIQH/ASkBhQErAf8BewGeAXsB/wGyAbcB - qQH/AdUBxwHCAf8B4QHKAcMB/wGxAZkBkgH/AacBVgFQAa8EAAGCAUMBRAGvAYIBhwGJAf8BvQHEAccB - /wGqAbEBsgH/AZwCnwH/AZIBjgGLAf8BjAF3AW8B/wGXAXMBZAH/AaUBdQFjAf8BrAF6AWgB/wGwAXwB - aQH/AasBegFpAf8BlwFyAWQB/wGyAaMBnQH/Ac0CzgH/AeQB7AHuAf8B5QHsAe8B/wHTAdoB3AH/AbQB - ugG8Af8BvQHDAcYB/wHBAckBzAH/AcYBzwHSAf8B1gHhAeYB/wHWAeQB6QH/AdEB4AHkAf8ByQHZAd4B - /wG8AcoBzwH/AY0BmAGcAf8BJgIoAf8BeQEPAQ0BgwG7AQQBAgEmAacBPAEXAf8B2QFjATkB/wHyAXYB - SgH/AfABdgFLAf8BvQFZATQB/wG4AWkBTQH/Ac4BlwGCAf8B7AHLAbsB/wH1AdcByAH/AfcB1gHIAf8B - +wHeAdEB/wH9AdMBwQH/AfsBwgGqAf8B9QGtAY4B/wHeAZABbgH/AdkBkQFqAf8B7QG3AYoB/wH4AbsB - jAH/AfYBqwF8Af8B5QGLAVwB/wHKAWYBPQH/AcgBZgFAAf8B1QF3AVMB/wHTAXMBTwH/AdMBbgFIAf8B - 1gFrAUMB/wHiAXABRQH/AewBdQFKAf8B7wF1AUkB/wHlAWwBQQH/AbcBTgEoAf8BrAEoARABrwGKAZAB - kgH/AaoBsgG1Af8BxAHOAdIB/wHXAeQB6AH/AdgC6wH/AZMB0wGhAf8BQAG1AUUB/wFUAcwBXgH/AW4B - 3QF8Af8BhgHoAZcB/wGTAe0BpQH/AZoB8AGtAf8BmwHxAa4B/wGUAe4BpwH/AYQB5wGUAf8BdAHgAYMB - /wFnAdsBdQH/AVsB1AFoAf8BUgHNAV4B/wFKAcUBVQH/AUIBvQFMAf8BOgG0AUIB/wEyAasBOAH/ASgB - oAEtAf8BIAGKASQB/wE3AYQBOQH/AaEBsgGiAf8BxAHAAb0B/wHTAcYBwgH/Ad4ByAHBAf8BrgGXAZEB - /wGlAVQBUAGvAYoBkAGSAf8BqgGyAbUB/wHEAc4B0gH/AdcB5AHpAf8B2wHsAe8B/wGZAdUBpwH/AUQB - uAFLAf8BTQHIAVYB/wFjAdcBcAH/AXkB4wGJAf8BhgHoAZYB/wGMAesBnQH/AY4B6wGfAf8BiQHpAZsB - /wGAAeUBkAH/AXQB4AGDAf8BZwHbAXUB/wFeAdYBawH/AVcB0AFjAf8BUQHLAV0B/wFIAcMBUwH/AUAB - ugFIAf8BNwGxAT4B/wErAaUBMQH/AR8BjAEjAf8BMgGDATQB/wGaAbABnAH/AcABvwG6Af8B0wHGAcIB - /wHeAcgBwQH/Aa4BlwGRAf8BpQFUAVABrwQAAYICQwGvAYUBiwGNAf8BxAHMAc8B/wGjAaUBpgH/AZMB - iAGDAf8BlAF3AWsB/wGvAYEBcAH/AbkBhgFzAf8BuAGGAXIB/wGvAX4BawH/Aa8BfQFqAf8BrwF8AWkB - /wGrAXgBZgH/AacBiAF+Af8BtgGqAacB/wHcAeIB5AH/AeAB5wHpAf8BtAG4AbkB/wNoAf8BdgJ4Af8B - hAKHAf8BmgGeAaAB/wHOAdgB3AH/AdsB6AHsAf8B1QHjAecB/wHHAdUB2QH/AbABuwG/Af8BggGHAYoB - /wEuAScBJAH/ATMBGgESAfUBawEPAQoBpAGnATwBFwH/AdkBYwE5Af8B8gF2AUoB/wHuAXUBSgH/AbAB - VQE2Af8BtAF0AV4B/wHbAbQBowH/AfcB4QHWAf8B/gHqAd8B/wH9AeYB2gH/Af0B4gHXAf8B/gHgAdMB - /wH+AdcBxwH/AfsBwAGnAf8B7gGqAYsB/wHaAYwBagH/AcEBZgE/Af8B6AGaAW0B/wH8Aa0BfAH/AfoB - oAFuAf8B4AF+AVAB/wHZAX8BWQH/AeABkwF1Af8B8gGlAYYB/wHpAZcBdQH/AdQBeQFVAf8BvwFWATAB - /wHXAWQBOwH/Ae4BdAFJAf8B8QF1AUkB/wHQAV0BNAH/AcIBNQEbAa8BigGQAZMB/wGnAa8BsgH/AcEB - ywHQAf8B2AHlAeoB/wHeAe8B8wH/AcMB6AHVAf8BlQHZAaAB/wFjAc0BawH/AWUB1AFwAf8BfQHjAYwB - /wGZAe8BrAH/AaYB9AG6Af8BpQH0AbgB/wGSAewBpAH/AV8B1AFqAf8BSAHGAU8B/wFaAcgBXwH/AWcB - ygFtAf8BagHIAXEB/wFlAcIBbgH/AWABvAFqAf8BWgGzAWMB/wFVAaoBXQH/AVMBowFaAf8BYwGiAWgB - /wGBAacBhQH/AbQBvAG3Af8BxwHCAcEB/wHSAcUBwQH/AdsBxQG/Af8BqAGSAY0B/wGfAVABSwGvAYoB - kAGTAf8BpwGvAbIB/wHBAcsB0AH/AdgB5QHqAf8B3wHvAfQB/wHIAeoB2gH/AaIB3gGsAf8BgQHVAYgB - /wF5AdYBfgH/AXoB2QGAAf8BfwHdAYQB/wGBAd8BhwH/AYIB3wGHAf8BgAHcAYYB/wF0AdYBeQH/AVcB - ygFcAf8BKAG2AS0B/wE9AcIBRgH/AUsByQFWAf8BUgHMAV4B/wFJAcQBVAH/AT8BuQFIAf8BNAGtATwB - /wEqAZkBLgH/AUYBlwFKAf8BdQGhAXkB/wGwAboBswH/AcYBwgHAAf8B0gHFAcEB/wHbAcUBvwH/AagB - kgGNAf8BnwFQAUsBrwQAAXoCOgGvAXEBdAF1Af8CpAGlAf8BngGKAYIB/wGkAYMBdQH/AbIBhwF1Af8B - wQGPAXsB/wHHAZIBfQH/AcQBkAF6Af8BuAGGAXIB/wGyAYABbAH/Aa4BfAFpAf8BsAF8AWgB/wGnAXoB - awH/AaoBjQGEAf8BugK4Af8B1AHVAdYB/wGuArAB/wNcAf8DXwH/Am8BcAH/AY4BkQGTAf8B0AHaAdwB - /wHcAegB7AH/Ac0B2gHdAf8BrwG5AbwB/wGRAY8BjgH/AXMBYwFdAf8BTwEzASoB/wFOASsBHwH/AXgB - GwESAa8BpwE8ARcB/wHQAV0BNAH/AeoBcAFFAf8B7wF2AUsB/wG1AV0BPgH/Ab0BggFtAf8B5gHEAbUB - /wH5AeMB2QH/Af4B6QHfAf8B/QHmAdwB/wH9AeQB2gH/Af4B5AHaAf8B/gHhAdQB/wH9AdYBxQH/AfgB - wQGqAf8B6gGmAYkB/wHUAYQBYwH/AdwBhwFfAf8B6wGRAWMB/wH8AZ0BbQH/AfABjgFeAf8B3wF+AVQB - /wHTAXkBVwH/AekBowGKAf8B6QGkAYkB/wHbAYwBbwH/Ab0BZAFDAf8B0AFkAT4B/wHnAW0BQwH/AfIB - dgFLAf8B1gFhATgB/wHJATkBHgGvAYkBjwGSAf8BogGqAa4B/wG9AccBzAH/AdgB5QHqAf8B4AHwAfYB - /wHhAfUB9AH/AdIB8gHgAf8BmAHcAZ0B/wFyAdUBeQH/AWgB2QFzAf8BkQHsAaIB/wGmAfQBugH/AaoB - 9gG+Af8BmQHuAasB/wFiAdUBbgH/AUIBwgFHAf8BQQG4AUEB/wF/Ac0BgQH/AZ4B1wGkAf8BoQHYAa0B - /wGbAdEBqgH/AZUByAGkAf8BkQG/AZwB/wGPAbkBmQH/AZ8BuwGnAf8BsgG/AbcB/wG+AsEB/wHIAcMB - wgH/Ac8BwwG/Af8B0QG9AbcB/wGgAYwBhwH/AZsBTQFHAa8BiQGPAZIB/wGiAaoBrgH/Ab0BxwHMAf8B - 2AHlAeoB/wHgAfAB9gH/AeMC9gH/Ad4B9wHrAf8BwAHpAcUB/wGyAeUBswH/Aa0B5AGtAf8BrQHmAa0B - /wGtAecBrQH/AawB5gGsAf8BqgHkAaoB/wF/AdQBfwH/AVEBwwFTAf8BJAGzASgB/wE+AcMBRwH/AU4B - ywFZAf8BUgHMAV4B/wFJAcMBVAH/ATkBsgFBAf8BLgGhATUB/wFJAZ0BTgH/AXkBqgF+Af8BpwG6Aa0B - /wG8AcABvwH/AcgBwwHCAf8BzwHDAb8B/wHRAb0BtwH/AaABjAGHAf8BmwFNAUcBrwGLAQMBAgFgAV0B - MAEvAc0BagFhAVwB/wGhAYwBhAH/AbQBjQF8Af8BwQGRAXwB/wHIAZcBgQH/AckBlwGCAf8BywGXAYIB - /wHLAZYBgAH/AcIBjwF5Af8BuAGFAXEB/wGwAX8BbAH/AbABfQFpAf8BqgF3AWUB/wGmAXsBbQH/AaAB - iwGEAf8BwQG5AbcB/wOwAf8BewF8AX0B/wFyAXMBdAH/AXkBegF8Af8BkgGUAZYB/wHNAdUB2AH/Ac4B - 2AHbAf8BtgG8Ab0B/wGTAY8BjQH/AXoBZwFgAf8BaQFIAT0B/wFfATQBJwH/AVABKgEdAf8BcwEZARAB - rwGoASkBEAH/AcQBTQEpAf8B3QFmAT0B/wHqAXMBSgH/AbkBZAFGAf8BxQGRAXwB/wHvAdMBxwH/AfsB - 5QHcAf8B/gHoAd8B/wH9AecB3QH/Af0B5wHdAf8B/gHpAd8B/wH+AekB3gH/Af4B5QHaAf8B/QHUAcMB - /wH3AcIBqgH/AesBrgGRAf8B2wGLAWgB/wHeAYEBWAH/Ae8BjAFeAf8B9gGSAWIB/wHnAYABVAH/AdIB - cAFIAf8B3wGYAYAB/wHjAaMBjAH/AdsBlAF7Af8BvQFmAUgB/wHOAWQBPgH/AeUBbAFCAf8B8gF2AUsB - /wHWAWEBOAH/AckBOQEeAa8BgQGGAYsB/wGZAaIBpgH/AbcBwgHGAf8B1gHiAecB/wHgAe8B9QH/AegB - +AH8Af8B7QH9AfsB/wHiAfcB5wH/AZgB4AGaAf8BWQHPAV0B/wF7AeMBiAH/AZkB7wGqAf8BqAH2AbwB - /wGjAfMBtwH/AYkB6AGaAf8BYAHTAWsB/wEoAbIBKgH/AZYB2QGaAf8B1wHyAeAB/wHtAf0C/wHlAfYB - +wH/Ad0B7AHyAf8B1gHiAeYB/wHPAdkB3AH/AckB0AHTAf8BwwHIAcoB/wHBAcIBwwH/AcgBwwHCAf8B - ywG/AbsB/wHAAa0BqAH/AZQBggF8Af8BlAFHAUMBrwGBAYYBiwH/AZkBogGmAf8BtwHCAcYB/wHWAeIB - 5wH/AeAB7wH1Af8B6AH4AfwB/wHxAf4C/wH5A/8B/Q//AfwB/gH8Af8B8gH6AfIB/wGZAdwBmQH/AWAB - zAFjAf8BVwHSAWMB/wFeAdYBawH/AVwB1AFpAf8BUgHLAV4B/wFFAb4BTwH/ATMBpwE6Af8BMQGVATYB - /wGEAbMBjAH/Aa8BwgG3Af8BwgHIAckB/wHAAcIBwwH/AcgBwwHCAf8BywG/AbsB/wHAAa0BqAH/AZQB - ggF8Af8BlAFHAUMBrwEcAQwBBwH/AUEBLwEpAf8BeQFaAU4B/wG8AYwBdgH/Ad0BqQGQAf8B4QGtAZMB - /wHUAaIBigH/AcoBmgGEAf8BygGYAYIB/wHNAZgBggH/AcsBlgGAAf8BwQGNAXkB/wG2AYQBcQH/Aa4B - fgFrAf8BsAF9AWsB/wGpAXYBZQH/AZMBZQFTAf8BqwGXAZAB/wG2ArIB/wG0AbcBuQH/AacBqgGsAf8B - nwGiAaQB/wGhAaUBpwH/AcEBxwHKAf8BsgK2Af8BlAGNAYoB/wF4AV0BVQH/AWsBRwE7Af8BYgE2ASkB - /wFYASUBGgH/AUABGAEOAfABZAELAQUBnwGsAQYBAwHnAbQBNQEaAfgByAFXATEB/wHcAWwBRAH/AboB - awFOAf8BzAGfAYwB/wH2AeIB2AH/AfwB6QHhAf8B/gHqAeEB/wH9AekB4AH/Af4B7AHiAv8B7gHkAv8B - 7wHlAv8B7QHkAf8B/gHiAdYB/wH9AdoByAH/Af4B1QG8Af8B5QGjAYcB/wHZAYMBYAH/AdgBdAFJAf8B - 7wGJAVsB/wHrAYQBVwH/AdsBdwFPAf8B2gGPAXUB/wHbAZsBhQH/AdYBkQF6Af8BvgFeAT4B/wHSAWMB - PAH/AekBcAFFAf8B8QF1AUoB/wHSAV0BNQH/AcQBNgEbAa8BWQFaAVsB/wGFAY0BkAH/Aa0BuQG9Af8B - 0QHdAeIB/wHdAewB8gH/AeYB9gH6Af8B7gH8Af4B/wHyAf0B+gH/AdkB9QHdAf8BqgHmAawB/wFfAdIB - YwH/AW8B3QF6Af8BiwHqAZsB/wGWAe4BqAH/AYkB6gGbAf8BcwHfAYIB/wFUAc8BXwH/AWwBzAFzAf8B - ogHdAawB/wHoAvsB/wHjAfQB+AH/AdsB6gHwAf8B1AHgAeQB/wHNAdcB2gH/AccBzgHRAf8BwwHHAcgB - /wLCAcMB/wHJAcIBwQH/AcMBtgGzAf8BowGSAY0B/wF7AWkBZgH/AYcBOgE3Aa8BWQFaAVsB/wGFAY0B - kAH/Aa0BuQG9Af8B0QHdAeIB/wHdAewB8gH/AeYB9gH6Af8B7wH8Av8B9wH+Av8B+wP/Af4L/wHwAfoB - 8QH/AccB7QHIAf8BeAHXAX0B/wFVAdABXgH/AWoB3QF4Af8BYgHYAXAB/wFZAdEBZQH/AU0BxgFYAf8B - OQGvAUEB/wFTAa0BWwH/AYYBuQGQAf8BtAHKAcAB/wHCAcwBywH/AcMBxwHIAf8CwgHDAf8ByQHCAcEB - /wHDAbYBswH/AaMBkgGNAf8BewFpAWYB/wGHAToBNwGvAV0BMAEhAf8BjgFjAVIB/wG3AYoBdgH/AdkB - pwGPAf8B5gGyAZgB/wHnAbMBmQH/AeEBrAGUAf8B1AGgAYoB/wHNAZoBhAH/AcsBmAGBAf8BzQGZAYIB - /wHJAZUBfwH/AcEBjgF5Af8BtAGEAXAB/wGxAX8BbAH/Aa8BfAFpAf8BrAF5AWYB/wGkAYEBdAH/Aa0B - nQGYAf8BxgLJAf8B1QHZAdoB/wHPAdQB1QH/AbsBwAHBAf8BpQGiAaEB/wGPAX8BeQH/AXwBXgFUAf8B - cAFJATwB/wFYATUBKAH/AUEBIAEXAf8BLgEJAQcB/wF/AQUBAwF+AbwBAgEBASEBywECAQEBMAGpAScB - EAG+AaMBQQEgAf8BswFSAS8B/wG4AXABVwH/AdUBqwGbAf8B+gHpAeEB/wH9Ae0B5QH/Af4B7gHmAf8B - /gHvAeYC/wHyAegC/wHyAekC/wHxAegC/wHvAeYB/wH+AeoB4AH/Af4B5wHaAv8B6AHXAf8B9wHIAbMB - /wHkAaABgwH/AcwBcgFQAf8B1QF2AU8B/wHRAXEBSwH/Ac0BdQFUAf8B5QGwAZwB/wHkAbABnQH/AdgB - kwF7Af8B0gFoAUIB/wHjAWwBQgH/Ae8BdQFJAf8B7QFyAUcB/wHJAVYBLgH/Ab4BLwEWAa8BlQIlAXgB - kAF1AXcB1QGgAawBsAH/AcEBzQHSAf8B1gHlAesB/wHiAfIB+AH/AeoB+gH+Af8B8gH9Av8B8AH9AfcB - /wHbAfUB3gH/AZ0B4gGfAf8BeAHZAX0B/wFrAdkBdgH/AX0B4wGNAf8BfAHkAYwB/wFzAeABggH/AWIB - 2AFvAf8BXAHGAWUB/wGNAdQBmAH/AeEC9gH/Ad8B8AH0Af8B2QHmAewB/wHSAd0B4AH/AcwB1AHXAf8B - xgHMAc4B/wHCAcUBxwH/AcMBwgHDAf8BwwG8AboB/wG1AakBpQH/AY8BgAF8Af8BYQFVAVIB/wFzASsB - KAGvAZUCJQF4AZABdQF3AdUBoAGsAbAB/wHBAc0B0gH/AdYB5QHrAf8B4gHyAfgB/wHqAfoB/gH/AfIB - /QL/AfgD/wH8A/8B/gf/AegB9wHoAf8BpwHhAacB/wFrAdMBcgH/AVQB0gFgAf8BaQHdAXcB/wFdAdQB - agH/AUsBxQFVAf8BOAGxAUAB/wFXAbQBYAH/AYYBwAGQAf8BtgHPAcMB/wHGAtEB/wHGAcwBzgH/AcIB - xQHHAf8BwwHCAcMB/wHDAbwBugH/AbUBqQGlAf8BjwGAAXwB/wFhAVUBUgH/AXMBKwEoAa8BbAE4ASYB - /wGrAXcBYQH/AdABnQGFAf8B3wGsAZQB/wHkAbEBmAH/AegBtAGaAf8B6QGzAZoB/wHfAasBkgH/AdQB - oQGKAf8BzAGaAYMB/wHLAZkBggH/AcwBmQGCAf8BygGVAX8B/wHAAY0BeAH/AbYBhAFwAf8BsQF/AWwB - /wGwAX0BagH/AacBeQFpAf8BpgGHAXwB/wGtAaQBoAH/AcUCxAH/AbwBuwG6Af8BogGaAZYB/wGNAXYB - bgH/AX4BXQFRAf8BcAFHAToB/wFfATYBKQH/AToBIAEXAf8BNwEMAQkB3QF5AgEBgAG0AgABLQgAAXsB - FAEIAa8BZAEmARAB/wGHAToBHwH/AbUBdwFiAf8B3QG4AakB/wH8Ae4B5gH/Af4B8gHqAf8B/gHyAesB - /wH+AfIB6gH/Af4B9AHsAv8B9QHsAv8B8wHqAf8B/gHuAeUB/wH9AesB4gH/Af0B6wHhAf8B/gHuAeIB - /wH9AeAB0AH/AfMByAG1Af8B4wGrAZQB/wHhAaQBigH/Ad8BogGJAf8B4AGqAZUB/wHwAcsBvAH/AekB - uAGlAf8B3wGSAXcB/wHlAXQBSwH/AewBcgFHAf8B6gFwAUUB/wHVAV8BNgH/AacBQwEgAf8BowEiAQ4B - rwQAAZIBWAFZAa8BiAGUAZgB/wGsAbkBvgH/AcsB2QHfAf8B3QHsAfIB/wHmAfcB/AH/Ae0B/AL/AfQD - /wHzAf4B+gH/AeIB9wHlAf8BoQHhAaQB/wFrAdEBcAH/AVoB0AFlAf8BYgHXAW8B/wFjAdgBcQH/AVkB - 0QFkAf8BWgHDAWMB/wGLAdEBmQH/Ad0B8gHzAf8B2wHrAfAB/wHWAeIB5wH/AdAB2gHdAf8BygHRAdQB - /wHFAcoBzAH/AcIBxAHFAf8BxAHBAcIB/wG5AbEBrwH/AaMBlwGUAf8BgAFzAW8B/wFoAT8BPgHXAYIB - GQEXAYMEAAGSAVgBWQGvAYgBlAGYAf8BrAG5Ab4B/wHLAdkB3wH/Ad0B7AHyAf8B5gH3AfwB/wHtAfwC - /wH0A/8B+QP/AfwD/wH+A/8B5wH3AegB/wGlAeABpgH/AWgB0AFvAf8BTgHMAVkB/wFeAdYBawH/AU8B - yAFZAf8BRQG6AU0B/wFHAawBTgH/AYkBxAGVAf8BtQHTAcMB/wHNAdkB2wH/AcoB0QHUAf8BxQHKAcwB - /wHCAcQBxQH/AcQBwQHCAf8BuQGxAa8B/wGjAZcBlAH/AYABcwFvAf8BaAE/AT4B1wGCARkBFwGDAYQB - KAEcAb8BrAFsAVgB6wHJAZYBfwH/Ad0BqgGSAf8B4AGuAZUB/wHmAbMBmQH/AesBtgGcAf8B6AGzAZkB - /wHeAaoBkgH/AdEBoAGIAf8BywGaAYMB/wHNAZoBgwH/Ac8BmgGDAf8BywGWAYAB/wG+AYsBdwH/AbQB - gwFwAf8BrwF9AWsB/wGsAXoBaAH/AaQBeAFpAf8BlgF6AXEB/wGkAZYBkgH/AZkBiwGFAf8BhQFrAWEB - /wF7AVQBRgH/AXABRQE2Af8BZwE0ASYB8wFuASABFwHHAVABDQEJAb8BXwECAQEBjwHJAgABDAwAAXUB - BQECAYMBWgEZAQ8B1wGAAUABLAH/Ab4BiAF1Af8B5gHFAbcB/wH9AfEB6gH/Af4B9gHwAf8B/gH2Ae8B - /wH+AfQB7QH/Af4B9gHuAv8B9wHvAv8B9AHtAf8B/gHvAecB/wH9Ae0B5AH/Af0B7QHkAf8B/gHvAeYB - /wH9AewB4QH/AfgB4gHVAf8B7wHRAcMB/wHqAcsBvAH/AewBzgHAAf8B8QHWAcsB/wHzAdgBzAH/AesB - tgGiAf8B5QGOAXAB/wHwAXoBUAH/AekBcAFEAf8B1gFiATgB/wG2AUkBIwH/AZYBLAETAdcBnwESAQcB - gwQAAW4CMQGvAV8BaAFsAf8BlQGjAakB/wG7AckBzwH/AdMB4QHnAf8B4QHxAfcB/wHnAfkB/QH/Ae0B - /QL/AfID/wH2Af8B/gH/AeIB9wHoAf8BpQHfAaoB/wEqAbABLAH/AToBvgFBAf8BRAHEAU4B/wE3AbgB - PwH/AV8BvgFpAf8BmQHSAakB/wHeAe0B8wH/AdkB5gHrAf8B0wHdAeIB/wHNAdUB2QH/AcgBzgHQAf8B - wwHIAckB/wHBAcIBwwH/AcMBvwG9Af8BqgGhAZ8B/wGNAYEBfgH/AXMBZwFjAf8BqgEnASUBZQHQAgEB - BQQAAW4CMQGvAV8BaAFsAf8BlQGjAakB/wG7AckBzwH/AdMB4QHnAf8B4QHxAfcB/wHnAfkB/QH/Ae0B - /QL/AfID/wH3A/8B+gP/AfIB/AH1Af8B1wHxAdsB/wFsAcoBcQH/ATcBuwE+Af8BTgHKAVgB/wE0AbEB - OgH/AVMBtQFcAf8BnwHPAa4B/wHGAd0B1wH/AdIB3QHhAf8BzQHVAdkB/wHIAc4B0AH/AcMByAHJAf8B - wQHCAcMB/wHDAb8BvQH/AaoBoQGfAf8BjQGBAX4B/wFzAWcBYwH/AaoBJwElAWUB0AIBAQUBzwECAQEB - CAGZAToBLQGyAaIBcwFeAf8B2wGlAY4B/wHdAaoBkgH/AeEBrwGWAf8B5gGzAZoB/wHsAbcBnQH/AegB - swGaAf8B3QGqAZIB/wHQAZ4BhwH/AcwBmgGEAf8BzQGaAYQB/wHRAZwBhQH/AcgBlQF/Af8BvQGLAXcB - /wGxAX8BbQH/AbABfgFsAf8BqwF4AWUB/wGgAW0BXAH/AYgBZQFZAf8BgQFeAVEB/wGAAVYBRwH/AXEB - SAE5Af8BWgEyASQB/wFfARkBEAHRAb4BBQEDAScBzQEBAQABCAHOAgABBgHSAgABAQwAAdACAAEFAcUB - LQEoAWUBvQF7AW4B/wHaAagBmAH/AfAB0QHGAf8B/gH1AfAC/wH5AfQC/wH5AfMB/wH+AfcB8QH/Af4B - 9wHxAv8B+AHyAv8B+AHxAf8B/gH2Ae8B/wH+AfEB6gH/Af4B7gHnAf8B/gHvAegB/wH6AewB5QH/AekB - 1QHKAf8BzgGvAaEB/wHVAbkBrAH/Ad0BwwG2Af8B5gHMAcAB/wHoAc0BwAH/AecBqwGVAf8B5gGEAWMB - /wHqAXQBSgH/AdABXQE0Af8BsgFGASEB/wGVATYBFgH/AbgBFAEIAWUB0QEBAQABBQQAAVkCHwGvAUgB - UwFVAf8BiAGWAZsB/wGiAbEBtwH/Ab4BzAHSAf8B1gHlAesB/wHfAfAB9QH/AeYB9wH7Af8B6gH7Af0B - /wHuAf0B/gH/AesB+wH5Af8B0wHzAd8B/wGbAdwBpgH/AX0B0AGIAf8BbgHJAXkB/wFwAcUBfAH/AaAB - 1gGwAf8BwwHiAdYB/wHaAegB7QH/AdQB4AHkAf8BzwHYAdwB/wHKAdEB1AH/AcUBywHMAf8BwQLFAf8B - vAG6AbsB/wGuAagBpgH/AZYBjQGLAf8BdQFsAWkB/wFFAUEBPwH/AZwBFwEWAWAIAAFZAh8BrwFIAVMB - VQH/AYgBlgGbAf8BogGxAbcB/wG+AcwB0gH/AdYB5QHrAf8B3wHwAfUB/wHmAfcB+wH/AeoB+wH9Af8B - 7gH9Af4B/wHxAf4C/wHvAf0B/AH/AeYB+gHzAf8BqQHhAbYB/wF7Ac0BhwH/AWYBxAFyAf8BdQHDAYEB - /wGXAc0BpQH/AcYB3QHWAf8BzwHdAd8B/wHPAdgB3AH/AcoB0QHUAf8BxQHLAcwB/wHBAsUB/wG8AboB - uwH/Aa4BqAGmAf8BlgGNAYsB/wF1AWwBaQH/AUUBQQE/Af8BnAEXARYBYAgAAWYBFwESAa8BYAFBATQB - /wGsAXkBZAH/AdABnQGFAf8B3gGsAZMB/wHgAa4BlgH/AecBtAGaAf8B6gG1AZsB/wHnAbIBmQH/AdwB - qAGQAf8B0gGgAYkB/wHNAZsBhQH/Ac8BmwGEAf8BzgGZAYIB/wHHAZMBfgH/AbwBiQF1Af8BtAGCAW8B - /wGvAX4BawH/AasBeAFlAf8BkgFjAVMB/wGAAVIBQwH/AW0BQgEyAf8BQQEmAR0B/wFtARQBDgGoAa8B - CAEFAUEBzgIBAQocAAHNATEBKgFgAcYBhwF0Af8B4gG5AaoB/wH0Ad4B1QH/Af4B+AH1Av8B/AH4Av8B - +gH2Af8B/gH4AfMB/wH+AfgB8gH/Af4B9wHxAf8B/gH3AfEB/wH+AfcB8QH/Af4B9AHuAf8B/gHzAewB - /wH9AfIB6wH/AfIB5AHdAf8B3AG/AbMB/wG/AYsBeQH/AcoBlAGAAf8BzQGXAYUB/wHNAZgBhgH/AckB - kwF/Af8ByQF9AWIB/wHGAWIBQAH/AboBUAErAf8BlQE7ARwB/wGLASUBEAHTAboBEgEHAVsBywEGAQMB - HggAAYYCDgFoAV0CMAG+AVgBYwFlAf8BhgGUAZoB/wGmAbYBvAH/Ab4BzAHSAf8B0QHgAeYB/wHdAewB - 8QH/AeMB8wH4Af8B5gH2AfoB/wHoAfgB/AH/AeQC9wH/AdcB8QHpAf8BuAHiAcgB/wGnAdkBtwH/AasB - 2AG8Af8ByQHjAdsB/wHVAeUB6AH/AdUB4QHlAf8B0AHZAd0B/wHLAdMB1QH/AcYBzAHOAf8BwAHFAcYB - /wG3ArgB/wGrAacBpgH/AZgBkAGPAf8BeAFwAW4B/wFmAUsBSQHlAW4BHgEdAZ4BrgIKATkIAAGGAg4B - aAFdAjABvgFYAWMBZQH/AYYBlAGaAf8BpgG2AbwB/wG+AcwB0gH/AdEB4AHmAf8B3QHsAfEB/wHjAfMB - +AH/AeYB9gH6Af8B6AH4AfwB/wHpAfkB/AH/AegB+QH7Af8B0AHtAeIB/wG2Ad8BxwH/AZ0B0gGsAf8B - rwHWAb8B/wHCAdsB0wH/AdQB3wHjAf8B0AHZAd0B/wHLAdMB1QH/AcYBzAHOAf8BwAHFAcYB/wG3ArgB - /wGrAacBpgH/AZgBkAGPAf8BeAFwAW4B/wFmAUsBSQHlAW4BHgEdAZ4BrgIKATkIAAGFAQUBBAFoAWkB - HwEVAb4BewFOATMB/wGyAYABZwH/AdABnQGFAf8B3gGsAZMB/wHhAa8BlwH/AegBtAGaAf8B6wG2AZwB - /wHnAbIBmAH/AdsBqAGQAf8B0QGfAYgB/wHMAZoBhAH/Ac8BmwGEAf8BzgGZAYMB/wHIAZQBfgH/AbcB - hAFwAf8BpwF1AWIB/wGZAWcBVAH/AYEBUAE9Af8BZAE6ASoB/wFMASQBGQHyAWEBDQEJAasBnAEEAQMB - TCQAAc4BMwErAWABygGNAXkB/wHpAckBvQH/AfgB6wHlAf8B/gH8AfoC/wH9AfsC/wH8AfkB/wH+AfkB - 9gH/Af4B+AHzAf8B/gH4AfIB/wH+AfgB8wH/Af4B9wHzAf8B/gH4AfMB/wH+AfgB8gH/Af4B+AHzAf8B - 7QHeAdYB/wHaAbgBqwH/AckBjgF7Af8B1gGYAYMB/wHXAZgBggH/AdEBkAF6Af8BxQF/AWYB/wGmAV0B - QgH/AYQBOgEfAf8BbQEqARMB/wF8ARwBCwHFAZ8BDgEFAXEBzwIBAQoQAAGUAggBVAExAhsB4QFpAW4B - cgH3AYkBmAGeAf8BnwGrAbIB/wG8AcgBzgH/Ac0B2gHgAf8B2QHnAewB/wHcAesB8gH/Ad8B7wH1Af8B - 4QHwAfYB/wHhAfAB9gH/Ad8B7gH0Af8B3QHrAfEB/wHbAegB7gH/AdcB5AHpAf8B0wHfAeMB/wHPAdkB - 3QH/AcsB0gHVAf8BxgHMAc4B/wHAAcUBxgH/AbcCuwH/AacCpAH/AZIBiwGKAf8BfwF2AXUB/wFhAUsB - SgHtAW8CIQGnAcsCAwEOEAABlAIIAVQBMQIbAeEBaQFuAXIB9wGJAZgBngH/AZ8BqwGyAf8BvAHIAc4B - /wHNAdoB4AH/AdkB5wHsAf8B3AHrAfIB/wHfAe8B9QH/AeEB8AH2Af8B4QHwAfYB/wHfAe4B9AH/Ad0B - 6wHxAf8B2wHoAe4B/wHXAeQB6QH/AdMB3wHjAf8BzwHZAd0B/wHLAdIB1QH/AcYBzAHOAf8BwAHFAcYB - /wG3ArsB/wGnAqQB/wGSAYsBigH/AX8BdgF1Af8BYQFLAUoB7QFvAiEBpwHLAgMBDhAAAaYBDQEBAVQB - YQEnAQYB4QGMAVUBPwH3AbYBgwFtAf8B2wGnAY4B/wHbAakBkgH/AeIBsAGXAf8B6gG2AZwB/wHuAboB - nwH/AeUBsQGYAf8B2AGlAY4B/wHKAZkBgwH/AckBlgGBAf8ByAGVAX8B/wHFAZEBfAH/AasBeQFlAf8B - iwFcAUsB/wFqAT4BLwH9AWgBLAEZAecBTQEYAQoB3wE+AQcBAQHDAbMBAgEAASokAAHKAQYBBQEWAccB - OwEyAXQB0AGVAYEB/wHvAdcB0AH/AfwB9gH0Av8C/gL/Af4B/QL/Af0B+wH/Af4B+wH4Af8B/gH4AfUC - /wH5AfUC/wH6AfUB/wH+AfgB9QH/Af4B+gH3Af8B/gH8AfkC/wH9AfwB/wHpAdgB0AH/AeABvQGwAf8B - 4wGvAZ0B/wHuAbgBpQH/AewBsgGeAf8B4QGgAYoB+wHTAXkBYgHlAZEBQgEtAd8BTAERAQQB3wEyAQkB - AwHfAYsBBAEBAWIYAAHIAgEBDwGtAQcBCAE1AVQBKwEvAckBVQFfAWIB/wGFAZABlgH/AZgBpQGrAf8B - rQG6Ab8B/wHAAc0B0gH/Ac0B2gHfAf8B1AHhAeYB/wHYAeUB6wH/AdkB5gHrAf8B2AHkAekB/wHWAeIB - 5gH/AdQB3wHjAf8B0AHbAd8B/wHNAdYB2gH/AcgB0AHUAf8BwwHJAcsB/wG7Ab8BwQH/Aa8BsQGyAf8B - nQKbAf8BjgKJAf8BegJ0Af8BWgFUAVMB/wGOAicBhgHBAgYBHgHSAgABAxAAAcgCAQEPAa0BBwEIATUB - VAErAS8ByQFVAV8BYgH/AYUBkAGWAf8BmAGlAasB/wGtAboBvwH/AcABzQHSAf8BzQHaAd8B/wHUAeEB - 5gH/AdgB5QHrAf8B2QHmAesB/wHYAeQB6QH/AdYB4gHmAf8B1AHfAeMB/wHQAdsB3wH/Ac0B1gHaAf8B - yAHQAdQB/wHDAckBywH/AbsBvwHBAf8BrwGxAbIB/wGdApsB/wGOAokB/wF6AnQB/wFaAVQBUwH/AY4C - JwGGAcECBgEeAdICAAEDEAABzAECAQABDwG4AQkBAwE1AXYBKwEcAckBiQFcAUgB/wHEAZABeAH/AdgB - pQGMAf8B3wGtAZQB/wHjAbABlwH/AesBtwGcAf8B6QG1AZoB/wHfAaoBkQH/AccBlAF+Af8BtAGCAW0B - /wGaAWsBWQH/AXYBTwFAAf8BYAE6ASwB/wE/ASMBGgH/ASMBDAEJAfIBlgEJAQYBXgG7AQUBAgEoAbgB - AQEAASMBzAIAAQgkAAGSASoBIwGUAZ0BYgFVAeYB5AGpAZUB/wH2AeQB3gH/Af4B+wH6Af8B/gH9AfwB - /wH+Af0B+wH/Af4B/AH6Af8B/gH7AfkB/wH+AfoB9wH/Af4B+wH3Af8B/gH7AfgB/wH+AfkB9gH/Af4B - +AH1Af8B/gH5AfYB/wH+AfsB+QH/AekB0QHJAf8B5gHEAbcB/wHwAcoBvQH/AfABwgGyAf8B3AGnAZUB - /wHDAXoBaAHkAdABKgEjAVABxwEMAQgBKAG7AQMBAQEoAbYBAgEBASgBxgEBAQABEhwAAc4CAQEHAZgB - DQEOAVQBaAErASwBrwFKAVABUgH/AWQBbQFwAf8BhQGQAZMB/wGhAa0BsQH/Aa0BuAG9Af8BtgHBAcUB - /wG9AcgBzAH/AcIBzAHQAf8BwwHNAdEB/wHDAcwB0AH/AcIBygHOAf8BvgHFAckB/wG5Ab8BwgH/AbIB - tgG5Af8BqwGuAa8B/wGiAaMBpAH/AZUBlAGVAf8BfwF9AXwB/wFlAWIBYQH/AV0CRAHkAY4CJAGCAbgC - DgExHAABzgIBAQcBmAENAQ4BVAFoASsBLAGvAUoBUAFSAf8BZAFtAXAB/wGFAZABkwH/AaEBrQGxAf8B - rQG4Ab0B/wG2AcEBxQH/Ab0ByAHMAf8BwgHMAdAB/wHDAc0B0QH/AcMBzAHQAf8BwgHKAc4B/wG+AcUB - yQH/AbkBvwHCAf8BsgG2AbkB/wGrAa4BrwH/AaIBowGkAf8BlQGUAZUB/wF/AX0BfAH/AWUBYgFhAf8B - XQJEAeQBjgIkAYIBuAIOATEcAAHJAgEBEAFUARABCgG/AVMBMwEmAf8BkQFgAU0B/wHBAY4BdgH/AdYB - ogGKAf8B2wGoAZAB/wHUAaIBiQH/AccBlAF8Af8BswGAAWoB/wGUAWQBUgH/AXABSgE9Af8BcgEyASgB - 0gGiARwBFgFwAZkBEwEOAXABigEKAQcBcAF/AgEBaQG9AgABHDAAAYkBMQEqAa8BmAFuAV4B/wHqAa8B - mQH/AfQB0gHFAf8B+AHgAdcB/wH4AeMB2gH/AfkB5AHdAf8B+gHmAd4B/wH6AecB4AH/AfoB6QHiAf8B - +wHsAeYB/wH7Ae8B6QH/AfwB8AHrAf8B/AHwAesB/wH9AfMB7gH/Af0B9wH0Af8B7AHQAcYB/wHpAcMB - tQH/AfABxwG5Af8B1wGnAZgB/wGbAXQBZgH/AWkBOAEvAd8BvAEMAQoBMDQAAZkCCQFRAVQCGAG3AWsC - NAG3AYkBUwFVAbcBmwFyAXUBxQGNAY4BkgH2AZYBngGiAf8BoAGpAa0B/wGmAa0BsQH/AakBsAGzAf8B - qQGwAbIB/wGpAa4BsQH/AaUBqgGsAf8BoQGjAaUB/wGZAZsBnQH/AZACkQH/A3wB/wFqAmEB9gF/AU0B - TAHFAXABNAEzAbcBcQIYAZUBxAIEARcoAAGZAgkBUQFUAhgBtwFrAjQBtwGJAVMBVQG3AZsBcgF1AcUB - jQGOAZIB9gGWAZ4BogH/AaABqQGtAf8BpgGtAbEB/wGpAbABswH/AakBsAGyAf8BqQGuAbEB/wGlAaoB - rAH/AaEBowGlAf8BmQGbAZ0B/wGQApEB/wN8Af8BagJhAfYBfwFNAUwBxQFwATQBMwG3AXECGAGVAcQC - BAEXIAABygIAAQwBaAEEAQEBiQFeARMBDQG3AYcBLwEjAcABogFmAVMB8gG1AYEBbAH/AboBhwFyAf8B - pAF0AWEB/wGlAVwBSgHXAaMBQwE2AbcBigEsASIBtwFoARgBEwG3AX0BCgEHAX5EAAGfASQBHwF+AasB - UAFDAbcB4QF/AW8BvAHNAZYBiAHtAdcBrQGeAf8B8AHAAbAB/wHxAcQBtAH/AfIBxwG3Af8B8gHJAboB - /wH0AcwBvQH/AfQB0AHCAf8B9QHTAccB/wH2AdYBygH/AfcB1wHLAf8B9wHZAc4B/wH4Ad4B1QH/Ae4B - xAG2Af8B6wG6AacB/wHrAbQBogH7AcoBdAFmAckBigE3AS8BtwFYAQcBBgGgAbgCAQEjRAABvwEUARUB - MAF4AV4BXwHfAXsBgAGDAf8BiAGPAZMB/wGLAZABlAH/AYoBjwGSAf8BiQGNAY8B/wGIAYsBjQH/AYgB - igGMAf8ChwGJAf8CgwGFAf8DeQH/A0oB/wErAhEB3wGvAgQBMEQAAb8BFAEVATABeAFeAV8B3wF7AYAB - gwH/AYgBjwGTAf8BiwGQAZQB/wGKAY8BkgH/AYkBjQGPAf8BiAGLAY0B/wGIAYoBjAH/AocBiQH/AoMB - hQH/A3kB/wNKAf8BKwIRAd8BrwIEATA4AAHHAQcBBQEgAYABLQEgAc8BdAFBATAB/wFzAUEBMQH/AVQB - KQEdAf8BmAEQAQsBcFwAAcsCAwEQAW8BKAEiAb8BkQFiAVUB/wHmAZ0BhgH/AegBowGIAf8B6QGkAYoB - /wHpAaQBiwH/AesBpAGLAf8B6wGkAYsB/wHsAaUBiwH/Ae0BpgGMAf8B7AGlAYwB/wHrAaQBjAH/AesB - pQGNAf8B6gGkAYwB/wHqAaQBigH/AekBmQF/Ae8B2QEpASIBQCwAAUIBTQE+BwABPgMAASgDAAGAAwAB - YAMAAQEBAAEBBgABBhYAA///AP8AAwAB4AEAAQcB/wwAAeACAAEfDAAB4AIAAQEMAAHgAgABAQwAAeAP - AAHgDwAB4A8AAeAPAAHgDwAB4A8AAeAPAAHgAgABAQwAAcACAAEDDAABwAIAAQMMAAHAAgABAwwAAcAC - AAEBDAABgA8AAYAPAAGADwABgA8AAYAPAAGADwABgA8AAYACAAEBDAABgAIAAQEMAAGAAgABfw8AAX8P - AAH/DwAB/w4AAQMB/w4AAQcB/wwAAYABAAEfAf8MAAH8AgABfwH8AgABfwH/AQABAwH/AfwBAAEDAf8B - +AIAAR8B+AIAAR8B/AIAAR8B/AIAAQMB4AIAAQMB4AIAAQMB/AIAAQMB/AIAAQMB4AIAAQMB4AIAAQMB - /AIAAQMB/AIAAQMBwAIAAQMBwAIAAQMB+AIAAQEB+AIAAQMBgAIAAQEBgAIAAQEB4AIAAQEB+AIAAQMB - gAMAAYADAAHAAgABAQH4AgABAwGAAwABgAMAAcACAAEBAfgCAAEDAYADAAGAAwABgAIAAQEB+AIAAQMI - AAGAAgABAQGAAgABAwgAAYACAAEBAYACAAEDCAABgAIAAQEBgAIAAQMIAAGAAgABAQMAAQEIAAGAAgAB - AQwAAYACAAEBDAABgAIAAQEMAAGADwABgA8AAYBCAAEBAYADAAGAAwABgAYAAQMBgAMAAYADAAGABgAB - AwGAAwABgAIAAQEBgAIAAQEBgAIAAR8BwAIAAQEBgAIAAQEBgAIAAQEBgAIAAX8BwAIAAQMBwAIAAQMB - wAIAAQMBwAIAAf8BgAIAAQ8BwAIAAQMBwAIAAQMBwAIAAf8BgAIAAQ8B4AIAAQ8B4AIAAQ8B4AEAAQcB - /wGAAgAB/wH4AgABHwH4AgABHwHgAQAC/wGAAgAC/wGAAQAC/wGAAQAB/wH8AQ8C/wHgAQABBwH/FgAL - - - - 146, 26 - - - Form1 - - \ No newline at end of file diff --git a/embedding/browser/activex/tests/csbrowse/back.bmp b/embedding/browser/activex/tests/csbrowse/back.bmp deleted file mode 100644 index 582badea13b..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/back.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/csbrowse/forward.bmp b/embedding/browser/activex/tests/csbrowse/forward.bmp deleted file mode 100644 index b33a8486a36..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/forward.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/csbrowse/home.bmp b/embedding/browser/activex/tests/csbrowse/home.bmp deleted file mode 100644 index c329cda77a4..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/home.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/csbrowse/reload.bmp b/embedding/browser/activex/tests/csbrowse/reload.bmp deleted file mode 100644 index 111aafe7e8d..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/reload.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/csbrowse/stop.bmp b/embedding/browser/activex/tests/csbrowse/stop.bmp deleted file mode 100644 index bce64ce0a6c..00000000000 Binary files a/embedding/browser/activex/tests/csbrowse/stop.bmp and /dev/null differ diff --git a/embedding/browser/activex/tests/dbrowse/form.dcu b/embedding/browser/activex/tests/dbrowse/form.dcu deleted file mode 100644 index a9ce0b4a5a3..00000000000 Binary files a/embedding/browser/activex/tests/dbrowse/form.dcu and /dev/null differ diff --git a/embedding/browser/activex/tests/dbrowse/form.dfm b/embedding/browser/activex/tests/dbrowse/form.dfm deleted file mode 100644 index fbf2e879959..00000000000 Binary files a/embedding/browser/activex/tests/dbrowse/form.dfm and /dev/null differ diff --git a/embedding/browser/activex/tests/dbrowse/form.pas b/embedding/browser/activex/tests/dbrowse/form.pas deleted file mode 100644 index 220201b1c78..00000000000 --- a/embedding/browser/activex/tests/dbrowse/form.pas +++ /dev/null @@ -1,91 +0,0 @@ -unit form; - -interface - -uses - Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - StdCtrls, OleCtrls, SHDocVw_TLB, MOZILLACONTROLLib_TLB, ExtCtrls, - ComCtrls; - -type - TMainForm = class(TForm) - Browser: TMozillaBrowser; - Panel: TPanel; - Status: TPanel; - Address: TComboBox; - Go: TButton; - WebProgress: TProgressBar; - Stop: TButton; - procedure GoClick(Sender: TObject); - procedure FormResize(Sender: TObject); - procedure OnStatusTextChange(Sender: TObject; const Text: WideString); - procedure OnProgressChange(Sender: TObject; Progress, - ProgressMax: Integer); - procedure StopClick(Sender: TObject); - private - { Private declarations } - public - { Public declarations } - end; - -var - MainForm: TMainForm; - -implementation - -{$R *.DFM} - -procedure TMainForm.GoClick(Sender: TObject); -var Flags, TargetFrameName, PostData, Headers: OleVariant; -begin - Flags := 0; - Browser.Navigate(Address.Text, Flags, TargetFrameName, PostData, Headers); -end; - -procedure TMainForm.FormResize(Sender: TObject); -var - oldPanelWidth : Integer; -begin - oldPanelWidth := Panel.Width; - Panel.Top := MainForm.ClientHeight - Panel.Height; - Panel.Width := MainForm.ClientWidth; - Go.Left := Go.Left + Panel.Width - oldPanelWidth; - WebProgress.Left := WebProgress.Left + Panel.Width - oldPanelWidth; - Address.Width := Address.Width + Panel.Width - oldPanelWidth; - Status.Width := Status.Width + Panel.Width - oldPanelWidth; - Browser.Width := MainForm.ClientWidth; - Browser.Height := MainForm.ClientHeight - Panel.Height; -end; - -procedure TMainForm.OnStatusTextChange(Sender: TObject; - const Text: WideString); -begin - Status.Caption := Text; -end; - -procedure TMainForm.OnProgressChange(Sender: TObject; Progress, - ProgressMax: Integer); -begin - if Progress < 0 then - begin - WebProgress.Position := 0; - WebProgress.Max := 100; - end - else if ProgressMax < Progress then - begin - WebProgress.Position := Progress; - WebProgress.Max := Progress * 10; - end - else - begin - WebProgress.Position := Progress; - WebProgress.Max := ProgressMax; - end -end; - -procedure TMainForm.StopClick(Sender: TObject); -begin - Browser.Stop(); -end; - -end. diff --git a/embedding/browser/activex/tests/dbrowse/webbrowser.dof b/embedding/browser/activex/tests/dbrowse/webbrowser.dof deleted file mode 100644 index d82e8794734..00000000000 --- a/embedding/browser/activex/tests/dbrowse/webbrowser.dof +++ /dev/null @@ -1,75 +0,0 @@ -[Compiler] -A=1 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=0 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -SearchPath= -Packages=vclx30;VCL30;vcldb30;vcldbx30;VclSmp30;Qrpt30 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=2057 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= diff --git a/embedding/browser/activex/tests/dbrowse/webbrowser.dpr b/embedding/browser/activex/tests/dbrowse/webbrowser.dpr deleted file mode 100644 index 0756d5c9ac6..00000000000 --- a/embedding/browser/activex/tests/dbrowse/webbrowser.dpr +++ /dev/null @@ -1,14 +0,0 @@ -program webbrowser; - -uses - Forms, - SHDocVw_TLB in '..\..\Imports\SHDocVw_TLB.pas', - form in 'form.pas' {MainForm}; - -{$R *.RES} - -begin - Application.Initialize; - Application.CreateForm(TMainForm, MainForm); - Application.Run; -end. diff --git a/embedding/browser/activex/tests/plugin/calendar.html b/embedding/browser/activex/tests/plugin/calendar.html deleted file mode 100644 index fd6fb853947..00000000000 --- a/embedding/browser/activex/tests/plugin/calendar.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - -

This page is designed for Communicator 4.x with the Mozilla -ActiveX plugin installed! You also need to have the MS calendar control installed to see anything

- -

- - diff --git a/embedding/browser/activex/tests/plugin/calendar_scripted.htm b/embedding/browser/activex/tests/plugin/calendar_scripted.htm deleted file mode 100644 index 541a69a61e5..00000000000 --- a/embedding/browser/activex/tests/plugin/calendar_scripted.htm +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Mozilla Plugin Test Page - - - - - -

This page is designed for Communicator 4.x, Netscape 7.x or -Mozilla 1.x with the Mozilla ActiveX plugin installed! You also need -to have the MS calendar control installed to see anything

- -

- - -

-
- -
- -
- Change the current day: -
-
-
- These tests should cause exceptions by calling with duff property names etc.
- - - - -
-

- -

- - - - diff --git a/embedding/browser/activex/tests/vbrowse/VBrowse.vbp b/embedding/browser/activex/tests/vbrowse/VBrowse.vbp deleted file mode 100644 index ab1a1b48da6..00000000000 --- a/embedding/browser/activex/tests/vbrowse/VBrowse.vbp +++ /dev/null @@ -1,37 +0,0 @@ -Type=Exe -Form=browser.frm -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT40\System32\stdole2.tlb#OLE Automation -Object={1339B53E-3453-11D2-93B9-000000000000}#1.0#0; MozillaControl.dll -Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX -Object={FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.0#0; comct232.ocx -Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0; comctl32.ocx -Form=frmToolBar.frm -Object={EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0; SHDOCVW.DLL -Form=frmExplorer.frm -IconForm="frmMozilla" -Startup="frmToolBar" -HelpFile="" -ExeName32="VBrowse.exe" -Command32="" -Name="Project1" -HelpContextID="0" -CompatibleMode="0" -MajorVer=1 -MinorVer=0 -RevisionVer=0 -AutoIncrementVer=0 -ServerSupportFiles=0 -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 diff --git a/embedding/browser/activex/tests/vbrowse/browser.frm b/embedding/browser/activex/tests/vbrowse/browser.frm deleted file mode 100644 index 51f521bd885..00000000000 --- a/embedding/browser/activex/tests/vbrowse/browser.frm +++ /dev/null @@ -1,54 +0,0 @@ -VERSION 5.00 -Object = "{1339B53E-3453-11D2-93B9-000000000000}#1.0#0"; "MozillaControl.dll" -Begin VB.Form frmMozilla - Caption = "Mozilla Control" - ClientHeight = 5880 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 7710 - LinkTopic = "Form1" - ScaleHeight = 392 - ScaleMode = 3 'Pixel - ScaleWidth = 514 - Begin MOZILLACONTROLLibCtl.MozillaBrowser Browser1 - Height = 5535 - Left = 0 - OleObjectBlob = "browser.frx":0000 - TabIndex = 0 - Top = 0 - Width = 7695 - End -End -Attribute VB_Name = "frmMozilla" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub Browser1_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean) - frmToolBar.Browser_BeforeNavigate URL, Flags, TargetFrameName, PostData, Headers, Cancel -End Sub - -Private Sub Browser1_NavigateComplete(ByVal URL As String) - frmToolBar.Browser_NavigateComplete URL -End Sub - -Private Sub Browser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean) - frmToolBar.Browser_BeforeNavigate2 pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel -End Sub - -Private Sub Browser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) - frmToolBar.Browser_NavigateComplete2 pDisp, URL -End Sub - -Private Sub Browser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long) - frmToolBar.Browser_ProgressChange Progress, ProgressMax -End Sub - -Private Sub Browser1_StatusTextChange(ByVal Text As String) - frmToolBar.Browser_StatusTextChange Text -End Sub - -Private Sub Form_Resize() - Browser1.Width = ScaleWidth - Browser1.Height = ScaleHeight -End Sub diff --git a/embedding/browser/activex/tests/vbrowse/browser.frx b/embedding/browser/activex/tests/vbrowse/browser.frx deleted file mode 100644 index 9ae0f67293c..00000000000 Binary files a/embedding/browser/activex/tests/vbrowse/browser.frx and /dev/null differ diff --git a/embedding/browser/activex/tests/vbrowse/frmExplorer.frm b/embedding/browser/activex/tests/vbrowse/frmExplorer.frm deleted file mode 100644 index 93389e51024..00000000000 --- a/embedding/browser/activex/tests/vbrowse/frmExplorer.frm +++ /dev/null @@ -1,63 +0,0 @@ -VERSION 5.00 -Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL" -Begin VB.Form frmExplorer - Caption = "Internet Explorer Control" - ClientHeight = 5550 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 6675 - LinkTopic = "Form1" - ScaleHeight = 5550 - ScaleWidth = 6675 - StartUpPosition = 3 'Windows Default - Begin SHDocVwCtl.WebBrowser Browser1 - Height = 3015 - Left = 0 - TabIndex = 0 - Top = 0 - Width = 4575 - ExtentX = 8070 - ExtentY = 5318 - ViewMode = 1 - Offline = 0 - Silent = 0 - RegisterAsBrowser= 0 - RegisterAsDropTarget= 1 - AutoArrange = -1 'True - NoClientEdge = 0 'False - AlignLeft = 0 'False - ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}" - Location = "" - End -End -Attribute VB_Name = "frmExplorer" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub Browser1_NavigateComplete(ByVal URL As String) - frmToolBar.Browser_NavigateComplete URL -End Sub - -Private Sub Browser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long) - frmToolBar.Browser_ProgressChange Progress, ProgressMax -End Sub - -Private Sub Browser1_StatusTextChange(ByVal Text As String) - frmToolBar.Browser_StatusTextChange Text -End Sub - -Private Sub Form_Resize() - Browser1.Width = ScaleWidth - Browser1.Height = ScaleHeight -End Sub - -Private Sub Browser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean) - frmToolBar.Browser_BeforeNavigate2 pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel -End Sub - -Private Sub Browser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) - frmToolBar.Browser_NavigateComplete2 pDisp, URL -End Sub - - diff --git a/embedding/browser/activex/tests/vbrowse/frmToolBar.frm b/embedding/browser/activex/tests/vbrowse/frmToolBar.frm deleted file mode 100644 index 92ee26e058c..00000000000 --- a/embedding/browser/activex/tests/vbrowse/frmToolBar.frm +++ /dev/null @@ -1,315 +0,0 @@ -VERSION 5.00 -Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "comctl32.ocx" -Begin VB.Form frmToolBar - Caption = "Control Bar" - ClientHeight = 1215 - ClientLeft = 165 - ClientTop = 735 - ClientWidth = 7965 - LinkTopic = "Form2" - ScaleHeight = 81 - ScaleMode = 3 'Pixel - ScaleWidth = 531 - StartUpPosition = 3 'Windows Default - Begin ComctlLib.Toolbar Toolbar1 - Align = 1 'Align Top - Height = 660 - Left = 0 - TabIndex = 0 - Top = 0 - Width = 7965 - _ExtentX = 14049 - _ExtentY = 1164 - ButtonWidth = 1032 - ButtonHeight = 1005 - AllowCustomize = 0 'False - Appearance = 1 - ImageList = "ImageList1" - _Version = 327682 - BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} - NumButtons = 10 - BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "goback" - Object.ToolTipText = "Go Back" - Object.Tag = "" - ImageIndex = 1 - EndProperty - BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "goforward" - Object.ToolTipText = "Go Forward" - Object.Tag = "" - ImageIndex = 5 - EndProperty - BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "reload" - Object.ToolTipText = "Reload Page" - Object.Tag = "" - ImageIndex = 6 - EndProperty - BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} - Object.Tag = "" - Style = 3 - MixedState = -1 'True - EndProperty - BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "gohome" - Object.ToolTipText = "Go Home" - Object.Tag = "" - ImageIndex = 3 - EndProperty - BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "gosearch" - Object.ToolTipText = "Search Web" - Object.Tag = "" - ImageIndex = 8 - EndProperty - BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "ph" - Object.Tag = "" - Style = 4 - Object.Width = 200 - MixedState = -1 'True - EndProperty - BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "loadpage" - Object.ToolTipText = "Load this URL" - Object.Tag = "" - ImageIndex = 4 - EndProperty - BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7} - Object.Tag = "" - Style = 3 - MixedState = -1 'True - EndProperty - BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7} - Key = "stop" - Object.ToolTipText = "Stop Loading" - Object.Tag = "" - ImageIndex = 2 - EndProperty - EndProperty - Begin VB.ComboBox cmbUrl - BeginProperty Font - Name = "MS Sans Serif" - Size = 12 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 420 - ItemData = "frmToolBar.frx":0000 - Left = 3120 - List = "frmToolBar.frx":0016 - TabIndex = 1 - Text = "http://www.mozilla.com" - Top = 120 - Width = 2895 - End - End - Begin VB.OptionButton rbExplorer - Caption = "InternetExplorer" - Height = 255 - Left = 2160 - TabIndex = 4 - Top = 720 - Width = 1575 - End - Begin VB.OptionButton rbMozilla - Caption = "Mozilla" - Height = 255 - Left = 960 - TabIndex = 3 - Top = 720 - Value = -1 'True - Width = 1215 - End - Begin ComctlLib.StatusBar StatusBar1 - Align = 2 'Align Bottom - Height = 255 - Left = 0 - TabIndex = 2 - Top = 960 - Width = 7965 - _ExtentX = 14049 - _ExtentY = 450 - SimpleText = "" - _Version = 327682 - BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} - NumPanels = 2 - BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} - AutoSize = 1 - Object.Width = 11404 - MinWidth = 2646 - TextSave = "" - Object.Tag = "" - EndProperty - BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} - Alignment = 2 - Object.Width = 2117 - MinWidth = 2117 - TextSave = "" - Object.Tag = "" - EndProperty - EndProperty - End - Begin VB.Label Label1 - Caption = "Control:" - Height = 255 - Left = 120 - TabIndex = 5 - Top = 720 - Width = 855 - End - Begin ComctlLib.ImageList ImageList1 - Left = 6240 - Top = 480 - _ExtentX = 1005 - _ExtentY = 1005 - BackColor = -2147483643 - ImageWidth = 32 - ImageHeight = 32 - MaskColor = 12632256 - _Version = 327682 - BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} - NumListImages = 8 - BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":00A4 - Key = "back" - EndProperty - BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":03BE - Key = "stop" - EndProperty - BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":06D8 - Key = "home" - EndProperty - BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":09F2 - Key = "gotopage" - EndProperty - BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":0D0C - Key = "forward" - EndProperty - BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":1026 - Key = "reload" - EndProperty - BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":1340 - Key = "go" - EndProperty - BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} - Picture = "frmToolBar.frx":165A - Key = "gofind" - EndProperty - EndProperty - End - Begin VB.Menu debug - Caption = "Debug" - Begin VB.Menu verbs - Caption = "OLE Verbs" - End - End -End -Attribute VB_Name = "frmToolBar" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Dim browser As Object - -Private Sub Form_Load() - frmMozilla.Show - frmExplorer.Show - Set browser = frmMozilla.Browser1 -End Sub - -Sub Browser_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean) - Debug.Print "Browser_BeforeNavigate " & URL - StatusBar1.Panels(1).Text = "Loading " & URL -End Sub - -Sub Browser_NavigateComplete(ByVal URL As String) - Debug.Print "Browser_NavigateComplete " & URL - StatusBar1.Panels(1).Text = "Loaded " & URL - StatusBar1.Panels(2).Text = "" -End Sub - -Sub Browser_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean) - Debug.Print "Browser_BeforeNavigate2 " & URL - StatusBar1.Panels(1).Text = "Loaded " & URL - StatusBar1.Panels(2).Text = "" -End Sub - -Sub Browser_NavigateComplete2(ByVal pDisp As Object, URL As Variant) - Debug.Print "Browser_NavigateComplete2 " & URL - StatusBar1.Panels(1).Text = "Loaded " & URL - StatusBar1.Panels(2).Text = "" -End Sub - -Sub Browser_StatusTextChange(ByVal Text As String) - Debug.Print "Browser_StatusTextChange " & Text - StatusBar1.Panels(1).Text = Text -End Sub - -Sub Browser_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long) - Dim fProgress As Double - If Progress = 0 Then -' fProgress = 0 - ElseIf ProgressMax > 0 Then -' fProgress = (Progress * 100) / ProgressMax - Else - ' fProgress = 0# - Debug.Print "Progress error - Progress = " & Progress & ", ProgressMax = " & ProgressMax - End If -' StatusBar1.Panels(2).Text = Int(fProgress) & "%" -End Sub - -Private Sub rbExplorer_Click() - Set browser = frmExplorer.Browser1 -End Sub - -Private Sub rbMozilla_Click() - Set browser = frmMozilla.Browser1 -End Sub - -Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button) - Select Case Button.Key - Case "goback" - browser.GoBack - Case "goforward" - browser.GoForward - Case "reload" - browser.Refresh - Case "gohome" - browser.GoHome - Case "gosearch" - browser.GoSearch - Case "loadpage" - browser.Navigate cmbUrl.Text - Case "stop" - browser.Stop - Case Else - End Select -End Sub - -Private Sub verbs_Click() - ' Query the browser to see what IOleCommandTarget commands it supports - Dim nCmd As Integer - Dim nStatus As Integer - For nCmd = 1 To 40 - nStatus = browser.QueryStatusWB(nCmd) - If nStatus And 1 Then - Debug.Print "Command " & nCmd & " is supported" - Else - Debug.Print "Command " & nCmd & " is not supported" - End If - If nStatus And 2 Then - Debug.Print "Command " & nCmd & " is disabled" - End If - Next -End Sub diff --git a/embedding/browser/activex/tests/vbrowse/frmToolBar.frx b/embedding/browser/activex/tests/vbrowse/frmToolBar.frx deleted file mode 100644 index 119c739205a..00000000000 Binary files a/embedding/browser/activex/tests/vbrowse/frmToolBar.frx and /dev/null differ diff --git a/embedding/browser/activex/tests/vbxml/test.xml b/embedding/browser/activex/tests/vbxml/test.xml deleted file mode 100644 index fd40dfb207d..00000000000 --- a/embedding/browser/activex/tests/vbxml/test.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - function StartUp() - { - dump("Doing Startup...\n"); - appCore = XPAppCoresManager.Find("BrowserAppCore"); - dump("Looking up BrowserAppCore...\n"); - if (appCore == null) { - dump("Creating BrowserAppCore...\n"); - appCore = new BrowserAppCore(); - if (appCore != null) { - dump("BrowserAppCore has been created.\n"); - appCore.Init("BrowserAppCore"); - appCore.setToolbarWindow(window); - appCore.setContentWindow(window.parent.frames[1]); - appCore.setWebShellWindow(window.parent); - appCore.setDisableCallback("DoDisableButtons();"); - appCore.setEnableCallback("DoEnableButtons();"); - dump("Adding BrowserAppCore to AppCoreManager...\n"); - XPAppCoresManager.Add(appCore); - } - } else { - dump("BrowserAppCore has already been created! Why?\n"); - } - } - - function DoDisableButtons() - { - // Find buttons in the UI and disable them - dump("Browser disabling buttons\n"); - } - - function DoEnableButtons() - { - // Find buttons in the UI and enable them - dump("Browser enabling buttons\n"); - } - - function BrowserBack() - { - appCore = XPAppCoresManager.Find("BrowserAppCore"); - if (appCore != null) { - dump("Going Back\n"); - appCore.back(); - } else { - dump("BrowserAppCore has not been created!\n"); - } - } - - function BrowserForward() - { - appCore = XPAppCoresManager.Find("BrowserAppCore"); - if (appCore != null) { - dump("Going Forward\n"); - appCore.forward(); - } else { - dump("BrowserAppCore has not been created!\n"); - } - } - - function BrowserNewWindow() - { - appCore = XPAppCoresManager.Find("BrowserAppCore"); - if (appCore != null) { - dump("Opening New Window\n"); - appCore.newWindow(); - } else { - dump("BrowserAppCore has not been created!\n"); - } - } - - function BrowserPrintPreview() - { - dump("BrowserPrintPreview\n"); - } - - function BrowserClose() - { - dump("BrowserClose\n"); - } - - function BrowserExit() - { - appCore = XPAppCoresManager.Find("BrowserAppCore"); - if (appCore != null) { - dump("Exiting\n"); - appCore.exit(); - } else { - dump("BrowserAppCore has not been created!\n"); - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Back - - - Forward - - - Reload - - - Stop - - - Home - - - Print - - - - - - - - Bookmarks - - - - What's Related - - - - - - Mozilla.org - - - Mozilla.org - - - Mozilla.org - - - - - - - diff --git a/embedding/browser/activex/tests/vbxml/xml.frm b/embedding/browser/activex/tests/vbxml/xml.frm deleted file mode 100644 index 19e30abd128..00000000000 --- a/embedding/browser/activex/tests/vbxml/xml.frm +++ /dev/null @@ -1,76 +0,0 @@ -VERSION 5.00 -Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" -Begin VB.Form Form1 - Caption = "Form1" - ClientHeight = 4932 - ClientLeft = 48 - ClientTop = 276 - ClientWidth = 5052 - LinkTopic = "Form1" - ScaleHeight = 4932 - ScaleWidth = 5052 - StartUpPosition = 3 'Windows Default - Begin MSComctlLib.TreeView treeXML - Height = 4692 - Left = 120 - TabIndex = 3 - Top = 120 - Width = 3132 - _ExtentX = 5525 - _ExtentY = 8276 - _Version = 393217 - Indentation = 176 - LineStyle = 1 - Style = 7 - Appearance = 1 - End - Begin VB.TextBox txtURL - Height = 288 - Left = 3480 - TabIndex = 1 - Text = "M:\moz\mozilla\webshell\embed\ActiveX\xml\tests\vbxml\test.xml" - Top = 480 - Width = 1332 - End - Begin VB.CommandButton Command1 - Caption = "Parse XML" - Height = 492 - Left = 3480 - TabIndex = 0 - Top = 960 - Width = 1332 - End - Begin VB.Label Label1 - Caption = "XML File:" - Height = 252 - Left = 3480 - TabIndex = 2 - Top = 120 - Width = 852 - End -End -Attribute VB_Name = "Form1" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub Command1_Click() - Dim o As New MozXMLDocument - o.URL = txtURL.Text - Debug.Print o.root.tagName - treeXML.Nodes.Add , , "R", "XML" - buildBranch "R", o.root -End Sub - -Sub buildBranch(ByRef sParentKey As String, o As Object) - Dim n As Integer - Dim c As Object - Dim sKey As String - - Set c = o.children - For i = 0 To c.length - 1 - sKey = sParentKey + "." + CStr(i) - treeXML.Nodes.Add sParentKey, tvwChild, sKey, c.Item(i).tagName - buildBranch sKey, c.Item(i) - Next -End Sub diff --git a/embedding/browser/activex/tests/vbxml/xml.vbp b/embedding/browser/activex/tests/vbxml/xml.vbp deleted file mode 100644 index 30133eea281..00000000000 --- a/embedding/browser/activex/tests/vbxml/xml.vbp +++ /dev/null @@ -1,33 +0,0 @@ -Type=Exe -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\StdOle2.Tlb#OLE Automation -Reference=*\G{45E5B410-2805-11D3-9425-000000000000}#1.0#0#..\..\Debug\activexml.dll#Mozilla XML 1.0 Type Library -Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX -Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCX -Object={38911DA0-E448-11D0-84A3-00DD01104159}#1.1#0; COMCT332.OCX -Form=xml.frm -Startup="Form1" -ExeName32="xml.exe" -Command32="" -Name="Project1" -HelpContextID="0" -CompatibleMode="0" -MajorVer=1 -MinorVer=0 -RevisionVer=0 -AutoIncrementVer=0 -ServerSupportFiles=0 -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -Retained=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 diff --git a/embedding/browser/activex/tests/vbxml/xml.vbw b/embedding/browser/activex/tests/vbxml/xml.vbw deleted file mode 100644 index f03dd00b88e..00000000000 --- a/embedding/browser/activex/tests/vbxml/xml.vbw +++ /dev/null @@ -1 +0,0 @@ -Form1 = 99, 16, 850, 493, , 22, 22, 653, 533, C