Skip to content

Commit

Permalink
Bug 313309 part 2 - change the NS_DEFINE_STATIC_IID_ACCESSOR macro to…
Browse files Browse the repository at this point in the history
… NS_DECLARE, and make a NS_DEFINE_ macro that's outside the class declaration, r=shaver
  • Loading branch information
bsmedberg%covad.net committed Nov 11, 2005
1 parent 01e0434 commit 78f6d06
Show file tree
Hide file tree
Showing 365 changed files with 1,332 additions and 454 deletions.
3 changes: 2 additions & 1 deletion camino/src/history/nsIHistoryDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class NS_NO_VTABLE nsIHistoryDisplay : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHISTORYDISPLAY_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHISTORYDISPLAY_IID)


/**
Expand All @@ -71,6 +71,7 @@ class NS_NO_VTABLE nsIHistoryDisplay : public nsISupports

};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHistoryDisplay, NS_IHISTORYDISPLAY_IID)

#define NS_DECL_NSIHISTORYDISPLAY \
NS_IMETHOD GetItemCount(PRUint32 *outCount); \
Expand Down
6 changes: 4 additions & 2 deletions camino/src/history/nsIHistoryItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class NS_NO_VTABLE nsIHistoryItem : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHISTORYITEM_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHISTORYITEM_IID)

NS_IMETHOD GetURL(nsACString& outURL) = 0;
NS_IMETHOD GetReferrer(nsACString& outReferrer) = 0;
Expand All @@ -95,6 +95,7 @@ class NS_NO_VTABLE nsIHistoryItem : public nsISupports
NS_IMETHOD GetID(nsACString& outIDString) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHistoryItem, NS_IHISTORYITEM_IID)

#define NS_DECL_NSIHISTORYITEM \
NS_IMETHOD GetURL(nsACString& outURL); \
Expand All @@ -115,7 +116,7 @@ class NS_NO_VTABLE nsIHistoryItems : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHISTORYITEMS_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHISTORYITEMS_IID)

/**
* GetMaxItemCount
Expand Down Expand Up @@ -149,6 +150,7 @@ class NS_NO_VTABLE nsIHistoryItems : public nsISupports

};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHistoryItems, NS_IHISTORYITEMS_IID)

#define NS_DECL_NSIHISTORYITEMS \
NS_IMETHOD GetMaxItemCount(PRUint32 *outCount); \
Expand Down
3 changes: 2 additions & 1 deletion camino/src/history/nsIHistoryObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class nsIHistoryObserver : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHISTORYOBSERVER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHISTORYOBSERVER_IID)

NS_IMETHOD HistoryLoaded() = 0;
NS_IMETHOD HistoryClosing() = 0;
Expand All @@ -72,6 +72,7 @@ class nsIHistoryObserver : public nsISupports

};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHistoryObserver, NS_IHISTORYOBSERVER_IID)

#define NS_DECL_NSIHISTORYOBSERVER \
NS_IMETHOD HistoryLoaded(); \
Expand Down
5 changes: 4 additions & 1 deletion content/base/public/mozISanitizingSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@
class mozISanitizingHTMLSerializer : public nsISupports {
public:

NS_DEFINE_STATIC_IID_ACCESSOR(MOZ_ISANITIZINGHTMLSERIALIZER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(MOZ_ISANITIZINGHTMLSERIALIZER_IID)

NS_IMETHOD Initialize(nsAString* aOutString,
PRUint32 aFlags,
const nsAString& allowedTags) = 0;
// This function violates string ownership rules, see impl.
};

NS_DEFINE_STATIC_IID_ACCESSOR(mozISanitizingHTMLSerializer,
MOZ_ISANITIZINGHTMLSERIALIZER_IID)

#endif
4 changes: 3 additions & 1 deletion content/base/public/nsIAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class nsDOMAttributeMap;
class nsIAttribute : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)

virtual void SetMap(nsDOMAttributeMap *aMap) = 0;

Expand Down Expand Up @@ -106,4 +106,6 @@ class nsIAttribute : public nsISupports
nsIAttribute(); // Not to be implemented.
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIAttribute, NS_IATTRIBUTE_IID)

#endif /* nsIAttribute_h___ */
4 changes: 3 additions & 1 deletion content/base/public/nsIContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class nsAttrValue;
*/
class nsIContent : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENT_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENT_IID)

nsIContent(nsINodeInfo *aNodeInfo)
: mParentPtrBits(0),
Expand Down Expand Up @@ -867,4 +867,6 @@ class nsIContent : public nsISupports {
nsCOMPtr<nsINodeInfo> mNodeInfo;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIContent, NS_ICONTENT_IID)

