The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Search
Feedback


XPIDL output (sample)

Last modified: Tue Nov 24 23:51:35 EST 1998

The input:

__declspec(inhibit) interface nsIBar { };

interface nsIFoo {
  attribute long myid;
  attribute boolean visible;
  attribute nsIBar parent;
  readonly attribute string name;
  void method(in string bogo, out string mips);
};

The output:

/* starting interface nsIFoo */
class nsIFoo {

  /* attribute long myid; */
  NS_IMETHOD GetMyid(PRInt32 &aMyid);
  NS_IMETHOD SetMyid(PRInt32 aMyid);

  /* attribute boolean visible; */
  NS_IMETHOD IsVisible(PRBool &aIsVisible);
  NS_IMETHOD SetVisible(PRBool aVisible);

  /* attribute nsIBar parent; */
  NS_IMETHOD GetParent(nsIBar * &aParent);
  NS_IMETHOD SetParent(nsIBar * aParent);

  /* readonly attribute string name; */
  NS_IMETHOD GetName(nsString * &aName);

  /* void method(in string bogo, out string mips); */
  NS_IMETHOD method(nsString * bogo, nsString * &mips);

};
Notes:
  • You should be able to say something a little less opaque than __declspec(inhibit) interface nsIBar to declare a dependency on another interface. Perhaps we can put some magic in so that we really do #include the other IDL file, but it has a __declspec(inhibit) conditionally visible (generated?).
  • Since all C++ methods have to return nsresult (via the NS_IMETHOD signature), I'm thinking about taking the IDL return type and making it an additional out param at the end of the list. (In the varargs case, I guess it'd go before the format specifier and ...?)

Mike Shaver



Copyright © 1998 The Mozilla Organization.