Skip to content

Commit

Permalink
Moving nsIContentViewer over from webshell to docshell, converting fr…
Browse files Browse the repository at this point in the history
…om .h to .idl. Needed for bug 46200, r=moa=adam@netscape.com, a=alecf
  • Loading branch information
disttsc%bart.nl committed Nov 9, 2000
1 parent b83c5f5 commit 87187c3
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 104 deletions.
1 change: 1 addition & 0 deletions content/xul/document/src/nsXULDocument.cpp
Expand Up @@ -54,6 +54,7 @@
#include "nsIComponentManager.h"
#include "nsICodebasePrincipal.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
#include "nsIScrollableView.h"
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
Expand Down
1 change: 1 addition & 0 deletions docshell/base/MANIFEST_IDL
Expand Up @@ -30,5 +30,6 @@ nsIDocShellTreeOwner.idl
nsIMarkupDocumentViewer.idl
nsIScrollable.idl
nsITextScroll.idl
nsIContentViewer.idl
nsIContentViewerEdit.idl
nsIURIFixup.idl
1 change: 1 addition & 0 deletions docshell/base/Makefile.in
Expand Up @@ -41,6 +41,7 @@ XPIDLSRCS = \
nsIScrollable.idl \
nsITextScroll.idl \
nsIWebNavigation.idl \
nsIContentViewer.idl \
nsIContentViewerEdit.idl \
nsIURIFixup.idl \
$(NULL)
Expand Down
1 change: 1 addition & 0 deletions docshell/base/makefile.win
Expand Up @@ -33,6 +33,7 @@ XPIDLSRCS= \
.\nsIDocShellTreeItem.idl \
.\nsIDocShellTreeNode.idl \
.\nsIDocShellTreeOwner.idl \
.\nsIContentViewer.idl \
.\nsIContentViewerEdit.idl \
# .\nsIContentViewerFile.idl \
.\nsIMarkupDocumentViewer.idl \
Expand Down
6 changes: 4 additions & 2 deletions docshell/base/nsDocShell.cpp
Expand Up @@ -46,6 +46,7 @@
#include "nsIHTTPEventSink.h"
#include "nsISecurityEventSink.h"
#include "nsScriptSecurityManager.h"
#include "nsDocumentCharsetInfoCID.h"