#endif /* nsIContent_h___ */
8 changes: 6 additions & 2 deletions content/base/public/nsIContentIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class nsIDOMRange;
class nsIContentIterator : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENTITERTOR_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTITERTOR_IID)

/* Initializes an iterator for the subtree rooted by the node aRoot
*/
Expand Down Expand Up @@ -98,12 +98,14 @@ class nsIContentIterator : public nsISupports
virtual nsresult PositionAt(nsIContent* aCurNode) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentIterator, NS_ICONTENTITERTOR_IID)

class nsIPresShell;

class nsIGeneratedContentIterator : public nsISupports {
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IGENERATEDCONTENTITERTOR_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGENERATEDCONTENTITERTOR_IID)

/* Initializes an iterator for the subtree rooted by the node aRoot
*/
Expand All @@ -112,6 +114,8 @@ class nsIGeneratedContentIterator : public nsISupports {
virtual nsresult Init(nsIPresShell *aShell, nsIContent* aContent) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIGeneratedContentIterator,
NS_IGENERATEDCONTENTITERTOR_IID)

#endif // __nsIContentIterator_h___

4 changes: 3 additions & 1 deletion content/base/public/nsIContentSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class nsIDOMDocument; /* forward declaration */
class nsIContentSerializer : public nsISupports {
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)

NS_IMETHOD Init(PRUint32 flags, PRUint32 aWrapColumn,
const char* aCharSet, PRBool aIsCopying) = 0;
Expand Down Expand Up @@ -103,6 +103,8 @@ class nsIContentSerializer : public nsISupports {
nsAString& aStr) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)

#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
"@mozilla.org/layout/contentserializer;1?mimetype="

Expand Down
3 changes: 2 additions & 1 deletion content/base/public/nsIDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class nsIDOMUserDataHandler;
class nsIDocument : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW

nsIDocument()
Expand Down Expand Up @@ -968,6 +968,7 @@ class nsIDocument : public nsISupports
PRUint32 mPartID;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID)

/**
* Helper class to automatically handle batching of document updates. This
Expand Down
9 changes: 7 additions & 2 deletions content/base/public/nsIDocumentEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class nsIDocumentEncoderNodeFixup : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOCUMENTENCODERNODEFIXUP_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENTENCODERNODEFIXUP_IID)

/**
* Create a fixed up version of a node. This method is called before
Expand All @@ -92,11 +92,14 @@ class nsIDocumentEncoderNodeFixup : public nsISupports
NS_IMETHOD FixupNode(nsIDOMNode *aNode, nsIDOMNode **aOutNode) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentEncoderNodeFixup,
NS_IDOCUMENTENCODERNODEFIXUP_IID)

class nsIDocumentEncoder : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_ENCODER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_ENCODER_IID)

/**
* Output methods flag bits.
Expand Down Expand Up @@ -264,5 +267,7 @@ class nsIDocumentEncoder : public nsISupports
NS_IMETHOD SetNodeFixup(nsIDocumentEncoderNodeFixup *aFixup) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentEncoder, NS_IDOCUMENT_ENCODER_IID)

#endif /* nsIDocumentEncoder_h__ */

4 changes: 3 additions & 1 deletion content/base/public/nsIDocumentObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef PRUint32 nsUpdateType;
class nsIDocumentObserver : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_OBSERVER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_OBSERVER_IID)

