Brett wrote: > Hello, <snip> > >>From the documentation at >>http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/index.html > , I see that only certain specified types and non-scriptable "native > types" can be used. Do I understand it correctly that each XPCOM can > only create one class, and if you'd want more, you'd need to set up > independent components for each class? (And even if you did this, you > couldn't get around the limitation about methods with native types > (which I guess one's other components would become) not being > scriptable).
I'm not clear on what "each XPCOM" is. Each shared library (.dll/.so/.dylib) can contain multiple XPCOM components (with one factory each). A component is equivalent to a C++ class. Each XPIDL interface is a pure abstract class in C++; each component can implement multiple interfaces. (In fact, you would have to implement nsISupports plus some other interface to be useful...) While you can pass native types around, script won't be able to use them. For that, you'd need to wrap it in an interface. So the interfaces would look very much like a C++ struct, but you'd have to implement the various getters and setters in C++. > > The reason I ask is that the BDBXML API is of course quite > sophisticated, and arguments and return values are frequently listed > as specific classes. For each class here you would need an interface instead. There are also namespaces (which I guess are not > relevant in XPIDL/XPCOM?), operators, and other features in the C++ > code which I don't see detailed as having equivalents in the XPIDL > manual, so I'm wondering whether it is even possible to do this > implementation faithfully. I don't think there's any namespaces in XPIDL, nor operator overloading. You can't even have function overloading... > > thanks in advance, > Brett > HTH, -- Mook mook dot moz plus stuff at gmail yada yada _______________________________________________ dev-tech-xpcom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xpcom