// Local Includes
#include "nsDocShell.h"
Expand Down Expand Up @@ -124,10 +125,10 @@ nsDocShell::nsDocShell() :
mLastViewMode(viewNormal),
mRestoreViewMode(PR_FALSE),
mEODForCurrentDocument (PR_FALSE),
mURIResultedInDocument(PR_FALSE),
mUseExternalProtocolHandler (PR_FALSE),
mParent(nsnull),
mTreeOwner(nsnull),
mURIResultedInDocument(PR_FALSE),
mChromeEventHandler(nsnull)
{
NS_INIT_REFCNT();
Expand Down Expand Up @@ -1110,7 +1111,8 @@ NS_IMETHODIMP nsDocShell::AddChild(nsIDocShellTreeItem *aChild)
if (NS_FAILED(res)) return NS_OK;

// set the child's parentCharset
res = dcInfo->SetParentCharset(&parentCS);
nsCOMPtr<nsIAtom> parentCSAtom(dont_AddRef(NS_NewAtom(parentCS)));
res = dcInfo->SetParentCharset(parentCSAtom);
if (NS_FAILED(res)) return NS_OK;

// printf("### 1 >>> Adding child. Parent CS = %s. ItemType = %d.\n", parentCS.ToNewCString(), mItemType);
Expand Down
42 changes: 42 additions & 0 deletions docshell/base/nsIContentViewer.idl
@@ -0,0 +1,42 @@
#include "nsISupports.idl"
#include "domstubs.idl"

%{ C++
#include "nsIWidget.h"

class nsIDeviceContext;
struct nsRect;
%}

[ptr] native nsIWidgetPtr(nsIWidget);
[ptr] native nsIDeviceContextPtr(nsIDeviceContext);
[ref] native nsRectRef(nsRect);

[scriptable, uuid(a6cf9056-15b3-11d2-932e-00805f8add32)]
interface nsIContentViewer : nsISupports
{

[noscript] void init(in nsIWidgetPtr aParentWidget,
in nsIDeviceContextPtr aDeviceContext,
[const] in nsRectRef aBounds);

void bindToDocument(in nsISupports aDoc, in string aCommand);

attribute nsISupports container;

void loadComplete(in unsigned long aStatus);
void destroy();
void stop();

attribute nsIDOMDocument DOMDocument;

[noscript] void getBounds(in nsRectRef aBounds);
[noscript] void setBounds([const] in nsRectRef aBounds);

void move(in long aX, in long aY);

void show();
void hide();

attribute boolean enableRendering;
};
5 changes: 2 additions & 3 deletions docshell/base/nsIDocShell.idl
Expand Up @@ -25,10 +25,10 @@
#include "domstubs.idl"
#include "nsIURIContentListener.idl"
#include "nsIURI.idl"
#include "nsIContentViewer.idl"

%{ C++
#include "nsIPresContext.h"
#include "nsIContentViewer.h"
#include "nsIDocumentLoaderObserver.h"
%}

Expand All @@ -38,7 +38,6 @@

[ptr] native nsIPresContext(nsIPresContext);
[ptr] native nsIPresShell(nsIPresShell);
[ptr] native nsIContentViewer(nsIContentViewer);

interface nsIChromeEventHandler;
interface nsIDocumentLoaderObserver;
Expand Down Expand Up @@ -118,7 +117,7 @@ interface nsIDocShell : nsISupports
Content Viewer that is currently loaded for this DocShell. This may change
as the underlying content changes.
*/
[noscript] readonly attribute nsIContentViewer contentViewer;
readonly attribute nsIContentViewer contentViewer;

/*
This attribute allows chrome to tie in to handle DOM events that may be of
Expand Down
5 changes: 1 addition & 4 deletions modules/plugin/base/src/nsPluginViewer.cpp
Expand Up @@ -49,14 +49,11 @@ static NS_DEFINE_IID(kChildWindowCID, NS_CHILD_CID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);

// Interface IDs
static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENT_VIEWER_IID);
static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENTVIEWER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
static NS_DEFINE_IID(kIPluginInstanceOwnerIID, NS_IPLUGININSTANCEOWNER_IID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);


Expand Down
5 changes: 1 addition & 4 deletions modules/plugin/nglsrc/nsPluginViewer.cpp
Expand Up @@ -49,14 +49,11 @@ static NS_DEFINE_IID(kChildWindowCID, NS_CHILD_CID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);

// Interface IDs
static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENT_VIEWER_IID);
static NS_DEFINE_IID(kIContentViewerIID, NS_ICONTENTVIEWER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
static NS_DEFINE_IID(kIPluginInstanceOwnerIID, NS_IPLUGININSTANCEOWNER_IID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);


Expand Down
1 change: 1 addition & 0 deletions rdf/content/src/nsXULDocument.cpp
Expand Up @@ -54,6 +54,7 @@
#include "nsIComponentManager.h"
#include "nsICodebasePrincipal.h"
#include "nsIContentSink.h" // for NS_CONTENT_ID_COUNTER_BASE
#include "nsIScrollableView.h"
#include "nsIContentViewer.h"
#include "nsICSSStyleSheet.h"
#include "nsIDOMEvent.h"
Expand Down
1 change: 0 additions & 1 deletion webshell/public/MANIFEST
Expand Up @@ -2,7 +2,6 @@
# This is a list of local files which get copied to the mozilla:dist:webshell directory
#

nsIContentViewer.h
nsIDocStreamLoaderFactory.h
nsILinkHandler.h
nsIWebShell.h
Expand Down
1 change: 0 additions & 1 deletion webshell/public/Makefile.in
Expand Up @@ -37,7 +37,6 @@ XPIDLSRCS = \
$(NULL)

EXPORTS = \
nsIContentViewer.h \
nsIDocStreamLoaderFactory.h \
nsILinkHandler.h \
nsIWebShell.h \
Expand Down
1 change: 0 additions & 1 deletion webshell/public/makefile.win
Expand Up @@ -34,7 +34,6 @@ XPIDLSRCS = \
$(NULL)

EXPORTS = \
nsIContentViewer.h \
nsIDocStreamLoaderFactory.h \
nsILinkHandler.h \
nsIWebShell.h \
Expand Down
86 changes: 0 additions & 86 deletions webshell/public/nsIContentViewer.h

This file was deleted.

16 changes: 14 additions & 2 deletions xpfe/global/resources/content/xulBindings.xml
Expand Up @@ -679,9 +679,21 @@

<binding id="browser">
<implementation>
<property name="webBrowser"
<property name="docShell"
readonly="true"
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;"/>
<property name="webNavigation"
readonly="true"
onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"/>
<property name="markupDocumentViewer"
readonly="true"
onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);"/>
<property name="contentViewerEdit"
readonly="true"
onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerEdit);"/>
<property name="contentViewerFile"
readonly="true"
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).webBrowser"/>
onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerFile);"/>
</implementation>
</binding>

Expand Down

0 comments on commit 87187c3

Please sign in to comment.