/**
* Notify that a content model update is beginning. This call can be
Expand Down Expand Up @@ -332,6 +332,8 @@ class nsIDocumentObserver : public nsISupports
virtual void DocumentWillBeDestroyed(nsIDocument *aDocument) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)

#define NS_DECL_NSIDOCUMENTOBSERVER \
virtual void BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType);\
virtual void EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType);\
Expand Down
4 changes: 3 additions & 1 deletion content/base/public/nsIHTMLToTextSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@
class nsIHTMLToTextSink : public nsISupports {
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHTMLTOTEXTSINK_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLTOTEXTSINK_IID)

NS_IMETHOD Initialize(nsAString* aOutString,
PRUint32 aFlags, PRUint32 aWrapCol) = 0;
// This function violates string ownership rules, see impl.
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLToTextSink, NS_IHTMLTOTEXTSINK_IID)

#endif
4 changes: 3 additions & 1 deletion content/base/public/nsINameSpaceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static const PRInt32 kNameSpaceID_None = 0;
class nsINameSpaceManager : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_INAMESPACEMANAGER_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_INAMESPACEMANAGER_IID)

virtual nsresult RegisterNameSpace(const nsAString& aURI,
PRInt32& aNameSpaceID) = 0;
Expand All @@ -98,6 +98,8 @@ class nsINameSpaceManager : public nsISupports
virtual PRBool HasElementCreator(PRInt32 aNameSpaceID) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsINameSpaceManager, NS_INAMESPACEMANAGER_IID)

nsresult NS_GetNameSpaceManager(nsINameSpaceManager** aInstancePtrResult);

void NS_NameSpaceManagerShutdown();
Expand Down
4 changes: 3 additions & 1 deletion content/base/public/nsINodeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class nsIPrincipal;
class nsINodeInfo : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_INODEINFO_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODEINFO_IID)

nsINodeInfo()
: mInner(nsnull, nsnull, kNameSpaceID_None),
Expand Down Expand Up @@ -311,4 +311,6 @@ class nsINodeInfo : public nsISupports
nsNodeInfoManager* mOwnerManager; // Strong reference!
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeInfo, NS_INODEINFO_IID)

#endif /* nsINodeInfo_h___ */
5 changes: 4 additions & 1 deletion content/base/public/nsIPrivateDOMImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ class nsIURI;
class nsIPrivateDOMImplementation : public nsISupports {

public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPRIVATEDOMIMPLEMENTATION_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRIVATEDOMIMPLEMENTATION_IID)

NS_IMETHOD Init(nsIURI* aBaseURI) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrivateDOMImplementation,
NS_IPRIVATEDOMIMPLEMENTATION_IID)

nsresult
NS_NewDOMImplementation(nsIDOMDOMImplementation** aInstancePtrResult);

Expand Down
4 changes: 3 additions & 1 deletion content/base/public/nsIRangeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class nsIContent;

class nsIRangeUtils : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRANGEUTILS_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRANGEUTILS_IID)

NS_IMETHOD_(PRInt32) ComparePoints(nsIDOMNode* aParent1, PRInt32 aOffset1,
nsIDOMNode* aParent2, PRInt32 aOffset2) = 0;
Expand All @@ -68,5 +68,7 @@ class nsIRangeUtils : public nsISupports {
PRBool *outNodeAfter) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIRangeUtils, NS_IRANGEUTILS_IID)

#endif /* nsIRangeUtils_h___ */

4 changes: 3 additions & 1 deletion content/base/public/nsIScriptElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*/
class nsIScriptElement : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTELEMENT_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTELEMENT_IID)

/**
* Content type identifying the scripting language. Can be empty, in
Expand All @@ -78,4 +78,6 @@ class nsIScriptElement : public nsISupports {
virtual PRUint32 GetScriptLineNumber() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptElement, NS_ISCRIPTELEMENT_IID)

#endif // nsIScriptElement_h___
5 changes: 4 additions & 1 deletion content/base/public/nsIStyleSheetLinkingElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class nsIStyleSheet;

class nsIStyleSheetLinkingElement : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID)

/**
* Used to make the association between a style sheet and
Expand Down Expand Up @@ -115,4 +115,7 @@ class nsIStyleSheetLinkingElement : public nsISupports {
virtual void SetLineNumber(PRUint32 aLineNumber) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleSheetLinkingElement,
NS_ISTYLESHEETLINKINGELEMENT_IID)

#endif // nsILinkingElement_h__
4 changes: 3 additions & 1 deletion content/base/public/nsITextContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class nsTextFragment;
*/
class nsITextContent : public nsIContent {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXT_CONTENT_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITEXT_CONTENT_IID)

nsITextContent(nsINodeInfo *aNodeInfo)
: nsIContent(aNodeInfo)
Expand Down Expand Up @@ -102,6 +102,8 @@ class nsITextContent : public nsIContent {
virtual void AppendTextTo(nsAString& aResult) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsITextContent, NS_ITEXT_CONTENT_IID)

// XXX These belong elsewhere
/**
* aNodeInfoManager must not be null.
Expand Down
5 changes: 4 additions & 1 deletion content/base/public/nsIXPathEvaluatorInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ class nsIXPathEvaluatorInternal : public nsISupports
{
public:

NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXPATHEVALUATORINTERNAL_IID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPATHEVALUATORINTERNAL_IID)

/**
* Sets the document this evaluator corresponds to
*/
NS_IMETHOD SetDocument(nsIDOMDocument* aDocument) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPathEvaluatorInternal,
NS_IXPATHEVALUATORINTERNAL_IID)

#endif //nsIXPathEvaluatorInternal_h__

0 comments on commit 78f6d06

Please sign in to comment.