зеркало из https://github.com/mozilla/pjs.git
Back out bug 412320 and various followups because the perf impact was minimal and the code is more complicated
This commit is contained in:
Родитель
a70f5c43e3
Коммит
ff3d560f4d
|
@ -117,11 +117,6 @@ ifdef EXTRA_DSO_LIBS
|
|||
EXTRA_DSO_LIBS := $(call EXPAND_MOZLIBNAME,$(EXTRA_DSO_LIBS))
|
||||
endif
|
||||
|
||||
ifdef GQI_SRCS
|
||||
CPPSRCS += $(GQI_SRCS:.gqi=QI.cpp)
|
||||
GARBAGE += $(GQI_SRCS:.gqi=QI.cpp)
|
||||
endif
|
||||
|
||||
#
|
||||
# Library rules
|
||||
#
|
||||
|
@ -1229,9 +1224,6 @@ endif # COMPILER_DEPEND
|
|||
|
||||
endif # MOZ_AUTO_DEPS
|
||||
|
||||
%QI.cpp: %.gqi $(topsrcdir)/xpcom/base/gqi.py
|
||||
$(PYTHON) $(topsrcdir)/xpcom/base/gqi.py $(GQIFLAGS) $(INCLUDES) -I $(IDL_DIR) -o $@ -D $(MDDEPDIR)/$(@F).pp $<
|
||||
|
||||
# Rules for building native targets must come first because of the host_ prefix
|
||||
host_%.$(OBJ_SUFFIX): %.c Makefile Makefile.in
|
||||
$(REPORT_BUILD)
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
%import-idl "nsIDOM3Node.idl"
|
||||
%import-idl "nsIDOMNSElement.idl"
|
||||
%import-idl "nsIDOMEventTarget.idl"
|
||||
%import-idl "nsIDOM3EventTarget.idl"
|
||||
%import-idl "nsIDOMNSEventTarget.idl"
|
||||
%import-idl "nsIWeakReference.idl"
|
||||
%import-idl "nsIDOMDocument.idl"
|
||||
%import-idl "nsIDOM3Document.idl"
|
||||
%import-idl "nsIDOMNSDocument.idl"
|
||||
%import-idl "nsIDOMDocumentEvent.idl"
|
||||
%import-idl "nsIDOM3DocumentEvent.idl"
|
||||
%import-idl "nsIDOMDocumentStyle.idl"
|
||||
%import-idl "nsIDOMNSDocumentStyle.idl"
|
||||
%import-idl "nsIDOMDocumentView.idl"
|
||||
%import-idl "nsIDOMDocumentRange.idl"
|
||||
%import-idl "nsIDOMDocumentTraversal.idl"
|
||||
%import-idl "nsIDOMDocumentXBL.idl"
|
||||
%import-idl "nsIDOMXPathEvaluator.idl"
|
||||
|
||||
%pseudo-iid nsIContent fba9aa39-016e-4d5d-ab62-22a1b84a3c7b
|
||||
%pseudo-iid nsINode 6f69dd90-318d-40ac-b8b8-99b8a7bb9a58
|
||||
%pseudo-iid nsPIDOMEventTarget 44a6597b-9fc3-4a8d-b7a4-d9009abf9d15
|
||||
%pseudo-iid nsIDocument 626d86d2-615f-4a12-94d8-e3db3a298372
|
||||
%pseudo-iid nsIScriptObjectPrincipal 3eedba38-8d22-41e1-817a-0e43e165b664
|
||||
%pseudo-iid nsIMutationObserver 32e68316-67d4-44a5-8d35-0d390fa9df11
|
||||
%pseudo-iid nsIXPathEvaluatorInternal b4b72daa-65d6-440f-b608-e2ee9a82f313
|
||||
%pseudo-iid nsIRadioGroupContainer 06de7839-d0db-47d3-8290-3cb8622ed966
|
||||
|
||||
%{C++
|
||||
#include "nsGenericElement.h"
|
||||
#include "nsDocument.h"
|
||||
#include "nsIXPathEvaluatorInternal.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
%}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGenericElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3Node, new nsNode3Tearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSElement, new nsNSElementTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMEventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3EventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSEventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
// nsNodeSH::PreCreate() depends on the identity pointer being the
|
||||
// same as nsINode (which nsIContent inherits), so if you change the
|
||||
// below line, make sure nsNodeSH::PreCreate() still does the right
|
||||
// thing!
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3DocumentEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentStyle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSDocumentStyle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentView)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentRange)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentTraversal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentXBL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3Node)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3Document)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIRadioGroupContainer)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
|
||||
// nsNodeSH::PreCreate() depends on the identity pointer being the
|
||||
// same as nsINode (which nsIDocument inherits), so if you change
|
||||
// the below line, make sure nsNodeSH::PreCreate() still does the
|
||||
// right thing!
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocument)
|
||||
|
||||
NS_INTERFACE_MAP_ENTRY_LITERAL(nsIDOMXPathEvaluator, nsIXPathEvaluatorInternal)
|
||||
if (!mXPathEvaluatorTearoff) {
|
||||
nsresult rv;
|
||||
mXPathEvaluatorTearoff =
|
||||
do_CreateInstance(NS_XPATH_EVALUATOR_CONTRACTID,
|
||||
static_cast<nsIDocument *>(this), &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return mXPathEvaluatorTearoff->QueryInterface(aIID, aResult);
|
||||
END
|
||||
NS_INTERFACE_MAP_END
|
|
@ -896,6 +896,54 @@ nsDocument::~nsDocument()
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsDocument)
|
||||
NS_INTERFACE_TABLE_BEGIN
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsINode)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentEvent)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3DocumentEvent)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentStyle)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocumentStyle)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentView)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentRange)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTraversal)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3EventTarget)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSEventTarget)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsPIDOMEventTarget)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3Node)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3Document)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
|
||||
// nsNodeSH::PreCreate() depends on the identity pointer being the
|
||||
// same as nsINode (which nsIDocument inherits), so if you change
|
||||
// the below line, make sure nsNodeSH::PreCreate() still does the
|
||||
// right thing!
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(nsDocument, nsISupports, nsIDocument)
|
||||
NS_INTERFACE_TABLE_END
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
|
||||
if (aIID.Equals(NS_GET_IID(nsIDOMXPathEvaluator)) ||
|
||||
aIID.Equals(NS_GET_IID(nsIXPathEvaluatorInternal))) {
|
||||
if (!mXPathEvaluatorTearoff) {
|
||||
nsresult rv;
|
||||
mXPathEvaluatorTearoff =
|
||||
do_CreateInstance(NS_XPATH_EVALUATOR_CONTRACTID,
|
||||
static_cast<nsIDocument *>(this), &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return mXPathEvaluatorTearoff->QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
else
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsDocument, nsIDocument)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE_AMBIGUOUS_WITH_DESTROY(nsDocument,
|
||||
nsIDocument,
|
||||
|
|
|
@ -798,7 +798,7 @@ protected:
|
|||
// Our update nesting level
|
||||
PRUint32 mUpdateNestLevel;
|
||||
|
||||
protected:
|
||||
private:
|
||||
friend class nsUnblockOnloadEvent;
|
||||
|
||||
void PostUnblockOnloadEvent();
|
||||
|
|
|
@ -3554,6 +3554,28 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
|
|||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGenericElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3Node, new nsNode3Tearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSElement, new nsNSElementTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMEventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3EventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSEventTarget,
|
||||
nsDOMEventRTTearoff::Create(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
// nsNodeSH::PreCreate() depends on the identity pointer being the
|
||||
// same as nsINode (which nsIContent inherits), so if you change the
|
||||
// below line, make sure nsNodeSH::PreCreate() still does the right
|
||||
// thing!
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsGenericElement, nsIContent)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE_AMBIGUOUS_WITH_DESTROY(nsGenericElement,
|
||||
nsIContent,
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#define nsIFramesetElement_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsCoord.h"
|
||||
|
||||
// IID for the nsIFramesetElement interface
|
||||
#define NS_IFRAMESETELEMENT_IID \
|
||||
|
|
|
@ -133,8 +133,6 @@ CPPSRCS = \
|
|||
nsTextRectangle.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = htmlcontent.gqi
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
%import "htmlgenericelement.gqi"
|
||||
|
||||
%import-idl "nsIDOMHTMLAnchorElement.idl"
|
||||
%import-idl "nsIDOMNSHTMLAnchorElement2.idl"
|
||||
%import-idl "nsIDOMHTMLDivElement.idl"
|
||||
%import-idl "nsIDOMHTMLFrameElement.idl"
|
||||
%import-idl "nsIDOMHTMLFrameSetElement.idl"
|
||||
%import-idl "nsIDOMHTMLIFrameElement.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsHTMLAnchorElement.h"
|
||||
#include "nsHTMLDivElement.h"
|
||||
#include "nsHTMLSpanElement.h"
|
||||
#include "nsHTMLFrameElement.h"
|
||||
#include "nsHTMLFrameSetElement.h"
|
||||
#include "nsHTMLIFrameElement.h"
|
||||
%}
|
||||
|
||||
%pseudo-iid nsILink 0c212bc4-fcd7-479d-8c3f-3be8e6787450
|
||||
%pseudo-iid nsIFrameSetElement eefe0fe5-44ac-4d7f-a751-f4aa5f22b0bf
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLAnchorElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLAnchorElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLAnchorElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLAnchorElement2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsILink)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLAnchorElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLDivElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLDivElement)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLDivElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLSpanElement, nsGenericHTMLElement)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLSpanElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLFrameElement, nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFrameElement)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLFrameElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLFrameSetElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFrameSetElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIFrameSetElement)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLFrameSetElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLIFrameElement, nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLIFrameElement)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLIFrameElement)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
// Note: nsGenericHTMLElement does not implement QI directly... this declaration is here only
|
||||
// so that subclasses have the correct list
|
||||
|
||||
%import "contentbase.gqi"
|
||||
|
||||
%import-idl "nsIDOMNSHTMLElement.idl"
|
||||
%import-idl "nsIDOMElementCSSInlineStyle.idl"
|
||||
%import-idl "nsIDOMHTMLElement.idl"
|
||||
%import-idl "nsIDOMNSHTMLFrameElement.idl"
|
||||
%import-idl "nsIFrameLoader.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsGenericHTMLElement.h"
|
||||
%}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsGenericHTMLElement, nsGenericElement)
|
||||
// nsGenericHTMLElement doesn't implement nsIDOMHTMLElement, but all
|
||||
// subclasses do, and we only use this declaration for subclasses
|
||||
NS_FUTURE_INTERFACE_MAP_ENTRY(nsIDOMHTMLElement)
|
||||
NS_FUTURE_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_FUTURE_INTERFACE_MAP_ENTRY(nsIDOMElement)
|
||||
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSHTMLElement,
|
||||
new nsGenericHTMLElementTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMElementCSSInlineStyle,
|
||||
new nsGenericHTMLElementTearoff(this))
|
||||
NS_INTERFACE_MAP_UNFOUND
|
||||
return PostQueryInterface(aIID, aResult);
|
||||
END
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsGenericHTMLFrameElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLFrameElement)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIFrameLoaderOwner)
|
||||
NS_INTERFACE_MAP_END
|
|
@ -179,6 +179,30 @@ nsGenericHTMLElement::Init(nsINodeInfo *aNodeInfo)
|
|||
#endif
|
||||
|
||||
|
||||
class nsGenericHTMLElementTearoff : public nsIDOMNSHTMLElement,
|
||||
public nsIDOMElementCSSInlineStyle
|
||||
{
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
nsGenericHTMLElementTearoff(nsGenericHTMLElement *aElement)
|
||||
: mElement(aElement)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~nsGenericHTMLElementTearoff()
|
||||
{
|
||||
}
|
||||
|
||||
NS_FORWARD_NSIDOMNSHTMLELEMENT(mElement->)
|
||||
NS_FORWARD_NSIDOMELEMENTCSSINLINESTYLE(mElement->)
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsGenericHTMLElementTearoff,
|
||||
nsIDOMNSHTMLElement)
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsGenericHTMLElement> mElement;
|
||||
};
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_1(nsGenericHTMLElementTearoff, mElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsGenericHTMLElementTearoff,
|
||||
|
@ -2855,6 +2879,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsGenericHTMLFrameElement,
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFrameLoader)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_TABLE_INHERITED2(nsGenericHTMLFrameElement,
|
||||
nsIDOMNSHTMLFrameElement,
|
||||
nsIFrameLoaderOwner)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLFrameElement::GetContentDocument(nsIDOMDocument** aContentDocument)
|
||||
{
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
#include "nsIDOMNSHTMLFrameElement.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIDOMElementCSSInlineStyle.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
@ -900,6 +898,9 @@ public:
|
|||
}
|
||||
virtual ~nsGenericHTMLFrameElement();
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
|
||||
// nsIDOMNSHTMLFrameElement
|
||||
NS_DECL_NSIDOMNSHTMLFRAMEELEMENT
|
||||
|
||||
|
@ -940,30 +941,6 @@ protected:
|
|||
nsCOMPtr<nsIFrameLoader> mFrameLoader;
|
||||
};
|
||||
|
||||
class nsGenericHTMLElementTearoff : public nsIDOMNSHTMLElement,
|
||||
public nsIDOMElementCSSInlineStyle
|
||||
{
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
nsGenericHTMLElementTearoff(nsGenericHTMLElement *aElement)
|
||||
: mElement(aElement)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~nsGenericHTMLElementTearoff()
|
||||
{
|
||||
}
|
||||
|
||||
NS_FORWARD_NSIDOMNSHTMLELEMENT(mElement->)
|
||||
NS_FORWARD_NSIDOMELEMENTCSSINLINESTYLE(mElement->)
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsGenericHTMLElementTearoff,
|
||||
nsIDOMNSHTMLElement)
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsGenericHTMLElement> mElement;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLAnchorElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
@ -65,10 +63,78 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsHTMLAnchorElement.h"
|
||||
|
||||
nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
|
||||
|
||||
class nsHTMLAnchorElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLAnchorElement,
|
||||
public nsIDOMNSHTMLAnchorElement2,
|
||||
public nsILink
|
||||
{
|
||||
public:
|
||||
nsHTMLAnchorElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLAnchorElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLAnchorElement
|
||||
NS_DECL_NSIDOMHTMLANCHORELEMENT
|
||||
|
||||
// nsIDOMNSHTMLAnchorElement
|
||||
NS_DECL_NSIDOMNSHTMLANCHORELEMENT
|
||||
|
||||
// nsIDOMNSHTMLAnchorElement2
|
||||
NS_DECL_NSIDOMNSHTMLANCHORELEMENT2
|
||||
|
||||
// nsILink
|
||||
NS_IMETHOD GetLinkState(nsLinkState &aState);
|
||||
NS_IMETHOD SetLinkState(nsLinkState aState);
|
||||
NS_IMETHOD GetHrefURI(nsIURI** aURI);
|
||||
NS_IMETHOD LinkAdded() { return NS_OK; }
|
||||
NS_IMETHOD LinkRemoved() { return NS_OK; }
|
||||
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
PRBool aCompileEventHandlers);
|
||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||
PRBool aNullParent = PR_TRUE);
|
||||
virtual void SetFocus(nsPresContext* aPresContext);
|
||||
virtual PRBool IsFocusable(PRBool *aTabIndex = nsnull);
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
|
||||
virtual PRBool IsLink(nsIURI** aURI) const;
|
||||
virtual void GetLinkTarget(nsAString& aTarget);
|
||||
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
|
||||
}
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify);
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
protected:
|
||||
// The cached visited state
|
||||
nsLinkState mLinkState;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Anchor)
|
||||
|
||||
|
||||
|
@ -87,8 +153,19 @@ NS_IMPL_ADDREF_INHERITED(nsHTMLAnchorElement, nsGenericElement)
|
|||
NS_IMPL_RELEASE_INHERITED(nsHTMLAnchorElement, nsGenericElement)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLAnchorElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLAnchorElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED4(nsHTMLAnchorElement,
|
||||
nsIDOMHTMLAnchorElement,
|
||||
nsIDOMNSHTMLAnchorElement,
|
||||
nsIDOMNSHTMLAnchorElement2,
|
||||
nsILink)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAnchorElement)
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLAnchorElement)
|
||||
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Charset, charset)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Coords, coords)
|
||||
NS_IMPL_URI_ATTR(nsHTMLAnchorElement, Href, href)
|
||||
|
|
|
@ -1,116 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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 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):
|
||||
* Daniel Glazman <glazman@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 nsHTMLAnchorElement_h__
|
||||
#define nsHTMLAnchorElement_h__
|
||||
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMNSHTMLAnchorElement2.h"
|
||||
#include "nsILink.h"
|
||||
|
||||
class nsHTMLAnchorElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLAnchorElement,
|
||||
public nsIDOMNSHTMLAnchorElement2,
|
||||
public nsILink
|
||||
{
|
||||
public:
|
||||
nsHTMLAnchorElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLAnchorElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLAnchorElement
|
||||
NS_DECL_NSIDOMHTMLANCHORELEMENT
|
||||
|
||||
// nsIDOMNSHTMLAnchorElement
|
||||
NS_DECL_NSIDOMNSHTMLANCHORELEMENT
|
||||
|
||||
// nsIDOMNSHTMLAnchorElement2
|
||||
NS_DECL_NSIDOMNSHTMLANCHORELEMENT2
|
||||
|
||||
// nsILink
|
||||
NS_IMETHOD GetLinkState(nsLinkState &aState);
|
||||
NS_IMETHOD SetLinkState(nsLinkState aState);
|
||||
NS_IMETHOD GetHrefURI(nsIURI** aURI);
|
||||
NS_IMETHOD LinkAdded() { return NS_OK; }
|
||||
NS_IMETHOD LinkRemoved() { return NS_OK; }
|
||||
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
PRBool aCompileEventHandlers);
|
||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||
PRBool aNullParent = PR_TRUE);
|
||||
virtual void SetFocus(nsPresContext* aPresContext);
|
||||
virtual PRBool IsFocusable(PRBool *aTabIndex = nsnull);
|
||||
|
||||
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
|
||||
virtual PRBool IsLink(nsIURI** aURI) const;
|
||||
virtual void GetLinkTarget(nsAString& aTarget);
|
||||
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
|
||||
}
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify);
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
protected:
|
||||
// The cached visited state
|
||||
nsLinkState mLinkState;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,14 +34,46 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLDivElement.h"
|
||||
#include "nsIDOMHTMLDivElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
|
||||
class nsHTMLDivElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLDivElement
|
||||
{
|
||||
public:
|
||||
nsHTMLDivElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLDivElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLDivElement
|
||||
NS_DECL_NSIDOMHTMLDIVELEMENT
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Div)
|
||||
|
||||
|
||||
|
@ -58,6 +90,13 @@ nsHTMLDivElement::~nsHTMLDivElement()
|
|||
NS_IMPL_ADDREF_INHERITED(nsHTMLDivElement, nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLDivElement, nsGenericElement)
|
||||
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLDivElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLDivElement, nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsHTMLDivElement, nsIDOMHTMLDivElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLDivElement)
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLDivElement)
|
||||
|
||||
|
||||
|
|
|
@ -1,75 +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 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 of 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 nsHTMLDivElement_h__
|
||||
#define nsHTMLDivElement_h__
|
||||
|
||||
#include "nsIDOMHTMLDivElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLDivElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLDivElement
|
||||
{
|
||||
public:
|
||||
nsHTMLDivElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLDivElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLDivElement
|
||||
NS_DECL_NSIDOMHTMLDIVELEMENT
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,14 +34,48 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLFrameElement.h"
|
||||
#include "nsIDOMHTMLFrameElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsDOMError.h"
|
||||
|
||||
|
||||
class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLFrameElement
|
||||
{
|
||||
public:
|
||||
nsHTMLFrameElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLFrameElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLFrameElement
|
||||
NS_DECL_NSIDOMHTMLFRAMEELEMENT
|
||||
|
||||
// nsIContent
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Frame)
|
||||
|
||||
|
||||
|
@ -58,6 +92,14 @@ nsHTMLFrameElement::~nsHTMLFrameElement()
|
|||
NS_IMPL_ADDREF_INHERITED(nsHTMLFrameElement, nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLFrameElement, nsGenericElement)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLFrameElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLFrameElement,
|
||||
nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsHTMLFrameElement, nsIDOMHTMLFrameElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLFrameElement)
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLFrameElement)
|
||||
|
||||
|
||||
|
|
|
@ -1,76 +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 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 of 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 nsHTMLFrameElement_h__
|
||||
#define nsHTMLFrameElement_h__
|
||||
|
||||
#include "nsIDOMHTMLFrameElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLFrameElement
|
||||
{
|
||||
public:
|
||||
nsHTMLFrameElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLFrameElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLFrameElement
|
||||
NS_DECL_NSIDOMHTMLFRAMEELEMENT
|
||||
|
||||
// nsIContent
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,15 +34,91 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLFrameSetElement.h"
|
||||
#include "nsIDOMHTMLFrameSetElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFrameSetElement.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
class nsHTMLFrameSetElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLFrameSetElement,
|
||||
public nsIFrameSetElement
|
||||
{
|
||||
public:
|
||||
nsHTMLFrameSetElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLFrameSetElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLFrameSetElement
|
||||
NS_DECL_NSIDOMHTMLFRAMESETELEMENT
|
||||
|
||||
// These override the SetAttr methods in nsGenericHTMLElement (need
|
||||
// both here to silence compiler warnings).
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
|
||||
}
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify);
|
||||
|
||||
// nsIFramesetElement
|
||||
NS_IMETHOD GetRowSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||
NS_IMETHOD GetColSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
private:
|
||||
nsresult ParseRowCol(const nsAString& aValue,
|
||||
PRInt32& aNumSpecs,
|
||||
nsFramesetSpec** aSpecs);
|
||||
|
||||
/**
|
||||
* The number of size specs in our "rows" attr
|
||||
*/
|
||||
PRInt32 mNumRows;
|
||||
/**
|
||||
* The number of size specs in our "cols" attr
|
||||
*/
|
||||
PRInt32 mNumCols;
|
||||
/**
|
||||
* The style hint to return for the rows/cols attrs in
|
||||
* GetAttributeChangeHint
|
||||
*/
|
||||
nsChangeHint mCurrentRowColHint;
|
||||
/**
|
||||
* The parsed representation of the "rows" attribute
|
||||
*/
|
||||
nsAutoArrayPtr<nsFramesetSpec> mRowSpecs; // parsed, non-computed dimensions
|
||||
/**
|
||||
* The parsed representation of the "cols" attribute
|
||||
*/
|
||||
nsAutoArrayPtr<nsFramesetSpec> mColSpecs; // parsed, non-computed dimensions
|
||||
};
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(FrameSet)
|
||||
|
||||
|
||||
|
@ -61,6 +137,15 @@ NS_IMPL_ADDREF_INHERITED(nsHTMLFrameSetElement, nsGenericElement)
|
|||
NS_IMPL_RELEASE_INHERITED(nsHTMLFrameSetElement, nsGenericElement)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLFrameSetElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLFrameSetElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_INTERFACE_TABLE_INHERITED2(nsHTMLFrameSetElement,
|
||||
nsIDOMHTMLFrameSetElement,
|
||||
nsIFrameSetElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLFrameSetElement)
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLFrameSetElement)
|
||||
|
||||
|
||||
|
|
|
@ -1,120 +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 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 of 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 nsHTMLFrameSetElement_h__
|
||||
#define nsHTMLFrameSetElement_h__
|
||||
|
||||
#include "nsIDOMHTMLFrameSetElement.h"
|
||||
#include "nsIFrameSetElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLFrameSetElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLFrameSetElement,
|
||||
public nsIFrameSetElement
|
||||
{
|
||||
public:
|
||||
nsHTMLFrameSetElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLFrameSetElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLFrameSetElement
|
||||
NS_DECL_NSIDOMHTMLFRAMESETELEMENT
|
||||
|
||||
// These override the SetAttr methods in nsGenericHTMLElement (need
|
||||
// both here to silence compiler warnings).
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
|
||||
}
|
||||
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
PRBool aNotify);
|
||||
|
||||
// nsIFramesetElement
|
||||
NS_IMETHOD GetRowSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||
NS_IMETHOD GetColSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
|
||||
private:
|
||||
nsresult ParseRowCol(const nsAString& aValue,
|
||||
PRInt32& aNumSpecs,
|
||||
nsFramesetSpec** aSpecs);
|
||||
|
||||
/**
|
||||
* The number of size specs in our "rows" attr
|
||||
*/
|
||||
PRInt32 mNumRows;
|
||||
/**
|
||||
* The number of size specs in our "cols" attr
|
||||
*/
|
||||
PRInt32 mNumCols;
|
||||
/**
|
||||
* The style hint to return for the rows/cols attrs in
|
||||
* GetAttributeChangeHint
|
||||
*/
|
||||
nsChangeHint mCurrentRowColHint;
|
||||
/**
|
||||
* The parsed representation of the "rows" attribute
|
||||
*/
|
||||
nsAutoArrayPtr<nsFramesetSpec> mRowSpecs; // parsed, non-computed dimensions
|
||||
/**
|
||||
* The parsed representation of the "cols" attribute
|
||||
*/
|
||||
nsAutoArrayPtr<nsFramesetSpec> mColSpecs; // parsed, non-computed dimensions
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,8 +34,8 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLIFrameElement.h"
|
||||
#include "nsIDOMHTMLIFrameElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
@ -45,9 +45,43 @@
|
|||
#include "nsRuleData.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
class nsHTMLIFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLIFrameElement
|
||||
{
|
||||
public:
|
||||
nsHTMLIFrameElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLIFrameElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLIFrameElement
|
||||
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
|
||||
|
||||
// nsIContent
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(IFrame)
|
||||
|
||||
|
||||
nsHTMLIFrameElement::nsHTMLIFrameElement(nsINodeInfo *aNodeInfo)
|
||||
: nsGenericHTMLFrameElement(aNodeInfo)
|
||||
{
|
||||
|
@ -61,6 +95,13 @@ nsHTMLIFrameElement::~nsHTMLIFrameElement()
|
|||
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameElement,nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameElement,nsGenericElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLIFrameElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLIFrameElement,
|
||||
nsGenericHTMLFrameElement)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsHTMLIFrameElement, nsIDOMHTMLIFrameElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLIFrameElement)
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLIFrameElement)
|
||||
|
||||
|
||||
|
|
|
@ -1,78 +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 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 of 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 nsHTMLIFrameElement_h__
|
||||
#define nsHTMLIFrameElement_h__
|
||||
|
||||
#include "nsIFrameSetElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLIFrameElement.h"
|
||||
|
||||
class nsHTMLIFrameElement : public nsGenericHTMLFrameElement,
|
||||
public nsIDOMHTMLIFrameElement
|
||||
{
|
||||
public:
|
||||
nsHTMLIFrameElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLIFrameElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)
|
||||
|
||||
// nsIDOMHTMLIFrameElement
|
||||
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
|
||||
|
||||
// nsIContent
|
||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,17 +34,44 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLSpanElement.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsRuleData.h"
|
||||
|
||||
class nsHTMLSpanElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
nsHTMLSpanElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLSpanElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
|
||||
virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Span)
|
||||
|
||||
|
||||
nsHTMLSpanElement::nsHTMLSpanElement(nsINodeInfo *aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
|
@ -58,6 +85,12 @@ nsHTMLSpanElement::~nsHTMLSpanElement()
|
|||
NS_IMPL_ADDREF_INHERITED(nsHTMLSpanElement, nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLSpanElement, nsGenericElement)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLSpanElement
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLSpanElement, nsGenericHTMLElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLSpanElement)
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLSpanElement)
|
||||
|
||||
|
||||
|
|
|
@ -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 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 of 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 nsHTMLSpanElement_h__
|
||||
#define nsHTMLSpanElement_h__
|
||||
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLSpanElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLElement
|
||||
{
|
||||
public:
|
||||
nsHTMLSpanElement(nsINodeInfo *aNodeInfo);
|
||||
virtual ~nsHTMLSpanElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
|
||||
virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -88,8 +88,6 @@ CPPSRCS = \
|
|||
nsWyciwygProtocolHandler.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = htmldocument.gqi
|
||||
|
||||
EXPORTS = \
|
||||
nsIHTMLDocument.h \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
%import "contentbase.gqi"
|
||||
|
||||
%import-idl "nsIDOMHTMLDocument.idl"
|
||||
%import-idl "nsIDOMNSHTMLDocument.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsHTMLDocument.h"
|
||||
%}
|
||||
|
||||
%pseudo-iid nsIHTMLDocument bfd644d6-92cc-4560-a329-f02ba0c91ca5
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHTMLDocument, nsDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIHTMLDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLDocument)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLDocument)
|
||||
NS_INTERFACE_MAP_END
|
|
@ -417,6 +417,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|||
NS_IMPL_ADDREF_INHERITED(nsHTMLDocument, nsDocument)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLDocument, nsDocument)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsHTMLDocument
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLDocument)
|
||||
NS_INTERFACE_TABLE_INHERITED3(nsHTMLDocument,
|
||||
nsIHTMLDocument,
|
||||
nsIDOMHTMLDocument,
|
||||
nsIDOMNSHTMLDocument)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDocument)
|
||||
|
||||
|
||||
nsresult
|
||||
nsHTMLDocument::Init()
|
||||
{
|
||||
|
|
|
@ -78,8 +78,6 @@ CPPSRCS = \
|
|||
nsXMLPrettyPrinter.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = xmldocument.gqi
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
|
|
|
@ -193,6 +193,17 @@ nsXMLDocument::~nsXMLDocument()
|
|||
mLoopingForSyncLoad = PR_FALSE;
|
||||
}
|
||||
|
||||
// QueryInterface implementation for nsXMLDocument
|
||||
NS_INTERFACE_TABLE_HEAD(nsXMLDocument)
|
||||
NS_INTERFACE_TABLE_INHERITED3(nsXMLDocument,
|
||||
nsIInterfaceRequestor,
|
||||
nsIChannelEventSink,
|
||||
nsIDOMXMLDocument)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(XMLDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDocument)
|
||||
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsXMLDocument, nsDocument)
|
||||
NS_IMPL_RELEASE_INHERITED(nsXMLDocument, nsDocument)
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
%import "contentbase.gqi"
|
||||
|
||||
%import-idl "nsIDOMXMLDocument.idl"
|
||||
%import-idl "nsIInterfaceRequestor.idl"
|
||||
%import-idl "nsIChannelEventSink.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsXMLDocument.h"
|
||||
%}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsXMLDocument, nsDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMXMLDocument)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XMLDocument)
|
||||
NS_INTERFACE_MAP_END
|
|
@ -75,8 +75,6 @@ REQUIRES = xpcom \
|
|||
|
||||
CPPSRCS = nsXULControllers.cpp
|
||||
|
||||
GQI_SRCS = xuldocument.gqi
|
||||
|
||||
ifdef MOZ_XUL
|
||||
CPPSRCS += \
|
||||
nsElementMap.cpp \
|
||||
|
|
|
@ -357,6 +357,19 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|||
NS_IMPL_ADDREF_INHERITED(nsXULDocument, nsXMLDocument)
|
||||
NS_IMPL_RELEASE_INHERITED(nsXULDocument, nsXMLDocument)
|
||||
|
||||
|
||||
// QueryInterface implementation for nsXULDocument
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULDocument)
|
||||
NS_INTERFACE_TABLE_INHERITED4(nsXULDocument,
|
||||
nsIXULDocument,
|
||||
nsIDOMXULDocument,
|
||||
nsIStreamLoaderObserver,
|
||||
nsICSSLoaderObserver)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(XULDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
// nsIDocument interface
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
%import "xmldocument.gqi"
|
||||
|
||||
%import-idl "nsIDOMXULDocument.idl"
|
||||
%import-idl "nsIStreamLoader.idl"
|
||||
|
||||
%pseudo-iid nsICSSLoaderObserver f5e8eb0f-4c44-49d5-b1e9-ab392393c0f8
|
||||
%pseudo-iid nsIXULDocument 57314526-f749-4cf0-b6b6-3723eba21480
|
||||
|
||||
%{C++
|
||||
#include "nsXULDocument.h"
|
||||
%}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsXULDocument, nsXMLDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIXULDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMXULDocument)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIStreamLoaderObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XULDocument)
|
||||
NS_INTERFACE_MAP_END
|
|
@ -116,8 +116,6 @@ CPPSRCS = \
|
|||
nsDOMScriptObjectFactory.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = dombase.gqi
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
# static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
%import-idl "nsIDOMWindowInternal.idl"
|
||||
%import-idl "nsIDOMWindow2.idl"
|
||||
%import-idl "nsIDOMJSWindow.idl"
|
||||
%import-idl "nsIDOMEventTarget.idl"
|
||||
%import-idl "nsIDOM3EventTarget.idl"
|
||||
%import-idl "nsIDOMNSEventTarget.idl"
|
||||
%import-idl "nsIDOMViewCSS.idl"
|
||||
%import-idl "nsIDOMAbstractView.idl"
|
||||
%import-idl "nsIDOMStorageWindow.idl"
|
||||
%import-idl "nsIWeakReference.idl"
|
||||
%import-idl "nsIInterfaceRequestor.idl"
|
||||
|
||||
%pseudo-iid nsIScriptGlobalObject 6afecd40-0b9a-4cfd-8c42-0f645cd91829
|
||||
%pseudo-iid nsIScriptObjectPrincipal 3eedba38-8d22-41e1-817a-0e43e165b664
|
||||
%pseudo-iid nsPIDOMEventTarget 44a6597b-9fc3-4a8d-b7a4-d9009abf9d15
|
||||
%pseudo-iid nsPIDOMWindow 909852b5-b9e6-4d94-8de3-051634800b73
|
||||
|
||||
%{C++
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
%}
|
||||
|
||||
// QueryInterface implementation for nsGlobalWindow
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow)
|
||||
// Make sure this matches the cast in nsGlobalWindow::FromWrapper()
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindowInternal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMViewCSS)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMAbstractView)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window)
|
||||
NS_INTERFACE_MAP_END
|
|
@ -924,6 +924,30 @@ nsGlobalWindow::FreeInnerObjects(PRBool aClearScope)
|
|||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsGlobalWindow)
|
||||
|
||||
// QueryInterface implementation for nsGlobalWindow
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow)
|
||||
// Make sure this matches the cast in nsGlobalWindow::FromWrapper()
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindowInternal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMViewCSS)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMAbstractView)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF_AMBIGUOUS(nsGlobalWindow, nsIScriptGlobalObject)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE_AMBIGUOUS(nsGlobalWindow,
|
||||
nsIScriptGlobalObject)
|
||||
|
|
|
@ -95,9 +95,6 @@ CPPSRCS = \
|
|||
nsSerializationHelper.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = neckobase.gqi
|
||||
LOCAL_INCLUDES = -I$(topsrcdir)/xpcom/ds
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
|
||||
CPPSRCS += nsURLHelperOS2.cpp
|
||||
else
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
%import-idl "nsIStandardURL.idl"
|
||||
%import-idl "nsIURL.idl"
|
||||
%import-idl "nsIFileURL.idl"
|
||||
%import-idl "nsISerializable.idl"
|
||||
%import-idl "nsIClassInfo.idl"
|
||||
%import-idl "nsIIOService2.idl"
|
||||
%import-idl "nsINetUtil.idl"
|
||||
%import-idl "nsIObserver.idl"
|
||||
%import-idl "nsIWeakReference.idl"
|
||||
%import-idl "nsIChannel.idl"
|
||||
%import-idl "nsIInterfaceRequestor.idl"
|
||||
%import-idl "nsITransport.idl"
|
||||
%import-idl "nsIStreamListener.idl"
|
||||
%import-idl "nsISocketTransportService.idl"
|
||||
%import-idl "nsIEventTarget.idl"
|
||||
%import-idl "nsIThreadInternal.idl"
|
||||
%import-idl "nsIRunnable.idl"
|
||||
%import-idl "nsPISocketTransportService.idl"
|
||||
%import-idl "nsISocketTransport.idl"
|
||||
%import-idl "nsIDNSListener.idl"
|
||||
|
||||
%import "xpcomds.gqi"
|
||||
|
||||
%{C++
|
||||
#include "nsStandardURL.h"
|
||||
#include "nsIOService.h"
|
||||
#include "nsBaseChannel.h"
|
||||
#include "nsSocketTransportService2.h"
|
||||
#include "nsSocketTransport2.h"
|
||||
%}
|
||||
|
||||
// See nsStandardURL.h
|
||||
%pseudo-cid nsStandardURL b8e3e97b-1ccd-4b45-af5a-79596770f5d7 NS_THIS_STANDARDURL_IMPL_CID
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURI)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURL)
|
||||
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIFileURL, mSupportsFileURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISerializable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutable)
|
||||
NS_INTERFACE_MAP_ENTRY(NS_THIS_STANDARDURL_IMPL_CID)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsIOService,
|
||||
nsIIOService,
|
||||
nsIIOService2,
|
||||
nsINetUtil,
|
||||
nsIObserver,
|
||||
nsISupportsWeakReference)
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED6(nsBaseChannel,
|
||||
nsHashPropertyBag,
|
||||
nsIRequest,
|
||||
nsIChannel,
|
||||
nsIInterfaceRequestor,
|
||||
nsITransportEventSink,
|
||||
nsIRequestObserver,
|
||||
nsIStreamListener)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsSocketTransportService,
|
||||
nsISocketTransportService,
|
||||
nsIEventTarget,
|
||||
nsIThreadObserver,
|
||||
nsIRunnable,
|
||||
nsPISocketTransportService)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsSocketTransport,
|
||||
nsISocketTransport,
|
||||
nsITransport,
|
||||
nsIDNSListener,
|
||||
nsIClassInfo)
|
||||
|
||||
%{C++
|
||||
NS_IMPL_CI_INTERFACE_GETTER3(nsSocketTransport,
|
||||
nsISocketTransport,
|
||||
nsITransport,
|
||||
nsIDNSListener)
|
||||
|
||||
%}
|
|
@ -234,6 +234,18 @@ nsBaseChannel::BeginPumpingData()
|
|||
return rv;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsBaseChannel::nsISupports
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED6(nsBaseChannel,
|
||||
nsHashPropertyBag,
|
||||
nsIRequest,
|
||||
nsIChannel,
|
||||
nsIInterfaceRequestor,
|
||||
nsITransportEventSink,
|
||||
nsIRequestObserver,
|
||||
nsIStreamListener)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsBaseChannel::nsIRequest
|
||||
|
||||
|
|
|
@ -278,6 +278,13 @@ nsIOService::GetInstance() {
|
|||
return gIOService;
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsIOService,
|
||||
nsIIOService,
|
||||
nsIIOService2,
|
||||
nsINetUtil,
|
||||
nsIObserver,
|
||||
nsISupportsWeakReference)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -1600,6 +1600,16 @@ nsSocketTransport::OnSocketDetached(PRFileDesc *fd)
|
|||
//-----------------------------------------------------------------------------
|
||||
// xpcom api
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsSocketTransport,
|
||||
nsISocketTransport,
|
||||
nsITransport,
|
||||
nsIDNSListener,
|
||||
nsIClassInfo)
|
||||
NS_IMPL_CI_INTERFACE_GETTER3(nsSocketTransport,
|
||||
nsISocketTransport,
|
||||
nsITransport,
|
||||
nsIDNSListener)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::OpenInputStream(PRUint32 flags,
|
||||
PRUint32 segsize,
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
#include "nsIDNSListener.h"
|
||||
#include "nsIDNSRecord.h"
|
||||
#include "nsICancelable.h"
|
||||
#include "nsIClassInfoImpl.h"
|
||||
#include "nsIClassInfo.h"
|
||||
|
||||
class nsSocketTransport;
|
||||
|
||||
|
@ -319,6 +319,4 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
NS_DECL_CI_INTERFACE_GETTER(nsSocketTransport)
|
||||
|
||||
#endif // !nsSocketTransport_h__
|
||||
|
|
|
@ -354,6 +354,16 @@ nsSocketTransportService::Poll(PRBool wait, PRUint32 *interval)
|
|||
return rv;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// xpcom api
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsSocketTransportService,
|
||||
nsISocketTransportService,
|
||||
nsIEventTarget,
|
||||
nsIThreadObserver,
|
||||
nsIRunnable,
|
||||
nsPISocketTransportService)
|
||||
|
||||
// called from main thread only
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransportService::Init()
|
||||
|
|
|
@ -848,6 +848,21 @@ nsStandardURL::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||
NS_IMPL_ADDREF(nsStandardURL)
|
||||
NS_IMPL_RELEASE(nsStandardURL)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURI)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURL)
|
||||
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIFileURL, mSupportsFileURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIStandardURL)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISerializable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutable)
|
||||
// see nsStandardURL::Equals
|
||||
if (aIID.Equals(kThisImplCID))
|
||||
foundInterface = static_cast<nsIURI *>(this);
|
||||
else
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// nsStandardURL::nsIURI
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -273,7 +273,6 @@ private:
|
|||
static PRBool gEncodeQueryInUTF8;
|
||||
};
|
||||
|
||||
/* If you change this CID, make sure you also update neckobase.gqi */
|
||||
#define NS_THIS_STANDARDURL_IMPL_CID \
|
||||
{ /* b8e3e97b-1ccd-4b45-af5a-79596770f5d7 */ \
|
||||
0xb8e3e97b, \
|
||||
|
|
|
@ -1,883 +0,0 @@
|
|||
# -*- Mode: Python: tab-width: 8; indent-tabs-mode: nil; python-indent: 4 -*-
|
||||
|
||||
"""Implement QueryInterface using optimized generated code."""
|
||||
|
||||
import os, posixpath, errno, re, sys, sets
|
||||
|
||||
# Global controlling debug output to sys.stderr
|
||||
debug = False
|
||||
|
||||
def findfile(f, curfile, includedirs):
|
||||
"""Find a file 'f' by looking in the directory of the current file
|
||||
and then in all directories specified by -I until it is found. Returns
|
||||
the path of the file that was found.
|
||||
|
||||
@raises IOError is the file is not found."""
|
||||
|
||||
sdirs = [os.path.dirname(curfile)]
|
||||
sdirs.extend(includedirs)
|
||||
|
||||
for dir in sdirs:
|
||||
t = posixpath.join(dir, f)
|
||||
if os.path.exists(t):
|
||||
return t
|
||||
|
||||
raise IOError(errno.ENOENT, "File not found", f)
|
||||
|
||||
# Giant parsing loop: parse input files into the internal representation,
|
||||
# keeping track of file/line numbering information. This iterator automatically
|
||||
# skips blank lines and lines beginning with //
|
||||
|
||||
class IterFile(object):
|
||||
def __init__(self, file):
|
||||
self._file = file
|
||||
self._iter = open(file)
|
||||
self._lineno = 0
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
self._lineno += 1
|
||||
line = self._iter.next().strip()
|
||||
if line == '' or line.startswith('//'):
|
||||
return self.next()
|
||||
return line
|
||||
|
||||
def loc(self):
|
||||
return "%s:%i" % (self._file, self._lineno)
|
||||
|
||||
class uniqdict(dict):
|
||||
"""A subclass of dict that will throw an error if you attempt to set the same key to different values."""
|
||||
def __setitem__(self, key, value):
|
||||
if key in self and not value == self[key]:
|
||||
raise IndexError('Key "%s" already present in uniqdict' % key)
|
||||
|
||||
dict.__setitem__(self, key, value)
|
||||
|
||||
def update(self, d):
|
||||
for key, value in d.iteritems():
|
||||
if key in self and not value == self[key]:
|
||||
raise IndexError('Key "%s" already present in uniqdict' % key)
|
||||
|
||||
dict.update(self, d)
|
||||
|
||||
def dump_hex_tuple(t):
|
||||
return "(%s)" % ", ".join(["%#x" % i for i in t])
|
||||
|
||||
class UUID(object):
|
||||
type = 'UUID'
|
||||
|
||||
def __init__(self, name, iidstr, base=None):
|
||||
"""This method *assumes* that the UUID is validly formed."""
|
||||
self.name = name
|
||||
self.base = base
|
||||
|
||||
# iid is in 32-16-16-8*8 format, as hex *strings*
|
||||
iid = (iidstr[0:8], iidstr[9:13], iidstr[14:18],
|
||||
iidstr[19:21], iidstr[21:23], iidstr[24:26], iidstr[26:28],
|
||||
iidstr[28:30], iidstr[30:32], iidstr[32:34], iidstr[34:36])
|
||||
|
||||
self.iid = iid
|
||||
|
||||
# (big_endian_words, little_endian_words)
|
||||
self.words = (
|
||||
(int(iid[0], 16),
|
||||
int(iid[1] + iid[2], 16),
|
||||
int("".join([iid[i] for i in xrange(3, 7)]), 16),
|
||||
int("".join([iid[i] for i in xrange(7, 11)]), 16)),
|
||||
(int(iid[0], 16),
|
||||
int(iid[2] + iid[1], 16),
|
||||
int("".join([iid[i] for i in xrange(6, 2, -1)]), 16),
|
||||
int("".join([iid[i] for i in xrange(10, 6, -1)]), 16)))
|
||||
|
||||
if debug:
|
||||
print >>sys.stderr, "%r" % self
|
||||
print >>sys.stderr, " bigendian: %s" % dump_hex_tuple(self.words[False])
|
||||
print >>sys.stderr, " littleendian: %r" % dump_hex_tuple(self.words[True])
|
||||
|
||||
def __eq__(self, uuid):
|
||||
return self.iid == uuid.iid and self.name == uuid.name
|
||||
|
||||
def __repr__(self):
|
||||
return """%s(%r, "%s-%s-%s-%s-%s", base=%r)""" % (
|
||||
self.type, self.name,
|
||||
self.iid[0], self.iid[1], self.iid[2], self.iid[3] + self.iid[4],
|
||||
"".join([self.iid[i] for i in xrange(5, 11)]), self.base)
|
||||
|
||||
def asstruct(self):
|
||||
return "{ 0x%s, 0x%s, 0x%s, { 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s } }" % self.iid
|
||||
|
||||
def decl(self):
|
||||
return ""
|
||||
|
||||
def ref(self):
|
||||
return "NS_GET_IID(%s)" % self.name
|
||||
|
||||
class PseudoUUID(UUID):
|
||||
type = 'PseudoUUID'
|
||||
|
||||
# No special init method needed
|
||||
|
||||
def decl(self):
|
||||
return """
|
||||
#ifdef DEBUG
|
||||
static const nsID kGQI_%(iname)s = %(struct)s;
|
||||
NS_ASSERTION(NS_GET_IID(%(iname)s).Equals(kGQI_%(iname)s),
|
||||
"GQI pseudo-IID doesn't match reality.");
|
||||
#endif
|
||||
""" % {
|
||||
'iname': self.name,
|
||||
'struct': self.asstruct()
|
||||
}
|
||||
|
||||
class CID(UUID):
|
||||
type = 'CID'
|
||||
|
||||
def __init__(self, name, iid, decl):
|
||||
UUID.__init__(self, name, iid)
|
||||
self.pdecl = decl
|
||||
|
||||
def decl(self):
|
||||
return """
|
||||
static const nsID kGQI_%(pdecl)s = %(struct)s;
|
||||
#ifdef DEBUG
|
||||
static const nsID kGQI_TEST_%(pdecl)s = %(pdecl)s;
|
||||
#endif
|
||||
NS_ASSERTION(kGQI_%(pdecl)s.Equals(kGQI_TEST_%(pdecl)s),
|
||||
"GQI pseudo-IID doesn't match reality.");
|
||||
""" % {
|
||||
'pdecl': self.pdecl,
|
||||
'struct': self.asstruct()
|
||||
}
|
||||
|
||||
def ref(self):
|
||||
return "kGQI_%s" % self.pdecl
|
||||
|
||||
_uuid_pattern_string = r'[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}'
|
||||
|
||||
_includefinder = re.compile(r'#include\s+(?:"|\<)(?P<filename>[a-z\.\-\_0-9]+)(?:"|\>)\s*$', re.I)
|
||||
_uuidfinder = re.compile(r'uuid\((?P<iid>' + _uuid_pattern_string + r')\)', re.I)
|
||||
_namefinder = re.compile(r'interface\s+(?P<interface>[A-Za-z_0-9]+)\s+:\s+(?P<base>[A-Za-z]+)')
|
||||
|
||||
def importidl(file, includedirs):
|
||||
"""Parse an IDL file. Returns (mapofiids, setofdeps)"""
|
||||
|
||||
iids = {}
|
||||
deps = sets.Set()
|
||||
deps.add(file)
|
||||
|
||||
f = IterFile(file)
|
||||
for line in f:
|
||||
if line.startswith('%{'):
|
||||
# Skip literal IDL blocks such as %{C++ %}
|
||||
for line in f:
|
||||
if line.startswith('%}'):
|
||||
break
|
||||
continue
|
||||
|
||||
m = _includefinder.match(line)
|
||||
if m is not None:
|
||||
importediids, importeddeps = importidl(findfile(m.group('filename'), file, includedirs), includedirs)
|
||||
iids.update(importediids)
|
||||
deps |= importeddeps
|
||||
continue
|
||||
|
||||
m = _uuidfinder.search(line)
|
||||
if m is not None:
|
||||
iid = m.group('iid')
|
||||
line = f.next()
|
||||
if line == 'interface nsISupports {':
|
||||
iids['nsISupports'] = UUID('nsISupports', iid)
|
||||
else:
|
||||
m = _namefinder.match(line)
|
||||
if m is None:
|
||||
raise Exception("%s: expected interface" % f.loc())
|
||||
|
||||
iids[m.group('interface')] = \
|
||||
UUID(m.group('interface'), iid, base=m.group('base'))
|
||||
|
||||
return iids, deps
|
||||
|
||||
def gqi(ifaces, endian):
|
||||
"""Find an algorithm that uniquely identifies interfaces by a single
|
||||
word. Returns (indexfunction, table)"""
|
||||
for bits in xrange(3, 11):
|
||||
bitmask = (1 << bits) - 1
|
||||
for word in xrange(0, 4):
|
||||
for sh in xrange(0, 33 - bits):
|
||||
shmask = bitmask << sh
|
||||
|
||||
if debug:
|
||||
print "Trying word: %i, bits: %i, shift: %i" % (word, bits, sh)
|
||||
|
||||
l = list([None for i in xrange(0, 1 << bits)])
|
||||
try:
|
||||
for i in xrange(0, len(ifaces)):
|
||||
n = (ifaces[i].uuid.words[endian][word] & shmask) >> sh
|
||||
if l[n] is not None:
|
||||
if debug:
|
||||
print "found conflict, index %i" % n
|
||||
print "old iface: %s" % ifaces[l[n]].uuid
|
||||
print "new iface: %s" % ifaces[i].uuid
|
||||
raise IndexError()
|
||||
|
||||
l[n] = i
|
||||
|
||||
except IndexError:
|
||||
continue
|
||||
|
||||
# If we got here, we're ok... create the table we want
|
||||
indexfunc = "(reinterpret_cast<const PRUint32*>(&aIID)[%i] & 0x%x) >> %i" % (word, shmask, sh)
|
||||
return indexfunc, l
|
||||
|
||||
raise Exception("No run of 10 bits within a word was unique!: interfaces: %s" % [i.uuid for i in ifaces])
|
||||
|
||||
def basecast(item, baselist):
|
||||
"""Returns a string where an item is static_cast through a list of bases."""
|
||||
for base in baselist:
|
||||
item = "static_cast<%s*>(%s)" % (base, item)
|
||||
|
||||
return item
|
||||
|
||||
class QIImpl(object):
|
||||
_default_unfound = """
|
||||
*aResult = nsnull;
|
||||
return NS_NOINTERFACE;
|
||||
"""
|
||||
|
||||
_qiimpl = """
|
||||
enum %(cname)s_QIActionType {
|
||||
%(actionenums)s
|
||||
};
|
||||
|
||||
struct %(cname)s_QIAction {
|
||||
const nsID *iid;
|
||||
%(actiontype)s
|
||||
union {
|
||||
void *ptr;
|
||||
%(actiondata)s
|
||||
} data;
|
||||
};
|
||||
|
||||
NS_IMETHODIMP %(cname)s::QueryInterface(REFNSIID aIID, void **aResult)
|
||||
{
|
||||
%(uuiddecls)s
|
||||
|
||||
static const PRUint8 kLookupTable[] = {
|
||||
#ifdef IS_BIG_ENDIAN
|
||||
%(biglookup)s
|
||||
#else
|
||||
%(littlelookup)s
|
||||
#endif
|
||||
};
|
||||
|
||||
static const %(cname)s_QIAction kActionTable[] = {
|
||||
%(actiontable)s
|
||||
};
|
||||
|
||||
nsISupports* found = nsnull;
|
||||
const %(cname)s_QIAction *entry;
|
||||
PRUint32 index =
|
||||
#ifdef IS_BIG_ENDIAN
|
||||
%(bigindexfunc)s;
|
||||
#else
|
||||
%(littleindexfunc)s;
|
||||
#endif
|
||||
|
||||
PRUint8 action = kLookupTable[index];
|
||||
if (action == 0xFF)
|
||||
goto unfound;
|
||||
|
||||
entry = kActionTable + action;
|
||||
if (!entry->iid->Equals(aIID))
|
||||
goto unfound;
|
||||
|
||||
%(actioncode)s
|
||||
|
||||
NS_NOTREACHED("Unhandled case?");
|
||||
|
||||
%(nullcheck)s
|
||||
|
||||
exit_addref:
|
||||
NS_ASSERTION(found, "Interface should have been found by now.");
|
||||
found->AddRef();
|
||||
*aResult = found;
|
||||
return NS_OK;
|
||||
|
||||
unfound:
|
||||
%(unfound)s
|
||||
}"""
|
||||
|
||||
_datatypes = """
|
||||
%(type)s %(name)s;
|
||||
"""
|
||||
|
||||
_actiontable_entry = """
|
||||
{
|
||||
&(%(iref)s),
|
||||
%(enumtype)s
|
||||
%(emitTable)s
|
||||
},
|
||||
"""
|
||||
|
||||
_actioncode_multi = """
|
||||
switch (entry->action) {
|
||||
%s
|
||||
}
|
||||
"""
|
||||
|
||||
_actioncode_multi_entry = """
|
||||
case %(cname)s_%(enumtype)s:
|
||||
%(setResult)s
|
||||
"""
|
||||
|
||||
_nullcheck = """
|
||||
exit_nullcheck_addref:
|
||||
if (!found)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
"""
|
||||
|
||||
_refcounting = """
|
||||
NS_IMPL_%(threadsafe)sADDREF(%(cname)s)
|
||||
NS_IMPL_%(threadsafe)sRELEASE(%(cname)s)
|
||||
"""
|
||||
|
||||
def __init__(self, cname, ifaces, emitrefcount=False,
|
||||
threadsafe="", unfound=None, base=None):
|
||||
self.cname = cname
|
||||
self.emitrefcount = emitrefcount
|
||||
self.threadsafe = threadsafe
|
||||
self.base = base
|
||||
self.ifaces = ifaces
|
||||
self.unfound = unfound
|
||||
|
||||
def iter_self_and_bases(self):
|
||||
"""yields (impl, baselist) for all bases"""
|
||||
impl = self
|
||||
baselist = []
|
||||
|
||||
while impl is not None:
|
||||
baselist = list(baselist)
|
||||
baselist.append(impl.cname)
|
||||
yield impl, baselist
|
||||
impl = impl.base
|
||||
|
||||
def iter_all_ifaces(self):
|
||||
"""yields (iface, baselist) for all interfaces"""
|
||||
for impl, baselist in self.iter_self_and_bases():
|
||||
for i in impl.ifaces:
|
||||
if len(baselist) == 1 or i.inherit:
|
||||
yield i, baselist
|
||||
|
||||
def output(self, fd):
|
||||
unfound = None
|
||||
for impl, baselist in self.iter_self_and_bases():
|
||||
if impl.unfound is not None:
|
||||
unfound = impl.unfound
|
||||
break
|
||||
|
||||
if unfound is None:
|
||||
unfound = self._default_unfound
|
||||
|
||||
needsnullcheck = False
|
||||
actions = sets.Set()
|
||||
types = uniqdict()
|
||||
for i, baselist in self.iter_all_ifaces():
|
||||
action = i.action
|
||||
actions.add(action)
|
||||
if action.needsnullcheck:
|
||||
needsnullcheck = True
|
||||
|
||||
if action.datatype:
|
||||
types[action.varname] = action.datatype
|
||||
|
||||
actionenums = ", ".join(["%s_%s" % (self.cname, action.enumtype)
|
||||
for action in actions])
|
||||
|
||||
# types.ptr is explicitly first (for initialization), so delete it
|
||||
types.pop('ptr', None)
|
||||
|
||||
actiondata = "".join([self._datatypes % {'type': type,
|
||||
'name': name}
|
||||
for name, type in types.iteritems()])
|
||||
|
||||
# ensure that interfaces are not duplicated
|
||||
# maps name -> (uuid, baselist)
|
||||
ifdict = uniqdict()
|
||||
for i, baselist in self.iter_all_ifaces():
|
||||
if i.uuid.name in ifdict:
|
||||
print >>sys.stderr, "warning: interface '%s' from derived class '%s' overrides base class '%s'" % (i.uuid.name, baselist[0], baselist[len(baselist) - 1])
|
||||
else:
|
||||
ifdict[i.uuid.name] = (i, baselist)
|
||||
|
||||
# list of (i, baselist)
|
||||
ilist = [i for i in ifdict.itervalues()]
|
||||
|
||||
uuiddecls = "".join([i.uuid.decl()
|
||||
for i, baselist in ilist])
|
||||
|
||||
bigindexfunc, bigitable = gqi([iface for iface, baselist in ilist], False)
|
||||
littleindexfunc, littleitable = gqi([iface for iface, baselist in ilist], True)
|
||||
|
||||
# (falseval, trueval)[conditional expression] is the python
|
||||
# ternary operator
|
||||
biglookup = ",\n".join([(str(i), "0xFF")[i is None]
|
||||
for i in bigitable])
|
||||
littlelookup = ",\n".join([(str(i), "0xFF")[i is None]
|
||||
for i in littleitable])
|
||||
|
||||
if len(actions) > 1:
|
||||
actiontype = "%s_QIActionType action;" % self.cname
|
||||
enumtype = "%(cname)s_%(enumtype)s,"
|
||||
else:
|
||||
actiontype = ""
|
||||
enumtype = ""
|
||||
|
||||
actiontable = "".join([self._actiontable_entry %
|
||||
{'enumtype': enumtype % {'cname': self.cname,
|
||||
'enumtype': iface.action.enumtype},
|
||||
'iname': iface.uuid.name,
|
||||
'iref': iface.uuid.ref(),
|
||||
'emitTable': iface.emitTable(self.cname, baselist)}
|
||||
for iface, baselist in ilist])
|
||||
|
||||
if len(actions) == 1:
|
||||
actioncode = iter(actions).next().setResult % {
|
||||
'classname': self.cname
|
||||
}
|
||||
else:
|
||||
actioncode = self._actioncode_multi % (
|
||||
"".join([self._actioncode_multi_entry % {
|
||||
'cname': self.cname,
|
||||
'enumtype': action.enumtype,
|
||||
'setResult': action.setResult % {'classname': self.cname}}
|
||||
for action in actions])
|
||||
)
|
||||
|
||||
if needsnullcheck:
|
||||
nullcheck = self._nullcheck
|
||||
else:
|
||||
nullcheck = ""
|
||||
|
||||
print >>fd, self._qiimpl % {
|
||||
'cname': self.cname,
|
||||
'actionenums': actionenums,
|
||||
'actiontype': actiontype,
|
||||
'actiondata': actiondata,
|
||||
'uuiddecls': uuiddecls,
|
||||
'biglookup': biglookup,
|
||||
'littlelookup': littlelookup,
|
||||
'actiontable': actiontable,
|
||||
'bigindexfunc': bigindexfunc,
|
||||
'littleindexfunc': littleindexfunc,
|
||||
'actioncode': actioncode,
|
||||
'nullcheck': nullcheck,
|
||||
'unfound': unfound
|
||||
}
|
||||
|
||||
if self.emitrefcount:
|
||||
print >>fd, self._refcounting % {
|
||||
'threadsafe': self.threadsafe,
|
||||
'cname': self.cname
|
||||
}
|
||||
|
||||
class PointerAction(object):
|
||||
enumtype = "STATIC_POINTER"
|
||||
datatype = "void*"
|
||||
varname = "ptr"
|
||||
setResult = """*aResult = entry->data.ptr;
|
||||
return NS_OK;"""
|
||||
needsnullcheck = False
|
||||
|
||||
nsCycleCollectionParticipant = PseudoUUID("nsCycleCollectionParticipant", "9674489b-1f6f-4550-a730-ccaedd104cf9")
|
||||
|
||||
class CCParticipantResponse(object):
|
||||
action = PointerAction
|
||||
inherit = True
|
||||
|
||||
def __init__(self, classname):
|
||||
self.classname = classname
|
||||
self.uuid = nsCycleCollectionParticipant
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
return "{ &NS_CYCLE_COLLECTION_NAME(%s) }" % classname
|
||||
|
||||
class TearoffResponse(object):
|
||||
"""Because each tearoff is different, this response is its own action."""
|
||||
datatype = None
|
||||
needsnullcheck = True
|
||||
inherit = True
|
||||
|
||||
def __init__(self, uuid, allocator):
|
||||
self.setResult = """
|
||||
found = static_cast<%s*>(%s);
|
||||
goto exit_nullcheck_addref;
|
||||
""" % (uuid.name, allocator)
|
||||
self.uuid = uuid
|
||||
self.action = self
|
||||
self.enumtype = "NS_TEAROFF_%s" % uuid.name
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
return "{0}"
|
||||
|
||||
class ConditionalResponse(object):
|
||||
"""Because each condition is different, this response is its own action."""
|
||||
datatype = None
|
||||
needsnullcheck = False
|
||||
inherit = True
|
||||
|
||||
def __init__(self, uuid, condition):
|
||||
self.setResult = """
|
||||
if (!(%s)) {
|
||||
goto unfound;
|
||||
}
|
||||
found = static_cast<%s*>(this);
|
||||
goto exit_addref;
|
||||
""" % (condition, uuid.name);
|
||||
|
||||
self.uuid = uuid
|
||||
self.action = self
|
||||
self.enumtype = "NS_CONDITIONAL_%s" % uuid.name
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
return "{0}"
|
||||
|
||||
nsCycleCollectionISupports = PseudoUUID("nsCycleCollectionISupports", "c61eac14-5f7a-4481-965e-7eaa6effa85f")
|
||||
|
||||
class CCSupportsAction(object):
|
||||
enumtype = "CC_ISUPPORTS"
|
||||
datatype = None
|
||||
setResult = """
|
||||
found = NS_CYCLE_COLLECTION_CLASSNAME(%(classname)s)::Upcast(this);
|
||||
goto exit_nullcheck_addref;
|
||||
"""
|
||||
needsnullcheck = True
|
||||
|
||||
class CCISupportsResponse(object):
|
||||
action = CCSupportsAction
|
||||
inherit = True
|
||||
|
||||
def __init__(self, classname):
|
||||
self.classname = classname
|
||||
self.uuid = nsCycleCollectionISupports
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
return "{ 0 }"
|
||||
|
||||
nsIClassInfo = PseudoUUID("nsIClassInfo", "986c11d0-f340-11d4-9075-0010a4e73d9a")
|
||||
|
||||
class DOMCIResult(object):
|
||||
datatype = None
|
||||
enumtype = "DOMCI"
|
||||
needsnullcheck = True
|
||||
inherit = False
|
||||
|
||||
def __init__(self, domciname):
|
||||
self.action = self
|
||||
self.uuid = nsIClassInfo
|
||||
self.setResult = """
|
||||
found = NS_GetDOMClassInfoInstance(eDOMClassInfo_%s_id);
|
||||
goto exit_nullcheck_addref;
|
||||
""" % domciname
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
return "{ 0 }"
|
||||
|
||||
class OffsetAction(object):
|
||||
enumtype = "OFFSET_THIS_ADDREF"
|
||||
datatype = "PRUint32"
|
||||
varname = "offset"
|
||||
setResult = """
|
||||
found = reinterpret_cast<nsISupports*>(reinterpret_cast<char*>(this) + entry->data.offset);
|
||||
goto exit_addref;
|
||||
"""
|
||||
needsnullcheck = False
|
||||
|
||||
class OffsetThisQIResponse(object):
|
||||
action = OffsetAction
|
||||
inherit = True
|
||||
|
||||
def __init__(self, uuid):
|
||||
self.uuid = uuid
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
casted = basecast("((%s*) 0x1000)" % classname, baselist)
|
||||
|
||||
return """
|
||||
{ reinterpret_cast<void*>(
|
||||
reinterpret_cast<char*>(
|
||||
static_cast<%(iname)s*>(%(casted)s)) -
|
||||
reinterpret_cast<char*>(%(casted)s))
|
||||
}""" % { 'casted': casted,
|
||||
'iname': self.uuid.name }
|
||||
|
||||
class OffsetFutureThisQIResponse(OffsetThisQIResponse):
|
||||
action = OffsetAction
|
||||
inherit = True
|
||||
|
||||
def __init__(self, uuid):
|
||||
self.uuid = uuid
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
casted = "((%s*) 0x1000)" % classname
|
||||
|
||||
return """
|
||||
{ reinterpret_cast<void*>(
|
||||
reinterpret_cast<char*>(
|
||||
static_cast<%(iname)s*>(%(casted)s)) -
|
||||
reinterpret_cast<char*>(%(casted)s))
|
||||
}""" % { 'casted': casted,
|
||||
'iname': self.uuid.name }
|
||||
|
||||
class OffsetThisQIResponseAmbiguous(OffsetThisQIResponse):
|
||||
def __init__(self, uuid, intermediate):
|
||||
self.intermediate = intermediate
|
||||
OffsetThisQIResponse.__init__(self, uuid)
|
||||
|
||||
def emitTable(self, classname, baselist):
|
||||
casted = basecast("((%s*) 0x1000)" % classname, baselist)
|
||||
|
||||
return """
|
||||
{ reinterpret_cast<void*>(
|
||||
reinterpret_cast<char*>(
|
||||
static_cast<%(iname)s*>(
|
||||
static_cast<%(intermediate)s*>(%(casted)s))) -
|
||||
reinterpret_cast<char*>(%(casted)s))
|
||||
}""" % \
|
||||
{ 'casted': casted,
|
||||
'iname': self.uuid.name,
|
||||
'intermediate': self.intermediate.name }
|
||||
|
||||
class LiteralAction(object):
|
||||
datatype = None
|
||||
def __init__(self, uname, code):
|
||||
self.enumtype = "LITERAL_CODE_%s" % uname
|
||||
self.setResult = code
|
||||
self.needsnullcheck = code.find('exit_nullcheck_addref') != -1
|
||||
|
||||
class LiteralResponse(object):
|
||||
inherit = True
|
||||
|
||||
def __init__(self, action, uuid):
|
||||
self.action = action
|
||||
self.uuid = uuid
|
||||
|
||||
def emitTable(self, cname, baselist):
|
||||
return "{0}"
|
||||
|
||||
_map_entry = re.compile(r'(?P<action>[A-Z_]+)\((?P<list>.*)\)$')
|
||||
_split_commas = re.compile(r'\s*,\s*')
|
||||
|
||||
def build_map(f, cname, iids):
|
||||
"""Parse the body of an NS_INTERFACE_MAP and return (members, unfound)"""
|
||||
unfound = None
|
||||
members = []
|
||||
for line in f:
|
||||
if line == 'NS_INTERFACE_MAP_END':
|
||||
return (members, unfound)
|
||||
|
||||
if line == 'NS_INTERFACE_MAP_UNFOUND':
|
||||
unfound = ''
|
||||
for line in f:
|
||||
if line == 'END':
|
||||
break
|
||||
unfound += line
|
||||
continue
|
||||
|
||||
if line.find(')') == -1:
|
||||
for line2 in f:
|
||||
line += line2
|
||||
if line.find(')') != -1:
|
||||
break
|
||||
|
||||
m = _map_entry.match(line)
|
||||
if m is None:
|
||||
raise Exception("%s: Unparseable interface map entry" % f.loc())
|
||||
|
||||
items = _split_commas.split(m.group('list'))
|
||||
|
||||
action = m.group('action')
|
||||
if action == 'NS_INTERFACE_MAP_ENTRY':
|
||||
iname, = items
|
||||
members.append(OffsetThisQIResponse(iids[iname]))
|
||||
elif action == 'NS_FUTURE_INTERFACE_MAP_ENTRY':
|
||||
iname, = items
|
||||
members.append(OffsetFutureThisQIResponse(iids[iname]))
|
||||
elif action == 'NS_INTERFACE_MAP_ENTRY_AMBIGUOUS':
|
||||
iname, intermediate = items
|
||||
members.append(OffsetThisQIResponseAmbiguous(iids[iname], iids[intermediate]))
|
||||
elif action == 'NS_INTERFACE_MAP_ENTRY_TEAROFF':
|
||||
iname, allocator = items
|
||||
members.append(TearoffResponse(iids[iname], allocator))
|
||||
elif action == 'NS_INTERFACE_MAP_ENTRY_CONDITIONAL':
|
||||
iname, condition = items
|
||||
members.append(ConditionalResponse(iids[iname], condition))
|
||||
elif action == 'NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO':
|
||||
domciname, = items
|
||||
members.append(DOMCIResult(domciname))
|
||||
elif action == 'NS_INTERFACE_MAP_ENTRY_LITERAL':
|
||||
code = ''
|
||||
for line in f:
|
||||
if line == 'END':
|
||||
break
|
||||
code += line
|
||||
|
||||
a = LiteralAction(items[0], code)
|
||||
for iname in items:
|
||||
iface = iids[iname]
|
||||
members.append(LiteralResponse(a, iface))
|
||||
else:
|
||||
raise Exception("%s: Unexpected interface map entry" % f.loc())
|
||||
|
||||
raise Exception("%s: Unexpected EOF" % f.loc())
|
||||
|
||||
_import = re.compile(r'%(?P<type>import|import-idl)\s+(?:"|\<)(?P<filename>[a-z\.\-\_0-9]+)(?:"|\>)\s*$', re.I)
|
||||
_impl_qi = re.compile(r'NS_IMPL_(?P<threadsafe>THREADSAFE_)?(?P<type>QUERY_INTERFACE|ISUPPORTS)(?P<inherited>_INHERITED)?(?:\d+)\((?P<bases>.*)\)\s*$')
|
||||
_pseudoiid = re.compile(r'%pseudo-iid\s+(?P<name>[a-z_0-9]+)\s+(?P<iid>' + _uuid_pattern_string + r')\s*$', re.I)
|
||||
_pseudocid = re.compile(r'%pseudo-cid\s+(?P<name>[a-z_0-9]+)\s+(?P<iid>' + _uuid_pattern_string + r')\s+(?P<decl>[a-z_0-9]+)$', re.I)
|
||||
_map_begin = re.compile(r'NS_INTERFACE_MAP_BEGIN(?P<cc>_CYCLE_COLLECTION)?\((?P<classname>[A-Za-z0-9+]+)(?:\s*,\s*(?P<base>[A-Za-z0-9+]+))?\)$')
|
||||
|
||||
def parsefile(file, fd, includedirs):
|
||||
"""Parse a file, returning a (map of name->QIImpls, set of deps)
|
||||
%{C++ blocks are printed immediately to fd."""
|
||||
|
||||
iids = uniqdict()
|
||||
impls = uniqdict()
|
||||
imported = uniqdict()
|
||||
deps = sets.Set()
|
||||
deps.add(file)
|
||||
|
||||
f = IterFile(file)
|
||||
for line in f:
|
||||
if len(line) == 0:
|
||||
continue
|
||||
|
||||
if line == "%{C++":
|
||||
for line in f:
|
||||
if line == "%}":
|
||||
break
|
||||
print >>fd, line
|
||||
continue
|
||||
|
||||
m = _pseudoiid.match(line)
|
||||
if m is not None:
|
||||
uuid = PseudoUUID(m.group('name'), m.group('iid'))
|
||||
iids[m.group('name')] = uuid
|
||||
continue
|
||||
|
||||
m = _pseudocid.match(line)
|
||||
if m is not None:
|
||||
uuid = CID(m.group('name'), m.group('iid'), m.group('decl'))
|
||||
iids[m.group('decl')] = uuid
|
||||
continue
|
||||
|
||||
m = _import.match(line)
|
||||
if m is not None:
|
||||
if m.group('type') == 'import':
|
||||
newimpls, newdeps = parsefile(findfile(m.group('filename'), file, includedirs), fd, includedirs)
|
||||
imported.update(newimpls)
|
||||
deps |= newdeps
|
||||
else:
|
||||
newiids, newdeps = importidl(findfile(m.group('filename'), file, includedirs), includedirs)
|
||||
iids.update(newiids)
|
||||
deps |= newdeps
|
||||
print >>fd, '#include "%s"' % m.group('filename').replace('.idl', '.h')
|
||||
continue
|
||||
|
||||
if line.find('NS_IMPL_') != -1:
|
||||
if line.find(')') == -1:
|
||||
for follow in f:
|
||||
line += follow
|
||||
if follow.find(')') != -1:
|
||||
break
|
||||
|
||||
if line.find(')') == -1:
|
||||
raise Exception("%s: Unterminated NS_IMPL_ call" % f.loc())
|
||||
|
||||
m = _impl_qi.match(line)
|
||||
if m is None:
|
||||
raise Exception("%s: Unparseable NS_IMPL_ call" % f.loc())
|
||||
|
||||
bases = _split_commas.split(m.group('bases'))
|
||||
cname = bases.pop(0)
|
||||
if m.group('inherited'):
|
||||
inherited = bases.pop(0)
|
||||
if inherited in impls:
|
||||
base = impls[inherited]
|
||||
else:
|
||||
base = imported[inherited]
|
||||
else:
|
||||
base = None
|
||||
|
||||
baseuuids = [iids[name] for name in bases]
|
||||
ifaces = [OffsetThisQIResponse(uuid) for uuid in baseuuids]
|
||||
ifaces.append(OffsetThisQIResponseAmbiguous(iids['nsISupports'], ifaces[0].uuid))
|
||||
q = QIImpl(cname, ifaces,
|
||||
emitrefcount=(m.group('type') == 'ISUPPORTS'),
|
||||
threadsafe=m.group('threadsafe') or '',
|
||||
base=base)
|
||||
impls[cname] = q
|
||||
continue
|
||||
|
||||
m = _map_begin.match(line)
|
||||
if m is not None:
|
||||
members, unfound = build_map(f, m.group('classname'), iids)
|
||||
if m.group('cc') is not None:
|
||||
members.append(CCParticipantResponse(m.group('classname')))
|
||||
members.append(CCISupportsResponse(m.group('classname')))
|
||||
base = None
|
||||
if m.group('base') is not None:
|
||||
if m.group('base') in impls:
|
||||
base = impls[m.group('base')]
|
||||
else:
|
||||
base = imported[m.group('base')]
|
||||
q = QIImpl(m.group('classname'), members, unfound=unfound, base=base)
|
||||
impls[m.group('classname')] = q
|
||||
continue
|
||||
|
||||
raise Exception("%s: unexpected input line" % f.loc())
|
||||
|
||||
return impls, deps
|
||||
|
||||
def main():
|
||||
from optparse import OptionParser
|
||||
|
||||
o = OptionParser()
|
||||
o.add_option("-I", action="append", dest="include_dirs", default=[],
|
||||
help="Directory to search for included files.")
|
||||
o.add_option("-D", dest="deps_file",
|
||||
help="Write dependencies to a file")
|
||||
o.add_option("-o", dest="out_file",
|
||||
help="Write output to file. Required")
|
||||
o.add_option("-v", dest="verbose", action="store_true",
|
||||
help="Print verbose debugging output.")
|
||||
|
||||
(options, files) = o.parse_args()
|
||||
|
||||
if options.verbose:
|
||||
global debug
|
||||
debug = True
|
||||
|
||||
if options.out_file is None:
|
||||
o.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
outfd = open(options.out_file, 'w')
|
||||
|
||||
deps = sets.Set()
|
||||
|
||||
for file in files:
|
||||
impls, newdeps = parsefile(file, outfd, options.include_dirs)
|
||||
for q in impls.itervalues():
|
||||
q.output(outfd)
|
||||
deps |= newdeps
|
||||
|
||||
if options.deps_file is not None:
|
||||
depsfd = open(options.deps_file, 'w')
|
||||
print >>depsfd, "%s: %s" % (options.out_file,
|
||||
" \\\n ".join(deps))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -59,10 +59,6 @@ CPPSRCS = \
|
|||
nsServiceManagerObsolete.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = \
|
||||
xpcomcomponents.gqi \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsCategoryManagerUtils.h \
|
||||
nsIServiceManagerObsolete.h \
|
||||
|
|
|
@ -80,6 +80,48 @@ class nsIComponentLoaderManager;
|
|||
// pulled in from nsComponentManager.cpp
|
||||
char* ArenaStrdup(const char* s, PLArenaPool* aArena);
|
||||
|
||||
//
|
||||
// BaseStringEnumerator is subclassed by EntryEnumerator and
|
||||
// CategoryEnumerator
|
||||
//
|
||||
class BaseStringEnumerator
|
||||
: public nsISimpleEnumerator,
|
||||
nsIUTF8StringEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
NS_DECL_NSIUTF8STRINGENUMERATOR
|
||||
|
||||
protected:
|
||||
// Callback function for NS_QuickSort to sort mArray
|
||||
static int SortCallback(const void *, const void *, void *);
|
||||
|
||||
BaseStringEnumerator()
|
||||
: mArray(nsnull),
|
||||
mCount(0),
|
||||
mSimpleCurItem(0),
|
||||
mStringCurItem(0) { }
|
||||
|
||||
// A virtual destructor is needed here because subclasses of
|
||||
// BaseStringEnumerator do not implement their own Release() method.
|
||||
|
||||
virtual ~BaseStringEnumerator()
|
||||
{
|
||||
if (mArray)
|
||||
delete[] mArray;
|
||||
}
|
||||
|
||||
void Sort();
|
||||
|
||||
const char** mArray;
|
||||
PRUint32 mCount;
|
||||
PRUint32 mSimpleCurItem;
|
||||
PRUint32 mStringCurItem;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS2(BaseStringEnumerator, nsISimpleEnumerator, nsIUTF8StringEnumerator)
|
||||
|
||||
NS_IMETHODIMP
|
||||
BaseStringEnumerator::HasMoreElements(PRBool *_retval)
|
||||
{
|
||||
|
@ -441,6 +483,8 @@ CategoryEnumerator::enumfunc_createenumerator(const char* aStr, CategoryNode* aN
|
|||
// nsCategoryManager implementations
|
||||
//
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsCategoryManager, nsICategoryManager)
|
||||
|
||||
nsCategoryManager*
|
||||
nsCategoryManager::Create()
|
||||
{
|
||||
|
@ -742,6 +786,17 @@ nsCategoryManager::SuppressNotifications(PRBool aSuppress)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsCategoryManagerFactory : public nsIFactory
|
||||
{
|
||||
public:
|
||||
nsCategoryManagerFactory() { }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFACTORY
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsCategoryManagerFactory, nsIFactory)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsCategoryManagerFactory::CreateInstance( nsISupports* aOuter, const nsIID& aIID, void** aResult )
|
||||
{
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
#include "plarena.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsIStringEnumerator.h"
|
||||
|
||||
#define NS_CATEGORYMANAGER_CLASSNAME "Category Manager"
|
||||
|
||||
|
@ -171,53 +168,4 @@ private:
|
|||
PRBool mSuppressNotifications;
|
||||
};
|
||||
|
||||
class nsCategoryManagerFactory : public nsIFactory
|
||||
{
|
||||
public:
|
||||
nsCategoryManagerFactory() { }
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFACTORY
|
||||
};
|
||||
|
||||
//
|
||||
// BaseStringEnumerator is subclassed by EntryEnumerator and
|
||||
// CategoryEnumerator
|
||||
//
|
||||
class BaseStringEnumerator
|
||||
: public nsISimpleEnumerator,
|
||||
nsIUTF8StringEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
NS_DECL_NSIUTF8STRINGENUMERATOR
|
||||
|
||||
protected:
|
||||
// Callback function for NS_QuickSort to sort mArray
|
||||
static int SortCallback(const void *, const void *, void *);
|
||||
|
||||
BaseStringEnumerator()
|
||||
: mArray(nsnull),
|
||||
mCount(0),
|
||||
mSimpleCurItem(0),
|
||||
mStringCurItem(0) { }
|
||||
|
||||
// A virtual destructor is needed here because subclasses of
|
||||
// BaseStringEnumerator do not implement their own Release() method.
|
||||
|
||||
virtual ~BaseStringEnumerator()
|
||||
{
|
||||
if (mArray)
|
||||
delete[] mArray;
|
||||
}
|
||||
|
||||
void Sort();
|
||||
|
||||
const char** mArray;
|
||||
PRUint32 mCount;
|
||||
PRUint32 mSimpleCurItem;
|
||||
PRUint32 mStringCurItem;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -303,6 +303,46 @@ static const PLDHashTableOps contractID_DHashTableOps = {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Hashtable Enumeration
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
typedef NS_CALLBACK(EnumeratorConverter)(PLDHashTable *table,
|
||||
const PLDHashEntryHdr *hdr,
|
||||
void *data,
|
||||
nsISupports **retval);
|
||||
|
||||
class PLDHashTableEnumeratorImpl : public nsIBidirectionalEnumerator,
|
||||
public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIENUMERATOR
|
||||
NS_DECL_NSIBIDIRECTIONALENUMERATOR
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
|
||||
PLDHashTableEnumeratorImpl(PLDHashTable *table,
|
||||
EnumeratorConverter converter,
|
||||
void *converterData);
|
||||
PRInt32 Count() { return mCount; }
|
||||
private:
|
||||
PLDHashTableEnumeratorImpl(); /* no implementation */
|
||||
|
||||
~PLDHashTableEnumeratorImpl();
|
||||
void ReleaseElements();
|
||||
|
||||
nsVoidArray mElements;
|
||||
PRInt32 mCount, mCurrent;
|
||||
PRMonitor* mMonitor;
|
||||
|
||||
struct Closure {
|
||||
PRBool succeeded;
|
||||
EnumeratorConverter converter;
|
||||
void *data;
|
||||
PLDHashTableEnumeratorImpl *impl;
|
||||
};
|
||||
|
||||
static PLDHashOperator PR_CALLBACK Enumerator(PLDHashTable *table,
|
||||
PLDHashEntryHdr *hdr,
|
||||
PRUint32 number,
|
||||
void *data);
|
||||
};
|
||||
|
||||
// static
|
||||
PLDHashOperator PR_CALLBACK
|
||||
|
@ -341,6 +381,11 @@ PLDHashTableEnumeratorImpl::PLDHashTableEnumeratorImpl(PLDHashTable *table,
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS3(PLDHashTableEnumeratorImpl,
|
||||
nsIBidirectionalEnumerator,
|
||||
nsIEnumerator,
|
||||
nsISimpleEnumerator)
|
||||
|
||||
PLDHashTableEnumeratorImpl::~PLDHashTableEnumeratorImpl()
|
||||
{
|
||||
ReleaseElements();
|
||||
|
@ -724,6 +769,16 @@ nsComponentManagerImpl::~nsComponentManagerImpl()
|
|||
PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed."));
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS7(nsComponentManagerImpl,
|
||||
nsIComponentManager,
|
||||
nsIServiceManager,
|
||||
nsISupportsWeakReference,
|
||||
nsIInterfaceRequestor,
|
||||
nsIComponentRegistrar,
|
||||
nsIServiceManagerObsolete,
|
||||
nsIComponentManagerObsolete)
|
||||
|
||||
|
||||
nsresult
|
||||
nsComponentManagerImpl::GetInterface(const nsIID & uuid, void **result)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
#include "nsCOMArray.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsIEnumerator.h"
|
||||
|
||||
struct nsFactoryEntry;
|
||||
class nsIServiceManager;
|
||||
|
@ -335,46 +334,5 @@ struct nsContractIDTableEntry : public PLDHashEntryHdr {
|
|||
nsFactoryEntry *mFactoryEntry;
|
||||
};
|
||||
|
||||
typedef NS_CALLBACK(EnumeratorConverter)(PLDHashTable *table,
|
||||
const PLDHashEntryHdr *hdr,
|
||||
void *data,
|
||||
nsISupports **retval);
|
||||
|
||||
class PLDHashTableEnumeratorImpl : public nsIBidirectionalEnumerator,
|
||||
public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIENUMERATOR
|
||||
NS_DECL_NSIBIDIRECTIONALENUMERATOR
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
|
||||
PLDHashTableEnumeratorImpl(PLDHashTable *table,
|
||||
EnumeratorConverter converter,
|
||||
void *converterData);
|
||||
PRInt32 Count() { return mCount; }
|
||||
private:
|
||||
PLDHashTableEnumeratorImpl(); /* no implementation */
|
||||
|
||||
~PLDHashTableEnumeratorImpl();
|
||||
void ReleaseElements();
|
||||
|
||||
nsVoidArray mElements;
|
||||
PRInt32 mCount, mCurrent;
|
||||
PRMonitor* mMonitor;
|
||||
|
||||
struct Closure {
|
||||
PRBool succeeded;
|
||||
EnumeratorConverter converter;
|
||||
void *data;
|
||||
PLDHashTableEnumeratorImpl *impl;
|
||||
};
|
||||
|
||||
static PLDHashOperator PR_CALLBACK Enumerator(PLDHashTable *table,
|
||||
PLDHashEntryHdr *hdr,
|
||||
PRUint32 number,
|
||||
void *data);
|
||||
};
|
||||
|
||||
#endif // nsComponentManager_h__
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@ static PRLogModuleInfo *nsNativeModuleLoaderLog =
|
|||
|
||||
#define LOG(level, args) PR_LOG(nsNativeModuleLoaderLog, level, args)
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE1(nsNativeModuleLoader,
|
||||
nsIModuleLoader)
|
||||
|
||||
NS_IMPL_ADDREF_USING_AGGREGATOR(nsNativeModuleLoader,
|
||||
nsComponentManagerImpl::gComponentManager)
|
||||
NS_IMPL_RELEASE_USING_AGGREGATOR(nsNativeModuleLoader,
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
%import-idl "nsIEnumerator.idl"
|
||||
%import-idl "nsIComponentManager.idl"
|
||||
%import-idl "nsIServiceManager.idl"
|
||||
%import-idl "nsIWeakReference.idl"
|
||||
%import-idl "nsIInterfaceRequestor.idl"
|
||||
%import-idl "nsIComponentRegistrar.idl"
|
||||
%import-idl "nsIComponentManagerObsolete.idl"
|
||||
%import-idl "nsIStringEnumerator.idl"
|
||||
%import-idl "nsIModuleLoader.idl"
|
||||
%import-idl "nsICategoryManager.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsComponentManager.h"
|
||||
#include "nsCategoryManager.h"
|
||||
#include "nsNativeComponentLoader.h"
|
||||
%}
|
||||
|
||||
%pseudo-iid nsIServiceManagerObsolete cf0df3b0-3401-11d2-8163-006008119d7a
|
||||
|
||||
NS_IMPL_ISUPPORTS3(PLDHashTableEnumeratorImpl,
|
||||
nsIBidirectionalEnumerator,
|
||||
nsIEnumerator,
|
||||
nsISimpleEnumerator)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS7(nsComponentManagerImpl,
|
||||
nsIComponentManager,
|
||||
nsIServiceManager,
|
||||
nsISupportsWeakReference,
|
||||
nsIInterfaceRequestor,
|
||||
nsIComponentRegistrar,
|
||||
nsIServiceManagerObsolete,
|
||||
nsIComponentManagerObsolete)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsCategoryManagerFactory, nsIFactory)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(BaseStringEnumerator, nsISimpleEnumerator, nsIUTF8StringEnumerator)
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE1(nsNativeModuleLoader,
|
||||
nsIModuleLoader)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsCategoryManager, nsICategoryManager)
|
|
@ -79,10 +79,6 @@ CPPSRCS = \
|
|||
nsHashPropertyBag.cpp \
|
||||
$(NULL)
|
||||
|
||||
GQI_SRCS = \
|
||||
xpcomds.gqi \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsAtomService.h \
|
||||
nsCheapSets.h \
|
||||
|
|
|
@ -50,6 +50,12 @@ struct findIndexOfClosure
|
|||
|
||||
PR_STATIC_CALLBACK(PRBool) FindElementCallback(void* aElement, void* aClosure);
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutableArray)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIMutableArray)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsArray::~nsArray()
|
||||
{
|
||||
Clear();
|
||||
|
|
|
@ -66,6 +66,45 @@ static PLDHashTable gAtomTable;
|
|||
|
||||
static PLArenaPool* gStaticAtomArena = 0;
|
||||
|
||||
class nsStaticAtomWrapper : public nsIAtom
|
||||
{
|
||||
public:
|
||||
nsStaticAtomWrapper(const nsStaticAtom* aAtom, PRUint32 aLength) :
|
||||
mStaticAtom(aAtom), mLength(aLength)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStaticAtomWrapper);
|
||||
}
|
||||
~nsStaticAtomWrapper() { // no subclasses -> not virtual
|
||||
// this is arena allocated and won't be called except in debug
|
||||
// builds. If this function ever does anything non-debug, be sure
|
||||
// to get rid of the ifdefs in AtomTableClearEntry!
|
||||
MOZ_COUNT_DTOR(nsStaticAtomWrapper);
|
||||
}
|
||||
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID,
|
||||
void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
|
||||
NS_DECL_NSIATOM
|
||||
|
||||
const nsStaticAtom* GetStaticAtom() const {
|
||||
return mStaticAtom;
|
||||
}
|
||||
|
||||
PRUint32 getLength() const {
|
||||
return mLength;
|
||||
}
|
||||
|
||||
private:
|
||||
const nsStaticAtom* mStaticAtom;
|
||||
|
||||
// The length of the string in the static atom. The static atom
|
||||
// (nsStaticAtom) doesn't hold a length, so we keep it here in the
|
||||
// wrapper instead.
|
||||
PRUint32 mLength;
|
||||
};
|
||||
|
||||
// The |key| pointer in the various PLDHashTable callbacks we use is an
|
||||
// AtomTableClearEntry*. These pointers can come from two places: either a
|
||||
// (probably stack-allocated) string key being passed to PL_DHashTableOperate,
|
||||
|
@ -405,6 +444,8 @@ AtomImpl::~AtomImpl()
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(AtomImpl, nsIAtom)
|
||||
|
||||
PermanentAtomImpl::PermanentAtomImpl()
|
||||
: AtomImpl()
|
||||
{
|
||||
|
@ -525,6 +566,8 @@ nsStaticAtomWrapper::Release()
|
|||
return 1;
|
||||
}
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE1(nsStaticAtomWrapper, nsIAtom)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStaticAtomWrapper::GetUTF8String(const char** aResult)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,8 @@ ByteBufferImpl::Init(PRUint32 aBufferSize)
|
|||
return mBuffer ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(ByteBufferImpl,nsIByteBuffer)
|
||||
|
||||
ByteBufferImpl::~ByteBufferImpl()
|
||||
{
|
||||
if (nsnull != mBuffer) {
|
||||
|
|
|
@ -70,6 +70,13 @@ NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval)
|
|||
|
||||
NS_IMPL_THREADSAFE_ADDREF(nsHashPropertyBag)
|
||||
NS_IMPL_THREADSAFE_RELEASE(nsHashPropertyBag)
|
||||
NS_INTERFACE_MAP_BEGIN(nsHashPropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIPropertyBag, nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPropertyBag2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag2)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsresult
|
||||
nsHashPropertyBag::Init()
|
||||
|
@ -139,6 +146,22 @@ nsHashPropertyBag::DeleteProperty(const nsAString& name)
|
|||
// nsSimpleProperty class and impl; used for GetEnumerator
|
||||
//
|
||||
|
||||
class nsSimpleProperty : public nsIProperty {
|
||||
public:
|
||||
nsSimpleProperty(const nsAString& aName, nsIVariant* aValue)
|
||||
: mName(aName), mValue(aValue)
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPROPERTY
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIVariant> mValue;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsSimpleProperty, nsIProperty)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimpleProperty::GetName(nsAString& aName)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include "nsIWritablePropertyBag.h"
|
||||
#include "nsIWritablePropertyBag2.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
#include "nsIProperty.h"
|
||||
|
||||
// Set IMETHOD_VISIBILITY to empty so that the class-level NS_COM declaration
|
||||
// controls member method visibility.
|
||||
|
@ -87,18 +86,4 @@ protected:
|
|||
extern "C" NS_COM nsresult
|
||||
NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval);
|
||||
|
||||
class nsSimpleProperty : public nsIProperty {
|
||||
public:
|
||||
nsSimpleProperty(const nsAString& aName, nsIVariant* aValue)
|
||||
: mName(aName), mValue(aValue)
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPROPERTY
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIVariant> mValue;
|
||||
};
|
||||
|
||||
#endif /* nsHashPropertyBag_h___ */
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
|
||||
class nsIInputStream;
|
||||
|
||||
#define NS_IBYTE_BUFFER_IID \
|
||||
{ 0xe4a6e4b0, 0x93b4, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
#define NS_IBYTEBUFFER_IID \
|
||||
{ 0xe4a6e4b0, 0x93b4, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
|
|
@ -43,6 +43,25 @@
|
|||
#include "nsStringEnumerator.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
class nsINIParserImpl :
|
||||
public nsIINIParser
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIINIPARSER
|
||||
|
||||
nsresult Init(nsILocalFile* aINIFile) {
|
||||
return mParser.Init(aINIFile);
|
||||
}
|
||||
|
||||
private:
|
||||
nsINIParser mParser;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsINIParserFactory,
|
||||
nsIINIParserFactory,
|
||||
nsIFactory)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsINIParserFactory::CreateINIParser(nsILocalFile* aINIFile,
|
||||
nsIINIParser* *aResult)
|
||||
|
@ -78,6 +97,9 @@ nsINIParserFactory::LockFactory(PRBool aLock)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsINIParserImpl,
|
||||
nsIINIParser)
|
||||
|
||||
static PRBool
|
||||
SectionCB(const char* aSection, void *aClosure)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#define nsINIParserImpl_h__
|
||||
|
||||
#include "nsIINIParser.h"
|
||||
#include "nsINIParser.h"
|
||||
#include "nsIFactory.h"
|
||||
|
||||
#define NS_INIPARSERFACTORY_CID \
|
||||
|
@ -59,19 +58,4 @@ public:
|
|||
NS_DECL_NSIFACTORY
|
||||
};
|
||||
|
||||
class nsINIParserImpl :
|
||||
public nsIINIParser
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIINIPARSER
|
||||
|
||||
nsresult Init(nsILocalFile* aINIFile) {
|
||||
return mParser.Init(aINIFile);
|
||||
}
|
||||
|
||||
private:
|
||||
nsINIParser mParser;
|
||||
};
|
||||
|
||||
#endif // nsINIParserImpl_h__
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#define NS_IUNICHARBUFFER_IID \
|
||||
{ 0x14cf6970, 0x93b5, 0x11d1, \
|
||||
|
|
|
@ -129,6 +129,8 @@ nsObserverList::NotifyObservers(nsISupports *aSubject,
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsObserverEnumerator, nsISimpleEnumerator)
|
||||
|
||||
nsObserverEnumerator::nsObserverEnumerator(nsObserverList* aObserverList)
|
||||
: mIndex(0)
|
||||
{
|
||||
|
|
|
@ -141,6 +141,8 @@ nsPersistentProperties::Create(nsISupports *aOuter, REFNSIID aIID, void **aResul
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPersistentProperties::Load(nsIInputStream *aIn)
|
||||
{
|
||||
|
@ -476,6 +478,8 @@ nsPropertyElement::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsPropertyElement, nsIPropertyElement)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPropertyElement::GetKey(nsACString& aReturnKey)
|
||||
{
|
||||
|
|
|
@ -56,44 +56,6 @@ struct nsStaticAtom {
|
|||
nsIAtom ** mAtom;
|
||||
};
|
||||
|
||||
class nsStaticAtomWrapper : public nsIAtom
|
||||
{
|
||||
public:
|
||||
nsStaticAtomWrapper(const nsStaticAtom* aAtom, PRUint32 aLength) :
|
||||
mStaticAtom(aAtom), mLength(aLength)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStaticAtomWrapper);
|
||||
}
|
||||
~nsStaticAtomWrapper() { // no subclasses -> not virtual
|
||||
// this is arena allocated and won't be called except in debug
|
||||
// builds. If this function ever does anything non-debug, be sure
|
||||
// to get rid of the ifdefs in AtomTableClearEntry!
|
||||
MOZ_COUNT_DTOR(nsStaticAtomWrapper);
|
||||
}
|
||||
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID,
|
||||
void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
|
||||
NS_DECL_NSIATOM
|
||||
|
||||
const nsStaticAtom* GetStaticAtom() const {
|
||||
return mStaticAtom;
|
||||
}
|
||||
|
||||
PRUint32 getLength() const {
|
||||
return mLength;
|
||||
}
|
||||
|
||||
private:
|
||||
const nsStaticAtom* mStaticAtom;
|
||||
|
||||
// The length of the string in the static atom. The static atom
|
||||
// (nsStaticAtom) doesn't hold a length, so we keep it here in the
|
||||
// wrapper instead.
|
||||
PRUint32 mLength;
|
||||
};
|
||||
|
||||
// register your lookup function with the atom table. Your function
|
||||
// will be called when at atom is not found in the main atom table.
|
||||
|
|
|
@ -49,6 +49,73 @@
|
|||
// nsStringEnumerator
|
||||
//
|
||||
|
||||
class nsStringEnumerator : public nsIStringEnumerator,
|
||||
public nsIUTF8StringEnumerator,
|
||||
public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
nsStringEnumerator(const nsStringArray* aArray, PRBool aOwnsArray) :
|
||||
mArray(aArray), mIndex(0), mOwnsArray(aOwnsArray), mIsUnicode(PR_TRUE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsCStringArray* aArray, PRBool aOwnsArray) :
|
||||
mCArray(aArray), mIndex(0), mOwnsArray(aOwnsArray), mIsUnicode(PR_FALSE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsStringArray* aArray, nsISupports* aOwner) :
|
||||
mArray(aArray), mIndex(0), mOwner(aOwner), mOwnsArray(PR_FALSE), mIsUnicode(PR_TRUE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsCStringArray* aArray, nsISupports* aOwner) :
|
||||
mCArray(aArray), mIndex(0), mOwner(aOwner), mOwnsArray(PR_FALSE), mIsUnicode(PR_FALSE)
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIUTF8STRINGENUMERATOR
|
||||
|
||||
// have to declare nsIStringEnumerator manually, because of
|
||||
// overlapping method names
|
||||
NS_IMETHOD GetNext(nsAString& aResult);
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
|
||||
private:
|
||||
~nsStringEnumerator() {
|
||||
if (mOwnsArray) {
|
||||
// const-casting is safe here, because the NS_New*
|
||||
// constructors make sure mOwnsArray is consistent with
|
||||
// the constness of the objects
|
||||
if (mIsUnicode)
|
||||
delete const_cast<nsStringArray*>(mArray);
|
||||
else
|
||||
delete const_cast<nsCStringArray*>(mCArray);
|
||||
}
|
||||
}
|
||||
|
||||
union {
|
||||
const nsStringArray* mArray;
|
||||
const nsCStringArray* mCArray;
|
||||
};
|
||||
|
||||
inline PRUint32 Count() {
|
||||
return mIsUnicode ? mArray->Count() : mCArray->Count();
|
||||
}
|
||||
|
||||
PRUint32 mIndex;
|
||||
|
||||
// the owner allows us to hold a strong reference to the object
|
||||
// that owns the array. Having a non-null value in mOwner implies
|
||||
// that mOwnsArray is PR_FALSE, because we rely on the real owner
|
||||
// to release the array
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
PRPackedBool mOwnsArray;
|
||||
PRPackedBool mIsUnicode;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS3(nsStringEnumerator,
|
||||
nsIStringEnumerator,
|
||||
nsIUTF8StringEnumerator,
|
||||
nsISimpleEnumerator)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStringEnumerator::HasMore(PRBool* aResult)
|
||||
{
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
|
||||
#include "nsIStringEnumerator.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
// nsIStringEnumerator/nsIUTF8StringEnumerator implementations
|
||||
//
|
||||
|
@ -122,65 +120,3 @@ NS_COM nsresult
|
|||
NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult,
|
||||
const nsCStringArray* aArray,
|
||||
nsISupports* aOwner);
|
||||
|
||||
class nsStringEnumerator : public nsIStringEnumerator,
|
||||
public nsIUTF8StringEnumerator,
|
||||
public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
nsStringEnumerator(const nsStringArray* aArray, PRBool aOwnsArray) :
|
||||
mArray(aArray), mIndex(0), mOwnsArray(aOwnsArray), mIsUnicode(PR_TRUE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsCStringArray* aArray, PRBool aOwnsArray) :
|
||||
mCArray(aArray), mIndex(0), mOwnsArray(aOwnsArray), mIsUnicode(PR_FALSE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsStringArray* aArray, nsISupports* aOwner) :
|
||||
mArray(aArray), mIndex(0), mOwner(aOwner), mOwnsArray(PR_FALSE), mIsUnicode(PR_TRUE)
|
||||
{}
|
||||
|
||||
nsStringEnumerator(const nsCStringArray* aArray, nsISupports* aOwner) :
|
||||
mCArray(aArray), mIndex(0), mOwner(aOwner), mOwnsArray(PR_FALSE), mIsUnicode(PR_FALSE)
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIUTF8STRINGENUMERATOR
|
||||
|
||||
// have to declare nsIStringEnumerator manually, because of
|
||||
// overlapping method names
|
||||
NS_IMETHOD GetNext(nsAString& aResult);
|
||||
NS_DECL_NSISIMPLEENUMERATOR
|
||||
|
||||
private:
|
||||
~nsStringEnumerator() {
|
||||
if (mOwnsArray) {
|
||||
// const-casting is safe here, because the NS_New*
|
||||
// constructors make sure mOwnsArray is consistent with
|
||||
// the constness of the objects
|
||||
if (mIsUnicode)
|
||||
delete const_cast<nsStringArray*>(mArray);
|
||||
else
|
||||
delete const_cast<nsCStringArray*>(mCArray);
|
||||
}
|
||||
}
|
||||
|
||||
union {
|
||||
const nsStringArray* mArray;
|
||||
const nsCStringArray* mCArray;
|
||||
};
|
||||
|
||||
inline PRUint32 Count() {
|
||||
return mIsUnicode ? mArray->Count() : mCArray->Count();
|
||||
}
|
||||
|
||||
PRUint32 mIndex;
|
||||
|
||||
// the owner allows us to hold a strong reference to the object
|
||||
// that owns the array. Having a non-null value in mOwner implies
|
||||
// that mOwnsArray is PR_FALSE, because we rely on the real owner
|
||||
// to release the array
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
PRPackedBool mOwnsArray;
|
||||
PRPackedBool mIsUnicode;
|
||||
};
|
||||
|
|
|
@ -216,6 +216,8 @@ nsSupportsArray::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|||
return it->QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSupportsArray::Read(nsIObjectInputStream *aStream)
|
||||
{
|
||||
|
@ -680,6 +682,27 @@ NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult)
|
|||
return rv;
|
||||
}
|
||||
|
||||
class nsArrayEnumerator : public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISimpleEnumerator interface
|
||||
NS_IMETHOD HasMoreElements(PRBool* aResult);
|
||||
NS_IMETHOD GetNext(nsISupports** aResult);
|
||||
|
||||
// nsArrayEnumerator methods
|
||||
nsArrayEnumerator(nsISupportsArray* aValueArray);
|
||||
|
||||
private:
|
||||
~nsArrayEnumerator(void);
|
||||
|
||||
protected:
|
||||
nsISupportsArray* mValueArray;
|
||||
PRInt32 mIndex;
|
||||
};
|
||||
|
||||
nsArrayEnumerator::nsArrayEnumerator(nsISupportsArray* aValueArray)
|
||||
: mValueArray(aValueArray),
|
||||
mIndex(0)
|
||||
|
@ -692,6 +715,8 @@ nsArrayEnumerator::~nsArrayEnumerator(void)
|
|||
NS_IF_RELEASE(mValueArray);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsArrayEnumerator, nsISimpleEnumerator)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsArrayEnumerator::HasMoreElements(PRBool* aResult)
|
||||
{
|
||||
|
|
|
@ -168,25 +168,4 @@ private:
|
|||
nsSupportsArray(const nsISupportsArray& other);
|
||||
};
|
||||
|
||||
class nsArrayEnumerator : public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISimpleEnumerator interface
|
||||
NS_IMETHOD HasMoreElements(PRBool* aResult);
|
||||
NS_IMETHOD GetNext(nsISupports** aResult);
|
||||
|
||||
// nsArrayEnumerator methods
|
||||
nsArrayEnumerator(nsISupportsArray* aValueArray);
|
||||
|
||||
private:
|
||||
~nsArrayEnumerator(void);
|
||||
|
||||
protected:
|
||||
nsISupportsArray* mValueArray;
|
||||
PRInt32 mIndex;
|
||||
};
|
||||
|
||||
#endif // nsSupportsArray_h__
|
||||
|
|
|
@ -50,6 +50,8 @@ nsSupportsArrayEnumerator::~nsSupportsArrayEnumerator()
|
|||
NS_RELEASE(mArray);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsArrayEnumerator, nsIBidirectionalEnumerator, nsIEnumerator)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSupportsArrayEnumerator::First()
|
||||
{
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsIDImpl, nsISupportsID, nsISupportsPrimitive)
|
||||
|
||||
nsSupportsIDImpl::nsSupportsIDImpl()
|
||||
: mData(nsnull)
|
||||
{
|
||||
|
@ -105,6 +107,9 @@ NS_IMETHODIMP nsSupportsIDImpl::ToString(char **_retval)
|
|||
* nsSupportsCStringImpl
|
||||
*****************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsCStringImpl, nsISupportsCString,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMETHODIMP nsSupportsCStringImpl::GetType(PRUint16 *aType)
|
||||
{
|
||||
NS_ASSERTION(aType, "Bad pointer");
|
||||
|
@ -139,6 +144,9 @@ NS_IMETHODIMP nsSupportsCStringImpl::SetData(const nsACString& aData)
|
|||
* nsSupportsStringImpl
|
||||
*****************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsStringImpl, nsISupportsString,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMETHODIMP nsSupportsStringImpl::GetType(PRUint16 *aType)
|
||||
{
|
||||
NS_ASSERTION(aType, "Bad pointer");
|
||||
|
@ -171,6 +179,9 @@ NS_IMETHODIMP nsSupportsStringImpl::SetData(const nsAString& aData)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRBoolImpl::nsSupportsPRBoolImpl()
|
||||
: mData(PR_FALSE)
|
||||
{
|
||||
|
@ -209,6 +220,9 @@ NS_IMETHODIMP nsSupportsPRBoolImpl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint8Impl, nsISupportsPRUint8,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRUint8Impl::nsSupportsPRUint8Impl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -251,6 +265,9 @@ NS_IMETHODIMP nsSupportsPRUint8Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint16Impl, nsISupportsPRUint16,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRUint16Impl::nsSupportsPRUint16Impl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -293,6 +310,9 @@ NS_IMETHODIMP nsSupportsPRUint16Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint32Impl, nsISupportsPRUint32,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRUint32Impl::nsSupportsPRUint32Impl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -335,6 +355,9 @@ NS_IMETHODIMP nsSupportsPRUint32Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint64Impl, nsISupportsPRUint64,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRUint64Impl::nsSupportsPRUint64Impl()
|
||||
: mData(LL_ZERO)
|
||||
{
|
||||
|
@ -377,6 +400,9 @@ NS_IMETHODIMP nsSupportsPRUint64Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRTimeImpl, nsISupportsPRTime,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRTimeImpl::nsSupportsPRTimeImpl()
|
||||
: mData(LL_ZERO)
|
||||
{
|
||||
|
@ -419,6 +445,9 @@ NS_IMETHODIMP nsSupportsPRTimeImpl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsCharImpl, nsISupportsChar,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsCharImpl::nsSupportsCharImpl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -461,6 +490,9 @@ NS_IMETHODIMP nsSupportsCharImpl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt16Impl, nsISupportsPRInt16,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRInt16Impl::nsSupportsPRInt16Impl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -503,6 +535,9 @@ NS_IMETHODIMP nsSupportsPRInt16Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt32Impl, nsISupportsPRInt32,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRInt32Impl::nsSupportsPRInt32Impl()
|
||||
: mData(0)
|
||||
{
|
||||
|
@ -545,6 +580,9 @@ NS_IMETHODIMP nsSupportsPRInt32Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt64Impl, nsISupportsPRInt64,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsPRInt64Impl::nsSupportsPRInt64Impl()
|
||||
: mData(LL_ZERO)
|
||||
{
|
||||
|
@ -587,6 +625,9 @@ NS_IMETHODIMP nsSupportsPRInt64Impl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsFloatImpl, nsISupportsFloat,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsFloatImpl::nsSupportsFloatImpl()
|
||||
: mData(float(0.0))
|
||||
{
|
||||
|
@ -629,6 +670,9 @@ NS_IMETHODIMP nsSupportsFloatImpl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsDoubleImpl, nsISupportsDouble,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsDoubleImpl::nsSupportsDoubleImpl()
|
||||
: mData(double(0.0))
|
||||
{
|
||||
|
@ -672,6 +716,9 @@ NS_IMETHODIMP nsSupportsDoubleImpl::ToString(char **_retval)
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsVoidImpl::nsSupportsVoidImpl()
|
||||
: mData(nsnull)
|
||||
{
|
||||
|
@ -711,6 +758,10 @@ NS_IMETHODIMP nsSupportsVoidImpl::ToString(char **_retval)
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsInterfacePointerImpl,
|
||||
nsISupportsInterfacePointer,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
nsSupportsInterfacePointerImpl::nsSupportsInterfacePointerImpl()
|
||||
: mIID(nsnull)
|
||||
{
|
||||
|
@ -788,6 +839,8 @@ NS_IMETHODIMP nsSupportsInterfacePointerImpl::ToString(char **_retval)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsDependentCString,nsISupportsCString,nsISupportsPrimitive)
|
||||
|
||||
nsSupportsDependentCString::nsSupportsDependentCString(const char* aStr)
|
||||
: mData(aStr)
|
||||
{ }
|
||||
|
|
|
@ -74,6 +74,8 @@ UnicharBufferImpl::Init(PRUint32 aBufferSize)
|
|||
return mBuffer ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(UnicharBufferImpl, nsIUnicharBuffer)
|
||||
|
||||
UnicharBufferImpl::~UnicharBufferImpl()
|
||||
{
|
||||
if (nsnull != mBuffer) {
|
||||
|
|
|
@ -1689,6 +1689,8 @@ nsVariant::Traverse(const nsDiscriminatedUnion& data,
|
|||
/***************************************************************************/
|
||||
// members...
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsVariant, nsIVariant, nsIWritableVariant)
|
||||
|
||||
nsVariant::nsVariant()
|
||||
: mWritable(PR_TRUE)
|
||||
{
|
||||
|
|
|
@ -1,139 +0,0 @@
|
|||
%import-idl "nsIMutableArray.idl"
|
||||
%import-idl "nsIProperty.idl"
|
||||
%import-idl "nsIINIParser.idl"
|
||||
%import-idl "nsIFactory.idl"
|
||||
%import-idl "nsIVariant.idl"
|
||||
%import-idl "nsIPersistentProperties2.idl"
|
||||
%import-idl "nsISimpleEnumerator.idl"
|
||||
%import-idl "nsIStringEnumerator.idl"
|
||||
%import-idl "nsISupportsArray.idl"
|
||||
%import-idl "nsISerializable.idl"
|
||||
%import-idl "nsIAtom.idl"
|
||||
%import-idl "nsISupportsPrimitives.idl"
|
||||
%import-idl "nsIWritablePropertyBag.idl"
|
||||
%import-idl "nsIWritablePropertyBag2.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsArray.h"
|
||||
#include "nsIByteBuffer.h"
|
||||
#include "nsHashPropertyBag.h"
|
||||
#include "nsINIParserImpl.h"
|
||||
#include "nsVariant.h"
|
||||
#include "nsByteBuffer.h"
|
||||
#include "nsPersistentProperties.h"
|
||||
#include "nsUnicharBuffer.h"
|
||||
#include "nsObserverList.h"
|
||||
#include "nsStringEnumerator.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsAtomTable.h"
|
||||
#include "nsStaticAtom.h"
|
||||
#include "nsSupportsArrayEnumerator.h"
|
||||
#include "nsSupportsPrimitives.h"
|
||||
%}
|
||||
|
||||
%pseudo-iid nsIByteBuffer e4a6e4b0-93b4-11d1-895b-006008911b81
|
||||
%pseudo-iid nsIUnicharBuffer 14cf6970-93b5-11d1-895b-006008911b81
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIArray)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutableArray)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIMutableArray)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsSimpleProperty, nsIProperty)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsINIParserFactory,
|
||||
nsIINIParserFactory,
|
||||
nsIFactory)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsINIParserImpl,
|
||||
nsIINIParser)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsVariant, nsIVariant, nsIWritableVariant)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(ByteBufferImpl,nsIByteBuffer)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsHashPropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIPropertyBag, nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWritablePropertyBag)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPropertyBag2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag2)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsPropertyElement, nsIPropertyElement)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(UnicharBufferImpl, nsIUnicharBuffer)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsObserverEnumerator, nsISimpleEnumerator)
|
||||
|
||||
NS_IMPL_ISUPPORTS3(nsStringEnumerator,
|
||||
nsIStringEnumerator,
|
||||
nsIUTF8StringEnumerator,
|
||||
nsISimpleEnumerator)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsArrayEnumerator, nsISimpleEnumerator)
|
||||
|
||||
NS_IMPL_ISUPPORTS1(AtomImpl, nsIAtom)
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE1(nsStaticAtomWrapper, nsIAtom)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsArrayEnumerator, nsIBidirectionalEnumerator, nsIEnumerator)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsIDImpl, nsISupportsID, nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsCStringImpl, nsISupportsCString,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsStringImpl, nsISupportsString,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint8Impl, nsISupportsPRUint8,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint16Impl, nsISupportsPRUint16,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint32Impl, nsISupportsPRUint32,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRUint64Impl, nsISupportsPRUint64,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRTimeImpl, nsISupportsPRTime,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsCharImpl, nsISupportsChar,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt16Impl, nsISupportsPRInt16,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt32Impl, nsISupportsPRInt32,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsPRInt64Impl, nsISupportsPRInt64,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsFloatImpl, nsISupportsFloat,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsDoubleImpl, nsISupportsDouble,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsInterfacePointerImpl,
|
||||
nsISupportsInterfacePointer,
|
||||
nsISupportsPrimitive)
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSupportsDependentCString,nsISupportsCString,nsISupportsPrimitive)
|
||||
|
Загрузка…
Ссылка в новой задаче