From b9db4ad68a56e1a0ebbd2f1ae41d6d23a00842b1 Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Thu, 13 Jan 2000 23:33:27 +0000 Subject: [PATCH] Fixed control after changes to web shell caused compile errors --- webshell/embed/ActiveX/MozillaBrowser.cpp | 22 ++- webshell/embed/ActiveX/MozillaBrowser.h | 1 + webshell/embed/ActiveX/StdAfx.h | 166 ---------------------- webshell/embed/ActiveX/guids.cpp | 46 ------ webshell/embed/ActiveX/guids.h | 51 ------- 5 files changed, 16 insertions(+), 270 deletions(-) diff --git a/webshell/embed/ActiveX/MozillaBrowser.cpp b/webshell/embed/ActiveX/MozillaBrowser.cpp index 9c3f32cb3ae..c192f3ef197 100644 --- a/webshell/embed/ActiveX/MozillaBrowser.cpp +++ b/webshell/embed/ActiveX/MozillaBrowser.cpp @@ -79,7 +79,7 @@ CMozillaBrowser::CMozillaBrowser() // Initialize layout interfaces m_pIWebShell = nsnull; - + m_pIWebShellWin = nsnull; m_pIPref = nsnull; m_pIServiceManager = nsnull; @@ -227,9 +227,14 @@ LRESULT CMozillaBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL } // Destroy layout... + if (m_pIWebShellWin != nsnull) + { + m_pIWebShellWin->Destroy(); + NS_RELEASE(m_pIWebShellWin); + } + if (m_pIWebShell != nsnull) { - m_pIWebShell->Destroy(); NS_RELEASE(m_pIWebShell); } @@ -254,10 +259,11 @@ LRESULT CMozillaBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b NG_TRACE_METHOD(CMozillaBrowser::OnSize); // Pass resize information down to the WebShell... - if (m_pIWebShell) + if (m_pIWebShellWin) { - m_pIWebShell->SetBounds(0, 0, LOWORD(lParam), HIWORD(lParam)); - } + m_pIWebShellWin->SetPosition(0, 0); + m_pIWebShellWin->SetSize(LOWORD(lParam), HIWORD(lParam), PR_TRUE); + } return 0; } @@ -674,6 +680,8 @@ HRESULT CMozillaBrowser::CreateWebShell() return E_FAIL; } + m_pIWebShell->QueryInterface(kIBaseWindowIID, (void **) &m_pIWebShellWin); + // Register the cookie service NS_WITH_SERVICE(nsICookieService, cookieService, kCookieServiceCID, &rv); if (NS_FAILED(rv) || (cookieService == nsnull)) { @@ -711,7 +719,7 @@ HRESULT CMozillaBrowser::CreateWebShell() m_pIWebShell->SetDocLoaderObserver((nsIDocumentLoaderObserver*) m_pWebShellContainer); m_pIWebShell->SetWebShellType(nsWebShellContent); - m_pIWebShell->Show(); + m_pIWebShellWin->SetVisibility(PR_TRUE); return S_OK; } @@ -1848,7 +1856,7 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationName(BSTR __RPC_FAR *Loca // Get the url from the web shell nsXPIDLString szLocationName; - m_pIWebShell->GetTitle(getter_Copies(szLocationName)); + m_pIWebShellWin->GetTitle(getter_Copies(szLocationName)); if (nsnull == (const PRUnichar *) szLocationName) { RETURN_E_UNEXPECTED(); diff --git a/webshell/embed/ActiveX/MozillaBrowser.h b/webshell/embed/ActiveX/MozillaBrowser.h index 53b97d7522c..654d1351e36 100644 --- a/webshell/embed/ActiveX/MozillaBrowser.h +++ b/webshell/embed/ActiveX/MozillaBrowser.h @@ -303,6 +303,7 @@ protected: // Mozilla interfaces nsIWebShell * m_pIWebShell; + nsIBaseWindow * m_pIWebShellWin; nsIPref * m_pIPref; nsIEditor * m_pEditor; nsIServiceManager * m_pIServiceManager; diff --git a/webshell/embed/ActiveX/StdAfx.h b/webshell/embed/ActiveX/StdAfx.h index 7a247b1515b..e69de29bb2d 100644 --- a/webshell/embed/ActiveX/StdAfx.h +++ b/webshell/embed/ActiveX/StdAfx.h @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.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/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#if !defined(AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_) -#define AFX_STDAFX_H__1339B542_3453_11D2_93B9_000000000000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#define STRICT - -#define _WIN32_WINNT 0x0400 -#define _ATL_APARTMENT_THREADED -#define _ATL_STATIC_REGISTRY - -// Comment these out as appropriate -#ifdef MOZ_ACTIVEX_CONTROL_SUPPORT -#define USE_CONTROL -#endif - -#ifdef MOZ_ACTIVEX_PLUGIN_SUPPORT -#define USE_PLUGIN -#endif - -// 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 -#include - -#ifdef USE_PLUGIN -#include -#endif - -// STL headers -#include -#include -#include - -// New winsock2.h doesn't define this anymore -typedef long int32; - -#include "jstypes.h" -#include "prtypes.h" - -// Mozilla headers - -#ifdef USE_CONTROL -#include "xp_core.h" -#include "jscompat.h" - -#include "prthread.h" -#include "prprf.h" -#include "plevent.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsIEventQueueService.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" -#include "nsViewsCID.h" -#include "nsString.h" -#include "nsCOMPtr.h" -#include "nsXPIDLString.h" -#include "nsICookieService.h" - -#include "nsIHTTPChannel.h" - -#include "nsIPref.h" -#include "nsIURL.h" -#include "nsIWebShell.h" -#include "nsIBrowserWindow.h" -#include "nsIContentViewer.h" -#include "nsIPresShell.h" -#include "nsCOMPtr.h" -#include "nsIDOMSelection.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" - -#include "nsEditorCID.h" -#include "nsIEditor.h" -#include "nsIHtmlEditor.h" - -#include "nsIDocument.h" -#include "nsIDocumentObserver.h" -#include "nsIDocumentLoaderObserver.h" -#include "nsIStreamListener.h" -#include "nsUnitConversion.h" -#include "nsVoidArray.h" -#include "nsCRT.h" - -#include "nsIDocumentViewer.h" -#include "nsIDOMNode.h" -#include "nsIDOMNodeList.h" -#include "nsIDOMDocument.h" -#include "nsIDOMDocumentType.h" -#include "nsIDOMElement.h" -#endif - -// 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 "ControlSite.h" -#include "ControlSiteIPFrame.h" - -#ifdef USE_CONTROL -#include "IEHtmlDocument.h" -#include "CPMozillaControl.h" -#include "MozillaBrowser.h" -#include "WebShellContainer.h" -#include "DropTarget.h" -#include "guids.h" -#endif - -#ifdef USE_PLUGIN -#include "npapi.h" -#include "nsIFactory.h" -#include "nsIPlugin.h" -#include "nsIPluginInstance.h" -#include "ActiveXPlugin.h" -#include "ActiveXPluginInstance.h" -#include "ActiveScriptSite.h" -#endif - -//{{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/webshell/embed/ActiveX/guids.cpp b/webshell/embed/ActiveX/guids.cpp index b49fced78fb..e69de29bb2d 100644 --- a/webshell/embed/ActiveX/guids.cpp +++ b/webshell/embed/ActiveX/guids.cpp @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -#include "stdafx.h" -#include "guids.h" - -// Class IDs -NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -NS_DEFINE_IID(kHTMLEditorCID, NS_HTMLEDITOR_CID); -NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID); - -// Interface IDs -NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID); -NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); -NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); -NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID); -NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); -NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID); -NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID); -NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); -NS_DEFINE_IID(kIDocumentLoaderObserverIID, NS_IDOCUMENT_LOADER_OBSERVER_IID); -NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - -#ifdef USE_PLUGIN -NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); -NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID); -NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID); -#endif diff --git a/webshell/embed/ActiveX/guids.h b/webshell/embed/ActiveX/guids.h index 1da347ccf28..e69de29bb2d 100644 --- a/webshell/embed/ActiveX/guids.h +++ b/webshell/embed/ActiveX/guids.h @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -#ifndef GUIDS_H -#define GUIDS_H - -#define NS_EXTERN_IID(_name) \ - extern const nsIID _name; - -// Class IDs -NS_EXTERN_IID(kEventQueueServiceCID); -NS_EXTERN_IID(kHTMLEditorCID); -NS_EXTERN_IID(kCookieServiceCID); - -// Interface IDs -NS_EXTERN_IID(kIBrowserWindowIID); -NS_EXTERN_IID(kIEventQueueServiceIID); -NS_EXTERN_IID(kIDocumentViewerIID); -NS_EXTERN_IID(kIDOMDocumentIID); -NS_EXTERN_IID(kIDOMNodeIID); -NS_EXTERN_IID(kIDOMElementIID); -NS_EXTERN_IID(kIWebShellContainerIID); -NS_EXTERN_IID(kIStreamObserverIID); -NS_EXTERN_IID(kIDocumentLoaderObserverIID); -NS_EXTERN_IID(kISupportsIID); - -#ifdef USE_PLUGIN -NS_EXTERN_IID(kIFactoryIID); -NS_EXTERN_IID(kIPluginIID); -NS_EXTERN_IID(kIPluginInstanceIID); -#endif - -#endif \ No newline at end of file