[prev in list] [next in list] [prev in thread] [next in thread]
List: mozilla-rdf
Subject: xpidl now generates NS_DECL_NSIFOO; tree spam in progress
From: Mike McCabe <mccabe () netscape ! com>
Date: 1999-08-22 8:49:14
[Download RAW message or body]
As of last Friday, xpidl generates an NS_DECL_NSIFOO macro when
processing an interface. For
interface nsIFoo : nsISupports {
void bar();
nsISupports sil();
}
xpidl will generate a .h file containing the following macro
definition:
/* Use this macro when declaring classes that implement this
interface. */
#define NS_DECL_NSIFOO \
NS_IMETHOD bar(void); \
NS_IMETHOD sil(nsISupports **_retval);
(xpidl also generates
/* Use this macro to declare functions that forward the behavior of
this interface to another object. */
#define NS_FORWARD_NSIFOO(_to) \
NS_IMETHOD bar(void) { return _to bar(void); } \
NS_IMETHOD sil(nsISupports **_retval) { return _to sil(_retval); }
... which could be useful too.)
For large interfaces, use of this macro is a big savings in lines of
code and cut-and-paste; if the interface changes, you'll no longer
need to copy the change in the implementation class declaration.
To encourage use of this macro (and because I'm a masochist) I'm in
the process of spamming the tree to use this macro. I'm replacing any
unambiguous, uncommented set of interface method declarations with the
corresponding NS_DECL_NSIFOO macro. I'm not touching any classes with
comments, wacky inheritance, or the like. If you'd like me to leave
your files alone, please let me know.
I've already landed a few batches of changes. More to come, but it's
a big job :)
I'm looking for volunteers to fix idl-intensive subtrees such as xpfe,
mailnews, rdf and netwerk. Mike Shaver has volunteered some copious
free time to fix rdf; any other takers?
Mike
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic